[tex-eplain] Multiple marks in eplain

John Was john.was at ntlworld.com
Thu May 28 12:41:49 CEST 2009


Hello

I am typesetting (in plain XeTeX) a volume which requires two elements to change in reaction to sideheadings, for which the multiple marks of eplain seem the ideal solution.  However, they *both* have to use the trick described in the TeXbook (p. 260) of selecting either the left or the right side of an \if statement:

\expandafter \iffalse \topmark\fi in the definition of the left headline, and

\expandafter \iftrue \botmark\fi in the definition of the right headline.

This works fine with bare \mark (but NB not if I use the alternative \marks 0), but I can't get it to work with \marks 1 - I get errors during compilation complaining of a missing } even though I can't see anything wrong with the grouping, and the error disappears if I use \mark instead of the \marks equivalent.  Thus the problem:  I actually need two separate elements to switch in this way.

Here is the relevant code from a version of the sideheading definition that does work smoothly:

\marks 1{#2}\mark{\shelement \noexpand \else #3

And at the end of the sideheading definition (after the sideheading has been typeset)

 \marks 1{#2}\mark{#3\noexpand \else #3}

But what I really want to give is:

\marks 1{\instelement \noexpand \else #2}\mark{\shelement \noexpand \else #3

and at the end of the sideheading definition:

 \marks 1{#2\else \#2}\mark{#3\noexpand \else #3}

In the headline definitions I would then of course need:

\expandafter \iffalse \topmarks1\fi in the left headline, and

\expandafter \iftrue \botmarks1\fi in the right headline

But when I make these changes I get the grouping error message described above and it fails to compile (or if I tell it to go ahead and compile quietly I get a rubbishy version of the headlines).

I've tried carefully putting {} round the various elements that might be confusing TeX, and I've tried both \marks1 and \marks 1 (with space) in case that made any difference.  I've also quickly tried a sample in plain TeX, though in fact I do need XeTeX as I am using open type fonts for this job and must have full Unicode.  In plain TeX the same thing happens:  simple \mark works but the \marks equivalents don't.

As it happens, nearly all the headings turn out correctly since one of the elements changes less frequently, and if absolutely necessary I could intervene manually with strategically placed \mark commands once the text has finally settled down.  But it would be much more satisfactory to have the system working stably in the first place.  Can anyone see what might be wrong?

John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/tex-eplain/attachments/20090528/620c06f2/attachment.html>


More information about the tex-eplain mailing list