I'm using a page style where the header on odd-numbered pages includes
the name of the current section or subsection. There are two or three
places where, for one reason or another, I have more than one
sectioning command on the same page.
On a page like that (if it happens to be an odd-numbered page, that
is), LaTeX uses the name from the *first* sectioning command on the
page for the running head. My publisher, however, wants the running
head to use the *last* sectioning command on that page.
Does anyone have any advice on how to force LaTeX to do that? It
doesn't have to be a general solution; a solution where I manually
change the headings on each of these occasions is completely fine.
It's only a problem in two or three places, and there will be no more
changes that could affect page breaking.
> My publisher, however, wants the running
> head to use the *last* sectioning command on that page.
fancyhdr.sty. See fancyhdr.dvi for \lastrightmark.
Happy TeXing!
--
Axel Reichert -- http://mt.mpie-duesseldorf.mpg.de/people/reich/
MA> I'm having a minor problem with running headers in LaTeX.
MA> I'm using a page style where the header on odd-numbered pages includes
MA> the name of the current section or subsection. There are two or three
MA> places where, for one reason or another, I have more than one
MA> sectioning command on the same page.
MA> On a page like that (if it happens to be an odd-numbered page, that
MA> is), LaTeX uses the name from the *first* sectioning command on the
MA> page for the running head. My publisher, however, wants the running
MA> head to use the *last* sectioning command on that page.
MA> Does anyone have any advice on how to force LaTeX to do that? It
MA> doesn't have to be a general solution; a solution where I manually
MA> change the headings on each of these occasions is completely fine.
MA> It's only a problem in two or three places, and there will be no more
MA> changes that could affect page breaking.
LaTeX's standard classes use the rightmark for the section (in book/report)
or subsection (article). The Rightmark used in the header is always the
fiRst one of the page. So you need something that gives the Last rightmark
on the page. However, LaTeX doesn't have a command for that.
It is easily made. however:
The simplest solution is to use the fancyhdr and extramarks packages
(extramarks comes with fancyhdr), and use \lastrightmark in the pageheader
instead of \rightmark.
If that is too much for you, as a shortcut, you could redefine \rightmark
to give you the last mark instead of the first as follows:
\makeatletter
\def\rightmark{\expandafter\@rightmark\botmark{}{}{}{}}
\makeatother
--
Piet van Oostrum <pi...@cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: Piet.van...@gironet.nl