Next: Formatting Mistakes Prev: Specifying the Type of Heading
Texinfo provides six commands for specifying headings and footings. The @everyheading command and @everyfooting command generate page headers and footers that are the same for both even- and odd-numbered pages. The @evenheading command and @evenfooting command generate headers and footers for even-numbered (left-hand) pages; and the @oddheading command and @oddfooting command generate headers and footers for odd-numbered (right-hand) pages.
Write custom heading specifications in the Texinfo file immediately after the @end titlepage command. Enclose your specifications between @iftex and @end iftex commands since the texinfo-format-buffer command may not recognize them. Also, you must cancel the predefined heading commands with the @headings off command before defining your own specifications.
Here is how to tell TEX to place the chapter name at the left, the page number in the center, and the date at the right of every header for both even- and odd-numbered pages:
@iftex
@headings off
@everyheading @thischapter @| @thispage @| @today{}
@end iftex
You need to divide the left part from the central part and the central part from the right part by inserting `@|' between parts. Otherwise, the specification command will not be able to tell where the text for one part ends and the next part begins.
Each part can contain text or @-commands. The text is printed as if the part were within an ordinary paragraph in the body of the page. The @-commands replace themselves with the page number, date, chapter name, or whatever.
Here are the six heading and footing commands:
@everyheading left @| center @| right
@everyfooting left @| center @| right
@evenheading left @| center @| right
@oddheading left @| center @| right
@evenfooting left @| center @| right
@oddfooting left @| center @| right
@iftex and @end iftex commands.
Here are the `@this...' commands:
@thispage
@thischaptername
@thistitle
@settitle command.
@thisfile
@include files only: expands to the name of the current @include file. If the current Texinfo source file is not an @include file, this command has no effect. This command does not provide the name of the current Texinfo source file unless it is an @include file. (See Include Files, for more information about @include files.)
@today{} command, which expands to the current date, in `1 Jan 1900' format.
Other @-commands and text are printed in a header or footer just as if they were in the body of a page. It is useful to incorporate text, particularly when you are writing drafts:
@iftex
@headings off
@everyheading @emph{Draft!} @| @thispage @| @thischapter
@everyfooting @| @| Version: 0.27: @today{}
@end iftex
Beware of overlong titles: they may overlap another part of the header or footer and blot it out.