I am struggling trying to put together some technical documents (using the article
class). Is there a way to allow page breaks directly after a section title? If possible, I would like to let some of the subsection levels to break directly after the subsection header.
At several points in the document, I have to create lists using the section numbering and need the text next to the number. Until now, I have had an empty title and the text forced indented with adjustwidth following, but I need to be able to have the text on the same line as the number. I also would like to not have to force page breaks to prevent run off of the page when I am in one of these numbered lists. When I have tried using something like:
\paragraph{beginning of the text} continuation of text
or defining these levels with runin, I cannot get the entire thing indented: only the first line (which I also have to have).
Here is my section title formatting and example: (I apologize if it is messy or poorly written)
\documentclass[12pt]{article}
\usepackage{titlesec}
\setcounter{secnumdepth}{5}%sets depth of numbering system
\setcounter{tocdepth}{1}
\titleformat{\subsection}[hang]{\normalfont\large\bfseries}{\thesubsection}{1em}{}
\titlespacing*{\subsection} {1em}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\titleformat{\subsubsection}[hang]{\normalfont\normalsize}{\thesubsubsection}{1em}{}
\titlespacing*{\subsubsection} {2em}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\titleformat{\paragraph}[hang]{\normalfont\normalsize}{\theparagraph}{1em}{}
\titlespacing*{\paragraph} {3em}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\titleformat{\subparagraph}[hang]{\normalfont\normalsize}{\thesubparagraph.}{1em}{}
\titlespacing*{\subparagraph} {4em}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\begin{document}
\section{title}
\subsection{title 2}
\subsubsection{title 3}
\paragraph{list item 1}
\paragraph{list item 2}
\paragraph{list item 3}
\end{document}
EDIT: To clarify from some comments: I need the list structure to be indented and have the numbering with it (ex. 1.1.1.1 not just 1 as I would get with enumeration)
I also need the whole thing (sometimes a sentence or list item, sometimes paragraphs(hear meaning blocks of text, not the section title) as they have to be numbered) to be indented to the same point, preferably similar to a hang but not necessarily.
I can currently make it work with some specifically placed breaks, but as the document is edited, these are constantly having to be moved. I would like to let the document break around the headings without necessarily needing text underneath the heading.
I hope this helps to what I am hoping to achieve. Thanks!
\paragraph
for list items seems wrong. You should take a look at theenumitem
package for that. For the rest, can you clarify exactly what you want by providing an example of how the text should look? Normally page breaks after section headers are poor style, and I'm not sure iftitlesec
supports such an option off hand.\pagebreak
after the section.