[texhax] [solved] Re: Plain TeX headline issue

Rodolfo Medina rodolfo.medina at gmail.com
Sun May 2 14:58:28 CEST 2010


Rodolfo Medina <rodolfo.medina at gmail.com> writes:

> Rodolfo Medina a écrit :
>
>>> In order to have the section name in the headline, I've been using the
>>> plain TeX commands `\mark' and `\botmark'.  But, suppose that I want the
>>> section name in the leftheadline and the subsection name in the
>>> rightheadline: then I'd need two different \mark(s), whereas \mark is just
>>> one.  Can anyone suggest how it is possible to achieve what i want?
>
>
> Paul Isambert <zappathustra at free.fr> writes:
>
>> Try something like this (supposing you have \section and \subsection macros
>> with the name of the section as the argument):
>>
>> \def\section#1{%
>>  \mark{{#1}{}}%
>>  \def\currentsection{#1}%
>>  % definition of \section
>> }
>> \def\subsection#1{%
>>  \mark{{\currentsection}{#1}}
>> % definition of \subsection
>> }
>>
>> Then, the left headline calls \doleftmark and the right headline calls
>> \dorightmark:
>>
>> \def\doleftmark#1#2{#1}
>> \def\dorightmark#1#2{#2}
>>
>> And this must me called on an expanded \botmark (or other), e.g.:
>>
>> \expandafter\doleftmark\botmark


Thanks!  That seems to work fine.  Congratulations.

Rodolfo



More information about the texhax mailing list