![在同一节中创建两个子节时出现问题](https://linux22.com/image/302090/%E5%9C%A8%E5%90%8C%E4%B8%80%E8%8A%82%E4%B8%AD%E5%88%9B%E5%BB%BA%E4%B8%A4%E4%B8%AA%E5%AD%90%E8%8A%82%E6%97%B6%E5%87%BA%E7%8E%B0%E9%97%AE%E9%A2%98.png)
我有一个包含许多部分的 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}