1
0
Fork 0
Teach LaTeX some manners to respect \everypar [archive]
Go to file
Mike Gerwitz 4fbc7b8ebb
Initial commit of this pain-in-the-ass
The goal of epmanners is to provide a means of coping with the \everypar
issues caused by LaTeX' rude implementation; that is---to teach LaTeX (and
hopefully other packages that use \everypar) some manners.

As mentioned in Knuth's TeXbook, \everypar is a token register that is
processed after entering horizontal mode to begin a new paragraph. This
register is very useful for a number of circumstances, including paragraph
numbering and itemized lists. LaTeX uses \everypar internally for things
such as itemized lists and section headings; unfortunately, since it does
not care much about what others are using \everypar for, it ends up
clobbering the register after it is done, leading to frustration after
section/chapter headings, \end, and others.

In developing sPxTeX, which performs paragraph numbering and marginal notes
for each paragraph, this became painfully apparent.

Rather than simply patching the appropriate commands at runtime or handling
specific cases, which wouldn't be a general solution for other packages, the
approach was to instead redefine \everypar to be a command rather than a
token register. This will allow fine control over what ends up in the
register, but creates a number of headaches (e.g. \the\everypar). This
initial implementation retains the LaTeX kernel's original functionality and
will allow \the\everypar from within \everpar itself; this means that the
register can be manipulated as usual without any problems. However, there is
still work to be done to ensure that \the\everypar works in all contexts,
not just within \everypar itself.

Once the initial redefinition is complete, this package will provide a means
to control tokens that should always appear in the \everypar token register,
or should be automatically re-added when the register is reset
(\everypar{}); additional features will be considered if needed.

This package is written primarily in plain TeX, and so would be easily
ported outside of LaTeX where useful. Note that this package is not likely
to be useful in plain TeX environments since \everypar isn't systematically
abused by TeX itself (though you may include macros that do).
2013-09-04 23:07:10 -04:00
.gitignore Initial commit of this pain-in-the-ass 2013-09-04 23:07:10 -04:00
epmanners.sty Initial commit of this pain-in-the-ass 2013-09-04 23:07:10 -04:00