On Tue, 2 Sept 2025 at 15:17, <[email protected]> wrote:
> > ref. https://github.com/latex3/latex2e/issues/1804
> >
> > LuaTeX handles images in --output-directory differently depending on
> whether the Lua functions or the TeX interface is used. Essentially, with
> >
> > mkdir -p tex-aux
> > cp $(kpsewhich example-image-a.pdf) tex-aux/example-delwedd-a.pdf
> > cp $(kpsewhich --var-value
> TEXMFDIST)/tex/context/sample/common/cow-black.mps tex-aux/moo.mps
> >
> > then
> >
> > \directlua{
> > img.write = { filename = "example-delwedd-a.pdf" }
> > }
> > \bye
> >
> > works with --output-directory=tex-aux, whereas
> >
> > \saveimageresource{example-delwedd-a.pdf}
> > \useimageresource\lastsavedimageresourceindex
> > \bye
> >
> > does not.
> >
> > I can't reproduce the discrepancy with LuaTeX from TL 2022, but I can
> from TL 2023 and also with LuaTeX dev TL2026. The error does not occur if
> pdfTeX is used.
> >
> > In LuaLaTeX, this causes fatal errors as LuaHBTeX finds the file when
> \includegraphics checks, but cannot find the image when \includegraphics
> tries to use it.
>
\directlua{
local f
print()
f = kpse.find_file("example-delwedd-a.pdf");print("f=", f)
f = kpse.find_file("./example-delwedd-a.pdf");print("f=", f)
}
\bye
$ luatex test3.tex
This is LuaTeX, Version 1.24.0 (TeX Live 2026/dev)
restricted system commands enabled.
(./test3.tex
f= nil
f= nil
)
warning (pdf backend): no pages of output.
Transcript written on test3.log.
$ luatex --output-directory=tex-aux test3.tex
This is LuaTeX, Version 1.24.0 (TeX Live 2026/dev)
restricted system commands enabled.
(./test3.tex
f= ./tex-aux/example-delwedd-a.pdf
f= ./tex-aux/./example-delwedd-a.pdf
)
warning (pdf backend): no pages of output.
Transcript written on test3.log.
but I need to check the kpse.lookup function
--
luigi
_______________________________________________
dev-luatex mailing list -- [email protected]
To unsubscribe send an email to [email protected]