I recently discovered that a basic example of the package catchbetweenfiletags
doesn't work with lualatex
(while it works with pdflatex
).
What follows is the MWE. Do you know if there is workaround to make it work with lualatex
?
File catch1.tex
:
\documentclass{article}
\usepackage{catchfilebetweentags}
\begin{document}
test
\ExecuteMetaData[catch2]{mytag}
\end{document}
File catch2.tex
:
\documentclass{article}
\begin{document}
%<*mytag>
CATCH2
%</mytag>
\end{document}
$ pdflatex catch1.tex
works as expected.
$ lualatex catch1.tex
gives this error:
Runaway text?
! File ended while scanning text of \CatchFBT@tok.
<inserted text>
}
l.7 \ExecuteMetaData[catch2]{mytag}
?
Versions:
pdfTeX 3.14159265-2.6-1.40.15 (TeX Live 2014)
This is LuaTeX, Version beta-0.79.1 (TeX Live 2014) (rev 4971)
catchfilebetweentags : 2011/02/19 v1.1
For reference, using the package's command \CatchFileBetweenTags
fails in the same way. From the comment by @egreg, it also works with xelatex
.
\endlinechar
and so luatex slides over the end of the file. – Ulrike Fischer Mar 23 '15 at 11:23/usr/share/texlive/texmf-dist/tex/latex/catchfilebetweentags/catchfilebetweentags.sty
where it says: " \endlinechar=`\^^J%" it then works with LuaLaTeX. I don't know if it is a good idea, it seems to work (For what it worths, I tested also for a file with several line breaks and paragraph, both with PDFLaTeX and LuaLaTeX) – alfC Mar 23 '15 at 11:36\endlinechar
setting). – Ulrike Fischer Mar 23 '15 at 11:39