[texhax] kern inside llap inside headline

Philip TAYLOR P.Taylor at Rhul.Ac.Uk
Mon Jan 2 23:55:01 CET 2012


Can't replicate the problem, Suresh : there must be
something you aren't telling us !  Here is my test
code -- note the addition of three key lines marked
%%% PT %%%

Philip Taylor
--------
% !TeX Program = PdfTeX

   % The headline for my plain TeX document compiled via pdftex is
   % from manmac.tex (extract given below), and \output is from
   % Donald Arseneau on comp.text.tex (code and source below) --
   % and the output is as expected.  However, I am unable to
   % control the amount by which the page number "overhangs" the
   % margin:
   %
   % In the lines:
   %
   %       \llap{\tenbf\folio\kern1pc}%
   %       \rlap{\kern1pc\tenbf\folio}%
   %
   % changing the amount of \kern from 0.1pc to 1pc to 10pc has
   % _no_ effect on the output.  I thought \kern cannot stretch or
   % shrink and so was expecting to be able to control the amount
   % by which the page number "overhangs" the margin.
   %
   % So how can the horizontal location of the page number be
   % further controlled?
   %
   %from manmac.tex:
     \def\rhead{This the running head}% \rhead contains the running headline
     %
     \def\leftheadline{\hbox to \pagewidth{\spaceskip=0pt
         \vbox to 10pt{}% strut to position the baseline
         \llap{\tenbf\folio\kern 2pc}% folio to left of text
         \tenit\rhead\hfil% running head flush left
         }}
     \def\rightheadline{\hbox to \pagewidth{\spaceskip=0pt
         \vbox to 10pt{}% strut to position the baseline
         \hfil\tenit\rhead\/% running head flush right
         \rlap{\kern1pc\tenbf\folio}% folio to right of text
         }}
   %
   \def\oddevenpageshift{0.12truein}%
   % Donald Arseneau, at http://groups.google.com/group/comp.text.tex/msg/bff9634123221983?hl=en
     \catcode`\@=11
     \newdimen\pageshift  \pageshift=\oddevenpageshift%parity of page controls sign of \pageshift
     \output{\plainoutput}
     \def\plainoutput{\shipout
       \vbox{\moveleft\ifodd\pageno-\fi\pageshift
       \vbox{\makeheadline\pagebody\makefootline}}%
       \advancepageno
       \ifnum\outputpenalty>-\@MM \else\dosupereject\fi}
     \catcode`\@=12
   %
   %
   % Thanks,
   %
   % --Suresh
   %

%%% PT %%%
\newdimen \pagewidth
\pagewidth = \hsize
\headline {\ifodd \pageno \rightheadline \else \leftheadline \fi}
%%% PT %%%

Now is the time for all good men to come to the aid of the party.
Now is the time for all good men to come to the aid of the party.
Now is the time for all good men to come to the aid of the party.
Now is the time for all good men to come to the aid of the party.
Now is the time for all good men to come to the aid of the party.

Now is the time for all good men to come to the aid of the party.
Now is the time for all good men to come to the aid of the party.
Now is the time for all good men to come to the aid of the party.
Now is the time for all good men to come to the aid of the party.
Now is the time for all good men to come to the aid of the party.

<repeat ad nauseam>

\end


More information about the texhax mailing list