I'm using memoir
class to write my master's thesis, and my university asks to align all section labels to the left. I say section, but I really mean all levels, as chapters, sections, subsecs and so on. So far, I've managed that.
The real problem is that they ask to align all the section titles based on the widest section label. I know that I can always guess what this length would be, but I was looking for an automatic way of getting this value from latex, so it would be easier when others wrote their thesis based on my source code (I'm kinda the pioneer on standardizing the text using latex...).
This is how it looks right now. I wanted a way to know that my widest label is the label 2.2.4, so I could tell memoir its length. And then, if I added a subsubsection there, the new widest would be 2.2.4.1 and, again, its length would be automatically passed to memoir.
Edit: Since the contents of my document are really a lot, I split it, putting each chapter in a different .tex
, including everything in the "master document". Also, I'm using pdflatex
from the standard texlive
that comes with Ubuntu 13.04.
Edit: Here is a MWE based on one of the answers:
File: main.tex
\documentclass{memoir}
\usepackage[T1]{fontenc}
\setsecnumdepth{subsubsection}
\settocdepth{subsubsection}
\maxsecnumdepth{subsubsection}
\maxtocdepth{subsubsection}
\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\include{chap1}
\include{chap2}
\end{document}
File: chap1.tex
\chapter{First Chapter}
\section{First Section}
\subsection{Subsection}
\subsection{Subsection}
\subsubsection{Subsubsection}
\subsubsection{Subsubsection}
\section{Second Section}
\subsection{Subsection}
\subsection{Subsection}
\subsubsection{Subsubsection}
\subsubsection{Subsubsection}
File: chap2.tex
\chapter{Second Chapter}
\section{First Section}
\subsection{Subsection}
\subsection{Subsection}
\subsubsection{Subsubsection}
\subsubsection{Subsubsection}
And I intend the TOC to output like this: