Typography with TeX and LaTeX

## Hack: change starred command into unstarred

Juni 17th, 2008 by Stefan Kottwitz

Some packages like nomencl, glossary and environments like thebibliography in standard LaTeX classes use the starred sectioning forms \chapter* and \section*. Even if they provide an option to let them added to the table of contents it may be required to use numbered sectioning. In that case you could look at the corresponding source code (article.cls, nomencl.sty, glossary.sty, …) and redefine thebibliography by \renewenvironment or redefine thenomenclature of the nomencl package etc.

Here I will show a way without redefining certain internal environments. I will use the TeX commands \def and \let to temporarily change the meaning of \section:

\let\stdsection\section \def\section*#1{\stdsection{#1}} \printnomenclature % \printglossary \let\section\stdsection

If you are interested in testing it by yourself you can find complete examples here.

This topic was discussed on mrunix.de and in the LaTeX Community Forum.

This entry was posted on Dienstag, Juni 17th, 2008 at 18:46 and is filed under Sectioning, plain TeX. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.