[Dev-luatex] require doesn't get recorded
Linas Stonys
lstonys at vtex.lt
Thu Nov 7 15:57:15 CET 2019
Hi All,
I'm using dirty trick to write documents used .otf files to .fls by adding code to ...\tex\latex\fontspec\fontspec.cfg
\bgroup
\catcode`\ 10 %
\gdef\opentype at write@to at fls{%
\directlua{
local fontdata = fonts.hashes.identifiers
local done = {}
for id, fdata in pairs(fontdata) do
if fdata.filename and not done[fdata.filename] then
tex.sprint("\string\\IfFileExists{".. fdata.filename .."}{}{}")
done[fdata.filename] = ''
end
end
}}
\egroup
\AtEndDocument{\opentype at write@to at fls}
Then example:
\documentclass{article}
\usepackage{fontspec}
\begin{document}
\fontfamily{ptm}\selectfont a
\end{document}
Maybe this could be solved directly in luatex engine that all the input would be written to .fls?
Thanks in advance!
Linas
On 11/7/2019 4:21 PM, Marcel Fabian Krüger wrote:
> Hi,
>
> based on an observation by Karl Berry on the TeX Live list I discovered
> an inconsistency in LuaTeX's handling of `-recorder`: While LuaTeX does
> record files loaded through `loadfile`, files loaded through `require`
> are ignored:
>
> For example if the current directory contains two empty files l1.lua and
> l2.lua, then the document
>
> \directlua{
> loadfile'l1.lua'()
> require'l2'
> }
> \bye
>
> compiled with `luatex -recorder recorded` IMO should write to
> recorded.fls the entries
>
> PWD /some/weird/pwd
> INPUT /usr/local/texlive/2019/texmf-var/web2c/luatex/luatex.fmt
> INPUT ./recorded.tex
> OUTPUT recorded.log
> INPUT l1.lua
> INPUT ./l2.lua
>
> but it does write
>
> PWD /some/weird/pwd
> INPUT /usr/local/texlive/2019/texmf-var/web2c/luatex/luatex.fmt
> INPUT ./recorded.tex
> OUTPUT recorded.log
> INPUT l1.lua
>
> I do not think that this is intentional, so I added a patch to add
> recorder entries iff the file is loaded successfully (similar to
> `loadfile`)
>
> -- Marcel
>
>
> _______________________________________________
> dev-luatex mailing list
> dev-luatex at ntg.nl
> https://mailman.ntg.nl/mailman/listinfo/dev-luatex
>
More information about the dev-luatex
mailing list