6

I have code which used to use \file_path_include:n, but now tries to adjust \l_file_search_path_seq as follows. With Texlive 2018, this works, but with Texlive 2019, it doesn't. What am I missing?

Working directory contains a subdirectory abc. Directory abc contains a file named a.tex with the contents

hylo

The main file in the working directory contains:

\documentclass{article}
\usepackage{xparse}
\begin{document}
\ExplSyntaxOn
\seq_put_right:Nn \l_file_search_path_seq {abc}
\seq_show:N \l_file_search_path_seq
\file_input:n {a}
\ExplSyntaxOff
\end{document}

This generates an error.

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./prawf.tex
LaTeX2e <2018-12-01>
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/article.cls
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2019/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(/usr/local/texlive/2019/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def))
) (./prawf.aux)
The sequence \l_file_search_path_seq contains the items (without outer
braces):
>  {abc}.
<recently read> }

l.14 \seq_show:N \l_file_search_path_seq

? 

! LaTeX3 Error: File 'a' not found.

For immediate help type H <return>.
 ...                                              

l.15 \file_input:n {a}

? 

The same is true if I use a.tex in place of a, but the documentation for \file_input:n says it uses the same search as \file_if_exist:n, which searches the standard input path plus additions in \l_file_search_path_seq.

If I include the trailing forward slash when specifying the directory

\seq_put_right:Nn \l_file_search_path_seq {abc/}

as suggested by AlexWatson in a comment, I get errors but the file is eventually found.

! Argument of \__file_file_name_cleanup:w has an extra }.
<inserted text> 
                \par 
l.17 \file_input:n {a.tex}

? 
Runaway argument?
\cs_if_exist:NT \input@path {\tl_map_tokens:Nn \input@path {\__file_full_name_a
ux:nn \ETC.
! Paragraph ended before \__file_file_name_cleanup:w was complete.
<to be read again> 
                   \par 
l.17 \file_input:n {a.tex}

? 
(./abc/a.tex)

How can I set \l_file_search_path_seq correctly so that \file_input:n behaves as I want it to? Or, if that's not possible, what workarounds are available?

8
  • 2
    With such sincerity I wish you my welcome back to TeX.SE.
    – Sebastiano
    Sep 29, 2019 at 19:09
  • 1
    @Sebastiano Thank you.
    – cfr
    Sep 29, 2019 at 20:00
  • 1
    I can't test this as I don't have TL 2019 here, but is it possible that you need "abc/" instead of "abc"? This is how it works with \input@path, which the l3file documentation suggests that this mimics/replaces. Sep 29, 2019 at 20:02
  • @AlexWatson The documentation says Each path can be relative or absolute, and should not include the trailing slash. I assumed that meant I ought not to include it.
    – cfr
    Sep 29, 2019 at 20:15
  • 1
    Most likely there's a bug in the reworked code here: I'll check probably tomorrow
    – Joseph Wright
    Sep 29, 2019 at 20:22

1 Answer 1

3

This was a bug in some new code: we have work on the go for an expandable \file_input:n, and the first step was file searching. Things are fixed as described in https://github.com/latex3/latex3/issues/634: an update will go to CTAN probably tomorrow.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .