0

I have a document Latex that contains many sections. In a given section I want to create two subsections that contain each different subparagraphs. I don't know why I get an error when compiling it (! Argument of \@sect has an extra }.\par \subsection)? Here is my code:

 \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}
}

Could you please help me ?

Sean Allred
  • 27,421
Othmane
  • 113
  • Welcome to TeX SE! Please complete your code to make it a complete, small document. Try deleting \paragraph{~\newline}. – cfr Nov 24 '14 at 01:40
  • Not to mention the itemize pretending to be enumerate within \subsection… I would really recommend reading an introduction to LaTeX. The Wikibook is a pretty solid reference. After you read that, I'd also recommend something a little more up-to-date (like texdoc lshort). – Sean Allred Nov 24 '14 at 01:45

1 Answers1

1

Your problem arises from trying to include an environment inside a sectioning command. LaTeX is not XML – don't pretend it is! It's a common mistake, but a critical one.

You have a ton of other problems in this document – at this point, it isn't really salvageable. Work from this:

\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}

output

Sean Allred
  • 27,421
  • I'll note that those are separate paragraphs being created at the end. Since \parskip is zero and each of the paragraphs are one line, they are aligned together at \parindent. Make the paragraphs longer and you'll see what I mean. There are other questions on this site that are concerned with adding space between paragraphs. – Sean Allred Nov 24 '14 at 02:03
  • I tried this because I want subsection 1 and subsection2 to appear in the table of contents as two subsection. Is there a way to do this with do way you did with subparagraphs ? – Othmane Nov 24 '14 at 03:43
  • I do not understand what you say – I am sorry. :( You can try \setcounter{tocdepth}{5}. That will include five levels in the table of contents. You can also try using different sectioning commands: \section, \subsection, \subsubsection, \paragraph, and \subparagraph. I do recommend reading a LaTeX tutorial – there are tutorials in many languages. – Sean Allred Nov 24 '14 at 04:19