[OS X TeX] aligning section titles of different levels below each other

Alan Munn amunn at msu.edu
Wed Feb 14 12:39:51 CET 2007


At 11:46 AM +0100 2/14/07, Sergei Mariev wrote:

>And this code, i.e. \makebox instead of \fbox does not work for me at all:
>
>\makeatletter
>\renewcommand{\@seccntformat}[1]{\makebox[1cm][l]{\csname 
>the#1\endcsname}\hspace{0.5em}}
>\makeatother
>
>Could someone suggest a solution how to make the section titles 
>begin exactly at the same distance from the margin no matter how 
>much space the section number takes?

Commands with optional arguments are fragile and need a \protect 
command.  So the following will work:

\makeatletter
\renewcommand{\@seccntformat}[1]{\protect\makebox[1cm][l]{\csname 
the#1\endcsname}\hspace{0.5em}}
\makeatother

Alan

-- 
Alan Munn 
amunn at msu.edu
Department of Linguistics                             
and Germanic, Slavic, Asian and African Languages   Fax.  +1-517-432-2736
Michigan State University, East Lansing MI 48824       Tel.  +1-517-355-7491

------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the macostex-archives mailing list