[OS X TeX] distance section nu to section title

Bruno Voisin bvoisin at mac.com
Wed May 31 08:44:21 EDT 2006


Le 31 mai 06 à 12:31, Sergei Mariev a écrit :

> I have defined some sectioning commands with the macro  
> @startsection. However, there seems to be no way to configure the  
> distance between the section number and the section title, i.e. the  
> amount of white space between the number and the beginning of the  
> section title. Is it possible to configure that parameter as well  
> [or have I overlooked something so obvious???? sorry in this case!]?

This is exactly the kind of topic covered in The LaTeX Companion.  
You've got to redefine \@seccntformat, defined by default in /Library/ 
teTeX/share/texmf.tetex/tex/latex/base/latex.ltx (= the source of the  
LaTeX format) as

\def\@seccntformat#1{\csname the#1\endcsname\quad}

so that there is one \quad of space (also called an enspace) between  
the number and the title. Put in the preamble of your document the  
redefinition:

\makeatletter
\renewcommand{\@seccntformat}[1]{\csname the#1\endcsname\hspace 
{myspace}}
\makeatother

to replace the \quad by a \hspace of width "myspace".

For example, to produce section titles of the form "1.1.  
Introduction", with a normal space between the number and the title,  
you would write

\makeatletter
\renewcommand{\@seccntformat}[1]{\csname the#1\endcsname. }
\makeatother

and for producing section titles of the form "1.1 -- Introduction"  
you would write

\makeatletter
\renewcommand{\@seccntformat}[1]{\csname the#1\endcsname\ -- }
\makeatother

The LaTeX Companion (1st edn) includes the example code

\makeatletter
\renewcommand{\@seccntformat}[1]{\fbox{\csname the#1\endcsname}\hspace 
{0.5em}}
\makeatother

to produce a boxed section number separated by half an emspace from  
the title.

Hope this helps,

Bruno Voisin


------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the MacOSX-TeX mailing list