[texhax] Simple question?

Robin Fairbairns Robin.Fairbairns at cl.cam.ac.uk
Sat Sep 6 01:04:47 CEST 2003


> On Fri, Sep 05, 2003 at 23:20:53hrs +0100, Robin Fairbairns wrote:
> 
> > > On Fri, Sep 05, 2003 at 18:56:02hrs +0530, Prof. Sudhir R. Ghorpade wrote:
> > > 
> > > > 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.
> 
> If we use the method described in the above URL, will we get the solution
> to the OP's question? If we use \sectionmark, it would print \thesection on
> the header, which is unwanted. Further, \sectionmark is called by \@sect,
> which is called by \section only and not by \section*. Therefore, if we use
> \section*, there is no way of changing the header, unless we redefine
> \sectionmark, or use \rightmark.

no; you're quite right: \section* doesn't call \sectionmark, which is
the whole basis of the problem.  using the technique outlined in my
faq answer --

  \section*{unnumbered section\sectionmark{unnumbered section}}
  \sectionmark{unnumbered section}

but as i said, i believe it's a rather bad use of a poorly-thought out
mechanism in latex, and i prefer to achieve the non-numbering by
juggling secnumdepth.

(since i'm only just out of hospital, and in rather a lot of pain, i'm
fuddled as to what effect the juggling will have on the table of
contents.  i think it does the right thing.)


More information about the texhax mailing list