4

I am new to TeX. I have a document with subsubsections and paragraphs.

I don't wand the paragraphs inside the block, they should be bevor the block, like the subsubsection header bevor.

The other problem is, that subsubsections and paragraphs don't get enumerated and furthermore they're not listed inside ToC. Is there a possibility to solve this problem without doing it manually?

I use TeXmaker.

4

To number subsubsections and paragraphs, set the secnumdepth counter to 4 (the paragraph level); to get them into the ToC, change the tocdepth counter also to 4; to change the formatting for the paragraph headings, you can use the titlesec package; a little example:

\documentclass{article}
\usepackage{titlesec}
\usepackage{lipsum}

\titleformat{\paragraph}
  {\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titlespacing*{\paragraph}
  {0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}

\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}

\begin{document}

\tableofcontents
\section{Test section}
\subsection{Test subsection}
\subsubsection{Test subsubsection}
\lipsum[2]
\paragraph{Test paragraph}
\lipsum[2]

\end{document}

enter image description here

If, for some reason, using titlesec is not an option, you can redefine \paragraph; here's a little example of this approach:

\documentclass{article}
\usepackage{lipsum}

\makeatletter
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
  {-3.25ex\@plus -1ex \@minus -.2ex}%
  {1.5ex plus .2ex}%
  {\normalfont\normalsize\bfseries}}
\makeatother

\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}

\begin{document}

\tableofcontents
\section{Test section}
\subsection{Test subsection}
\subsubsection{Test subsubsection}
\lipsum[2]
\paragraph{Test paragraph}
\lipsum[2]

\end{document}
3
  • Nice! Just a question: do you type this now to the answer or do you copy this example from somewhere?
    – Sigur
    Oct 29 '12 at 13:57
  • @Sigur copy the example? I think I don't understand your question? In the first solution I used titlesec's documentation to get the default settings for \paragraph and then changed them to produce the required formatting. In the second solution, I used the standard settings for \paragraph from article.cls and then made the necessary modifications. Oct 29 '12 at 14:04
  • Don't worry! I was asking if you type all the answer by hand or if you copy and paste the codes from some website or guide or pdf. I'm asking just for curiosity. I can not image how much time it takes you to type this. See you.
    – Sigur
    Oct 29 '12 at 21:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.