[texhax] LaTeX programming question

tom sgouros tomfool at as220.org
Sat Apr 26 16:19:06 CEST 2008


You have asked a hard question, which is why no one is answering much.
In order to do what you want to do, you'll need to get into the \output
routines, which is a confusing and odd sort of place, since they are
called asynchronously from everything else.  The approach I've used in
the past is to take the latex \output routine (it's in latex.ltx) copy
it into your own package, and modify it carefully.

Here's a sketch of something that might help you:



\fancyhead[LE,LO]{\hbox to 0pt{\hspace{-19pt}%


You'll need to do some more work to get it right, but I think something
like this will work for you.

There's a box here called \parflag and a friend called \parflagnext.  I
think you can use the \output routines to load them appropriately with
the data you want, but I am going to leave you to come up with the
arrangement of flags to make it work.  The nonintuitive things you have
to watch out for are that the headers are applied to the page *last*,
and the paragraph in your special environment has all been typeset
before the page is broken.  (So you can't use the closing of the
environment to erase any of the boxes, because they'll be missing when
the page breaks.)

Hope this helps, and good luck,


 tomfool at as220 dot org

More information about the texhax mailing list