[texhax] Heading question

D. R. Evans doc.evans at gmail.com
Wed Feb 27 21:27:04 CET 2008

Michael Doob said the following at 02/27/2008 12:55 PM :

> Maybe I've misunderstood the question. Here's what I had in mind for you.
> Define a new conditional
> \newif \iftitlepage
> and when you start a section use something like
> \def\section#1{%
>    #1 % section title printed, possible page eject and maybe other stuff
>    \titlepagetrue}
> For producing the correct headline use something like
> \headline= 
>   {\iftitlepage \hfil \global\titlepagefalse % do nothing on a title page
>    \else 
>          \ifodd\pageno
>          %print odd headline
>          \else 
>          %print even headline
>          \fi
>    \fi} 

OK; yes, that (I think) is the same scheme (although different code) as
Donald was suggesting: when you go to a new section, flag the page as being
special, then at the time that the page is output, check whether the page
is special.

This does definitely work (I have it working).

And please don't misunderstand: I am *very* appreciative of all the help.
But I am still wondering how one would implement what I regard as the more
elegant solution, which, pared down, becomes the question: how does one
implement a branch that depends on whether \topmark and \botmark have the
same contents?

I realise that in some sense this is a theoretical problem, since I now
have a working implementation that solves the original problem; still, it
bothers me quite a lot that I can't figure out how to do something
equivalent to:

  if (contents-of-\topmark == contents-of-\botmark)
    do this;
    do that;

It seems like that should be dead easy. But since \ifx doesn't expand
\topmark and \botmark, I can't see how to do it.


More information about the texhax mailing list