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?
\input@path
, which the l3file documentation suggests that this mimics/replaces.Each path can be relative or absolute, and should not include the trailing slash.
I assumed that meant I ought not to include it.