> On 11 Aug 2022, at 14:08, paolo de luca <teu...@gmail.com> wrote:
> 
> Hi all,
> 
> I've been trying to import all tex files and inside a given folder, the issue 
> I'm facing is that my lua call is not able to navigate folders: it only works 
> for files.
> It's worth mentioning that compilation successfully completes as the document 
> is created, but I have no errors explaining me why it's not working as 
> intended.
> I've also opened a question on tex.stackexchange.
> 
> would you mind having a look at it ?
> 
> https://tex.stackexchange.com/questions/653499/understanding-implicit-error-on-a-recursive-function


See comment on SX. Don't 'return' the nested call, and it works just fine.

function inputAll(dir)
    for content in lfs.dir(dir) do
        if ("." ~= content) and (".." ~= content)  then
            fullpath = dir .."/".. content
                contentType = lfs.attributes(fullpath, "mode")
            if isTexFile(content, contentType) then
                    tex.sprint("
\\
input{" .. fullpath .. "}")
            elseif ("directory" == contentType) then
                -- return
                inputAll(fullpath)
            end
        end
    end
end

Best wishes,
Taco

— 
Taco Hoekwater              E: t...@bittext.nl
genderfluid (all pronouns)



_______________________________________________
dev-luatex mailing list
dev-luatex@ntg.nl
https://mailman.ntg.nl/mailman/listinfo/dev-luatex

Reply via email to