[tex-live] Ignoring portion of LaTeX code; the \par problem.

Dan Luecking luecking at uark.edu
Tue Apr 6 18:00:19 CEST 2010

On Sun Apr 4, 2010 at 19:37:00 CEST Michaël 
Cadilhac <michael at cadilhac.name> wrote:

>   My goal today is to write a command that would include another TeX
>file, but not its document environment.  For instance, I would want to
>use it like:
>% Lots of includes and configurations.
>   Text.
>   Other text.
>   The goal there is to be able to move the appendix close to any
>document.tex, and the appendix would take the form of the document.
>   My first tries were focused on just ignoring code.  But while I had no
>succeed in defining \document=\iffalse and \enddocument=\fi, for
>whatever reason, I might have found some bugs on my way, seemingly
>linked to TeXlive.

One possibility:

% appendix.tex
   \input document.tex
   Other text.

Making \enddocument=\fi doesn't work because
after \iffalse, TeX never sees \enddocument, only
\end{document}, which it ignores as instructed by

There are also commands that are not allowed to come
between \iffalse and \fi which can also lead to errors:
anything defined with the \outer prefix (\outer\def...).

It is standard that the token \par as well as blank lines
(which are automatically converted to the token \par) are
not allowed in the argument of a macro, unless it has been
defined with \long\def. Not a bug, but rather intentional


Daniel H. Luecking
Department of Mathematical Sciences
Fayetteville, Arkansas

More information about the tex-live mailing list