[OS X TeX] distance section nu to section title

Ross Moore ross at ics.mq.edu.au
Wed May 31 17:54:10 EDT 2006

Hi Peter, Morton, and others.

On 31/05/2006, at 10:30 PM, Morten Høgholm wrote:

> On 5/31/06, Peter Dyballa <Peter_Dyballa at web.de> wrote:
>> Am 31.05.2006 um 12:31 schrieb Sergei Mariev:
>> > Is it possible to configure that parameter as well
>> There is also a "workaround:" \section{\hspace{±xmm}header text} ...
>> (It works quite OK since the horizontal space starts where LaTeX
>> would put the beginning of the header's text.)
> Good that you put that workaround in quotes... This would get written
> to the toc as well.

Also it would go into the Bookmarks listing.
Here it looks *really* bad, as you may end up with the numbers
for the distance actually showing in plain text.

Of course there are ways to filter out commands like \hspace
(and its arguments) when preparing the bookmarks, but it's
really much better to limit the argument of sectioning commands
to just the text of the heading, without any extra formatting frills.
It's the purpose of lower-level commands to handle all the
formatting issues.

The purpose of high-level commands such as \section
is to declare the name of the section.
Then packages can use this for all the kinds of things where
this piece of information (meta-data) may be needed;
    bookmarks, table-of-contents, index (perhaps),
    external  listings of contents of a volume, etc.

When used in this way only, it becomes much easier to
use the same source document to make different views
of your documents, using different processors:
  e.g., for HTML or XML, as well as  .dvi, .ps or .pdf .

> An alternative could be to do something like this:
> \makeatletter
> \renewcommand*\@seccntformat[1]{%
>  \@ifundefined{@seccntformat#1}%
>  {\@nameuse{the#1}\quad}% <- no special form exists
>  {\@nameuse{@seccntformat#1}}%
> }
> \newcommand*\@seccntformatsection{\thesection\hspace{2em}}
> \makeatother

This kind of switch, according to context, is a good way
to handle specialised formatting requirements.

> Morten



------------------------- 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