[texhax] Heading question

Donald Arseneau asnd at triumf.ca
Wed Feb 27 12:21:16 CET 2008


"D. R. Evans" <doc.evans at gmail.com> writes:

> \headline={\ifnum\count0>1 {\ifodd\count0 \hss \it \ifx\topmark\botmark
> \else \topmark \fi \hss \else \hss \it <book name> \hss\fi}\fi}
> 
> but the \ifx always calls the false branch -- probably I am
> misunderstanding something about what gets expanded when \ifx is called

Yes. \ifx expands nothing (besides itself:-) but compares the
meaning of the next two tokens. \topmark does not have the same
meaning as \botmark; they are different tokens.  You are 
thinking of them as macros, but they are built-in tokens.
Verify by \show.

An analogous mistake would be:

\parskip=15pt
\baselineskip=15pt
\ifx\parskip\baselineskip


Anyway, I don't think even the intent makes much sense.
Rather, I'd suggest

\newif\ifspecialpage

Then in your \chapter macro(s)

\vfill\supereject
\global\specialpagetrue
\ifodd\pageno\else
 \null \vfill \eject \global\specialpagetrue
\fi

and your headline tests \ifspecialpage, and also performs
\global\specialpagefalse.


-- 
Donald Arseneau                          asnd at triumf.ca


More information about the texhax mailing list