I have been googleing for several hours now, my goal is to have the same indent for each chapter/section. Meaning there is the number but every chapter starts for example at 3cm from the left margin. Do you know what I mean? 🙂
I am using the titlesec
package to customize fontsize, color and so on but I havent managed to get the spacing right. Therefore I tried to do it with two parboxes like that:
\titleformat{\section}
{\color{pt_Blau_04}\large\sffamily\bfseries}
{}
{0em}
{\parbox{1cm}{\flushleft\thesection}{\parbox{6cm}{\flushleft #1}}}
[\vspace*{5pt}]
If the chapter title is now doublespaced it looks really ugly and LaTeX just throws the parboxes around..
Do you guys know how to do it so every chapter/section/subsection starts at the same point?
Best Answer
Your idea is good, but you only have to use the appropriate lengths. If the box for the numbers has width
x
then the box for the titles has to have width equal to\textwidth-x
. In the following example, for the numbers I used a\makebox
of width\mylena
(initially set to1.5cm
) and for the titles a\parbox
with\raggedright
contents and width\mylenb=\textwidth-\mylena
. I used some definitions based on your snippet, but of course you can use your settings (notice that you'll need two separate, yet similar, definitions: one for numbered units and the other, for the unnumbered ones (through thenumberless
key)):