LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Javier Bezos <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Sun, 31 Oct 1999 18:54:02 +0100
text/plain (123 lines)
> o should there be user level control on whether or not a heading has
>   a number? (or are those things logically simply different tags and
>   we are only used to saying \chapter* instead of \frontmatterchapter
>   or whatever because nothing else was available)
>   in other words is this really a flexibility that is needed/wanted
>   or only there to hide the fact that some general functionality is
>   missing?
> \chapter*{BAR}
>makes a heading with no number but BAR in the toc and in runhead
> \chapter**{BAR}
>makes a heading with no number and no toc entry but BAR  in runhead
>if you really would like to have a number but no toc entry this would
>be possible as well but only with some difficulty:
> \chapter[]*{BAR}

The more I analyze this problem, the more I become convinced that
the star mechanism should be avoided in favour of a markup-like
syntax. Let's suppose there are some sections containing exercises.
Instead of using a starred version, we could use an environment:

\section{Not so easy}

If headings (or their short form) are in the TOC or in the headlines
is a decision taken by exercises, which in addition may set the
text to \small, add the word "Exercises" to the head, etc. (At
the end of this message, I copy part of the manual of one of my
packages, which it's to the point.) The mean to get this could
be to provide a set of flags which determine the behaviour of
section headings; these flags shouldn't be changed directly in
the main document but through an intermediary (in this example,
the exercises environment). For instance:

The natural way of doing that in template is \UseCollection, but
another possibility is to use a key which will expand at
\UseInstance with the actual flag values in "usual" tex macros.
Perhaps in a future a new structure could be created so that
\sections are not inside an environment (other than document)
and flags are properly handled.



The following definition supresses numbers but neither toc lines
nor headers.

The following one adds a toc line but headers will remain

The following one updates the headers but there will be
no toc line:
(I find the latter a bit odd in this particular example; the
first and second options are more sensible. The |\ignorespaces|
is not very important, and you needn't it unless there is
unwanted space in the toc.)

That works with standard classes, but if you are using
\textsf{fancyhdr} or \textsf{titlesec} to define headers you need an
extra command. I will name it |\printthesection| and you
could define it in the preamble as follows:
\newcommand{\printthesection}{\thesection\ }
If you define the header with \textsf{titlesec}, for instance:
then you have to write:
and so on.

As you can see, there are no |\addcontentsline|, no
|\markboth|, no |\section*|, just logical structure. Of
course you may change it as you wish; for example if you decide
that these sections should be typeset in small typeface, include
|\small|, and if you realize that you don't like that, remove it.

While the standard LaTeX commands are easier and more
direct for simple cases, I think the proposed method above is
far preferable in large documents.