[luatex] \openin with extensionless files.
luigi scarso
luigi.scarso at gmail.com
Thu Jan 23 15:01:26 CET 2020
On Wed, Jan 22, 2020 at 10:10 PM David Carlisle <d.p.carlisle at gmail.com>
wrote:
> With a file with no extension in the same directory (say "test") then
>
> \input test
>
> and
>
> \input{test}
>
> both work but
>
> \openin test
>
> and
>
> \openin{test}
>
> do not work the same way, it only sees the file if the luatex-specific
> braced form is used.
>
> That means for example the LaTeX \IfFileExists macro reports the file
> as not existing with luatex and existing with pdftex and xetex.
>
> We could (and probably will) have a luatex-specific code branch here
> to add the braces, but is this difference from pdftex intentional? It
> has been this way since at least texlive 2017, but still seems strange
> and not what one would expect from the documentation
>
>
> This causes some problems in end-user documents, for example
>
>
> https://tex.stackexchange.com/questions/511684/inputting-extension-less-files-with-luatex-fails-after-recent-latex-update/511688?noredirect=1#comment1293990_511688
>
>
>
>
> This test file:
>
> \openin0 test
>
> \ifeof0
> \immediate\write20{NO FILE test}
> \else
> \immediate\write20{FILE test}
> \fi
>
> \ifx\directlua\undefined\else
>
> \openin2{test}
>
> \ifeof2
> \immediate\write20{NO FILE test}
> \else
> \immediate\write20{FILE test}
> \fi
>
> \fi
>
> \end
>
>
> Produces the terminal output below
>
>
> $ cat test
> hello
>
> $ luatex noext
> This is LuaTeX, Version 1.10.0 (TeX Live 2019)
> restricted system commands enabled.
> (./noext.tex
> NO FILE test
> FILE test
> )
>
> and with pdftex
>
> $ pdftex noext
> This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020)
> (preloaded format=pdftex)
> restricted \write18 enabled.
> entering extended mode
> (./noext.tex
> FILE test
>
>
> David
>
We already have patched something in rev. 7213
so this is what we have now
$ cat test.tex
hello
$ cat noext.tex
\openin0 test
\ifeof0
\immediate\write20{NO FILE test}
\else
\immediate\write20{FILE test}
\fi
\ifx\directlua\undefined\else
\openin2{test}
\ifeof2
\immediate\write20{NO FILE test}
\else
\immediate\write20{FILE test}
\fi
\fi
$ luatex --fmt=luatex-plain noext.tex
:
This is LuaTeX, Version 1.12.0 (TeX Live 2020/dev)
system commands enabled.
:
:
FILE test
FILE test
)
warning (pdf backend): no pages of output.
Transcript written on noext.log.
--
luigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/luatex/attachments/20200123/34fe43cb/attachment.html>
More information about the luatex
mailing list