[texhax] Simple question?

Robin Fairbairns Robin.Fairbairns at cl.cam.ac.uk
Sat Sep 6 00:20:53 CEST 2003


> On Fri, Sep 05, 2003 at 18:56:02hrs +0530, Prof. Sudhir R. Ghorpade wrote:
> 
> > Hi! In a large LaTeX file with \documentclass{book}
> > I have several chapters, each with several sections. 
> > I don't want to number some sections; so I use: 
> >    \section*{Secname} 
> > This works nicely and the section title "Secname" also 
> > appears in the Table of Contents with no number. However, 
> > in the headers for the pages, which usually alternate between
> >   Chapter Name  and Section Name 
> > I get the name of the previous section (where * was not
> > used) rather than Secname. 
> > 
> > How can I arrange "Secname" (without any number) to appear 
> > in the header without having to change \section* to \section?
> 
> You can use a \markright{<whatever you want>} immediately after \section*,
> or put them together into a \mysection.

unfortunately, that doesn't work entirely satisfactorily (see
discussion in http://www.tex.ac.uk/cgi-bin/texfaq2html?label=runheadtoobig)
and i find the alternative rather tiresome.

the alternative is to juggle the value of the secnumdepth counter, so
as to prevent \section commands getting a number (i think this would
involve

  \newcounter{savesecnum}
  ...
  \setcounter{savesecnum}{\value{secnumdepth}}
  \setcounter{secnumdepth}{0}
  \section{title}
  \setcounter{secnumdepth}{\value{savesecnum}}

(unfortunately, it has to be this convoluted, because \setcounter is a
global operation.)


More information about the texhax mailing list