On Tue, Mar 10, 2015 at 8:48 PM, Élie Roux <[email protected]>
wrote:
> Dear All,
>
> For a project, I need to make a few convoluted checks and treatments
> before including some files. The problem comes when the path to this
> included file is relative, and when compilation occurs outside the
> directory of the main .tex file. In this case \jobname is just the
> filename, and lfs.currentdir() is the directory where the compilation
> occurs, but it's not enough to know where the main .tex file really is.
>
> Is there a way to get to know the absolute directory of the main .tex
> file in luatex (argument string parsing maybe?)? If not would it be
> reasonable to create one?
>
> Thank you,
> --
> Elie
>
can you try with
\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
--
luigi