# Align all text (excluding section/list numbers)

I am attempting to align all of my text, with the exclusion of the section numbering and enumerate numbering, aligned at the same indent/vertical rule. Basically, the section/list numbering would be all in one column and the text that accompanies it would be in another (though I don't believe the multicol environment would be ideal for this for many reasons).

This alignment follows the standard formatting for the document type I'm working on, hence the somewhat weird format.

\documentclass{report}
\usepackage{lipsum}

%----Change default LaTeX section styles---------------------------
\usepackage{titlesec} % Lets user adjust section header formatting

\renewcommand\thesection{25.\arabic{section}}   %Add "25." before section numbering
\setcounter{section}{-1}   %Set first section number to "0"

\titleformat{\section}{\normalfont\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}{\normalfont\bfseries}{\thesubsection}{1em}{}
%-----------------------------------------------------------------

\setlength\parindent{0pt}   %no indent for all paragraphs

\begin{document}

\section[Introduction]{INTRODUCTION}

\subsection{Scope}

\lipsum[1]

\begin{enumerate}
\item This is Item 1.
\item Oh look, another item!
\item This is getting out of hand.
\end{enumerate}

\lipsum[2]

\end{document}


My MWE generates something like this:

But what I'm looking for is more like this:

• What happens for nested lists? Are there any? – Werner Mar 31 '17 at 21:18
• @Werner, nested lists would have the same behavior (ex. Item 1, Subitem a would also have the "a" in the left margin space) – grfrazee Mar 31 '17 at 21:24

An easy solution with titlesec and enumitem:

\documentclass{report}

\usepackage{lipsum}

\setlength\parindent{0pt} %no indent for all paragraphs
\usepackage{titlesec}
%Set first section number to "0"
\titleformat{\section}{\normalfont\bfseries}{\llap{\makebox[0.6in][l]{\thesection}}}{0em}{\MakeUppercase}
\titleformat{\subsection}{\normalfont\bfseries}{\llap{\parbox{0.6in}{\thesubsection}}}{0em}{}
\usepackage{enumitem}
\setlist[enumerate]{labelwidth = \dimexpr0.6in-\labelsep, align = left, leftmargin = 0pt}
\setlist[enumerate, 2]{label=\alph*.}
\renewcommand{\rmdefault}{\sfdefault}

\begin{document}

\setcounter{chapter}{24}
\setcounter{section}{-1}
\section[Introduction]{Introduction}
\subsection{Scope}

\lipsum[1]

\begin{enumerate}
\item This is Item 1.
\item Oh look,other items!
\begin{enumerate}%[label =\alph. ]
\item A first subitem
\item Another subitem
\end{enumerate}
\item This is getting out of hand.
\end{enumerate}
Lalala

\section{Another section}

\lipsum[2]

\end{document}


• please see the revised MWE. I have a couple updates. – grfrazee Apr 4 '17 at 14:32
• Please see the modified answer. – Bernard Apr 4 '17 at 14:58
• Thanks. Is it still possible to alter the format of the section and subsection headers? See my \titleformat changes in the MWE. – grfrazee Apr 4 '17 at 15:02
• Do you obtaining the same result with the advanced interface of titlesec? – Bernard Apr 4 '17 at 15:10
• Changing the header format using \titleformat requires an argument for <sep> between the number and the header, which negates the coding you added with \titlelabel. I'm not particularly well-versed in titlesec to make any additional changes using the Advanced Interface. – grfrazee Apr 4 '17 at 15:19

\documentclass{report}
\usepackage{lipsum}

\setlength\parindent{0pt}   %no indent for all paragraphs
\makeatletter
\leftmargini0pt

\begin{document}

\section[Introduction]{INTRODUCTION}

\subsection{Scope}

\lipsum[1]

\begin{enumerate}
\item This is Item 1.
\item Oh look, another item!
\item This is getting out of hand.
\end{enumerate}

\lipsum[2]

\end{document}


For left aligned section numbers:

\def\@seccntformat#1{\noindent\llap{\makebox[1in][l]{\csname the#1\endcsname}}}


or with a bit of help from enumitem left aligned list labels as well

\documentclass{report}
\usepackage{lipsum}
\usepackage{enumitem}
\setlength\parindent{0pt}   %no indent for all paragraphs
\makeatletter
\def\@seccntformat#1{\noindent\llap{\makebox[1in][l]{\csname the#1\endcsname}}}

\setlist{leftmargin=0pt,align=left,labelwidth=1in,labelsep=0pt}
\begin{document}

\section[Introduction]{INTRODUCTION}

\subsection{Scope}

\lipsum[1]

\begin{enumerate}
\item This is Item 1.
\item Oh look, another item!
\item This is getting out of hand.
\end{enumerate}

\lipsum[2]

\end{document}

• Is it possible to align the numbers all of the left side? – grfrazee Mar 31 '17 at 22:09
• er yes if you say how wide the widest one will be if you have sub sub section 100 of section 1000 do you need space for 1000.100.100.1 ? – David Carlisle Mar 31 '17 at 22:10
• your example had enumeration numbers flush right though (it seems) so just headings flush left? – David Carlisle Mar 31 '17 at 22:10
• The deepest it would go is probably 99.99.99.99, I think. – grfrazee Mar 31 '17 at 22:11
• Enumeration also left-aligned. Sorry, on mobile now and can't update the image. – grfrazee Mar 31 '17 at 22:12