在同一节中创建两个子节时出现问题

在同一节中创建两个子节时出现问题

我有一个包含许多部分的 Latex 文档。在给定的部分中,我想创建两个包含不同子段落的子部分。我不知道为什么在编译时会出错(!\@sect 的参数有一个额外的 }.\par \subsection)?这是我的代码:

 \section{ Title}
 \subsection{subsection 1}
 \paragraph{~\newline}
 \subparagraph{ first subparagraph}
 \subparagraph{... (something between parenthesis)}
 \subparagraph{4 choices::
 \begin{itemize}
  \item 1.
  \item 2.
  \item 3.    
  \item 4.
 \end{itemize}
 }
 \subsection{subsection 2}
 \paragraph{~\newline}
 \subparagraph{1}
 \subparagraph{2}
 \subparagraph{ 3 .... here I include two parenthesis because I have them in my     original paragraph \left(something\right)}
\begin{itemize}
\item 1.    
\item 2.
\end{itemize}
}

请你帮助我好吗 ?

答案1

你的问题是由于试图在分段命令中包含环境而引起的。LaTeX 是不是XML – 不要假装它是!这是一个常见的错误,但却是一个严重的错误。

这份文档中还有大量其他问题 - 目前,它已经无法挽救。请从以下方面着手:

\documentclass{article}

\title{Title}

\begin{document}
\maketitle

\section{Some Section}
Text text text

% I personally have never found a use for \(sub)paragraph,
% but this is how I'd use it.
\subparagraph{Introductory sentence.}
Text text text.

\subparagraph{We have four choices.}
\begin{enumerate}
\item Option
\item Option
\item Option    
\item Option
\end{enumerate}

\section{Some Other Section}

\subparagraph{Intro sentence.}
Text text text

Paragraphs are created by empty lines in your source file.

See?  That was much easier!

\begin{itemize}
\item Use `enumerate' for ordered lists.
\item Use `itemize' for \emph{unordered} lists.
\end{itemize}
\end{document}

输出

相关内容