[luatex] feature request: absolute path of main tex file
luigi scarso
luigi.scarso at gmail.com
Tue Mar 10 23:35:59 CET 2015
On Tue, Mar 10, 2015 at 9:45 PM, Élie Roux <elie.roux at telecom-bretagne.eu>
wrote:
> Le 10/03/2015 21:34, luigi scarso a écrit :
> > \directlua{
> > print()
> > print("currentdir:"..lfs.currentdir())
> > texio.write_nl("")
> > for k, v in ipairs(arg) do
> > texio.write_nl(k .. " " .. v)
> > end
> > texio.write_nl("")
> >
> > }
> >
> >
> >
> > \bye
>
> Thanks, it will require some more tests (for instance the arg must end
> by \jobname.xxx, etc.), but I can handle it from now.
>
> Thank you very much!
> --
> Elie
>
another one from Hans
\catcode`\%=11
\directlua{
function fulljobname()
local p = nil
for k, v in ipairs(arg) do
if not string.find(v,"^%-") then
p = v
break
end
end
if p then
p = string.gsub(p,"%-%.","%%1")
if string.find(p,tex.jobname) then
return p
end
end
return tex.jobname
end
texio.write_nl("")
texio.write_nl(fulljobname())
texio.write_nl("")
}
\bye
--
luigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/luatex/attachments/20150310/c7ce7390/attachment.html>
More information about the luatex
mailing list