I'm trying to typeset something in LaTeX and I would like to know if I'm doing it right. The basic idea is that section number hangs in the left margin. The number takes the height of the header+2 lines for a chapter heading, +1 line for section heading, and has the same height as the header for subsections, and is aligned to the top of the heading. See the following image to get an idea of what I'm talking about:
http://img62.imageshack.us/img62/8404/bladld.png
My approach is using titlesec
and doing something like this:
\titleformat{\chapter}%
{\Huge\bfseries\sffamily}% format
{\vbox to 16pt{\llap{% label
\fontsize{3em}{0}\selectfont{\thechapter}%
\hskip 9pt%
}}}%
{0pt}% horizontal sep
{}% before
\titlespacing*{\chapter}%
{0pt}% left
{-2em}% before
{0pt}% after
But this solution has some hacks that I would rather avoid. The \vbox
height for instance, is found by trial and error. Visually, it looks almost right...
To put numbering and to show the subsubsection in table of contents, we need to define the counter value of “`tocdepth`” and “`secnumdepth`” in the preamble of your LaTeX document using “`\setcounter`”. Hope this helps.
LaTeX lets you change the appearance of the sectional units. As a simple example, you can change the section numbering to upper-case letters with \renewcommand\thesection{\Alph{section}} in the preamble (see \alph \Alph \arabic \roman \Roman \fnsymbol : Printing counters).
Brief Answer. The brief answer is, \section inserts a new entry into the table of contents at the appropriate tree-level and also inserts a new entry into the navigation bars. But \section* only adds an entry in the navigation bars, not in the table of contents.
Try using the memoir document class. That has a ton of options for doing exactly this kind of thing, and it's much neater...
There's a hangnum
style and for sections, there's a \hangsecnum
option, but that only puts the number in the margin: it doesn't make it bigger. Memoir is also fabulously documented. So I expect all everything you need will be there. The code for hangnum is on p.88 of the fantastic memoir manual. So from there and from later examples you should get all the pointers you need to get what you want...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With