编辑

编辑

[这是更新的 \l_file_search_path_seq (expl3) 不再识别 `~` (TeX Live 2023 昨天更新),这不是我需要问的问题。

昨天使用更新 TeX Live 2023 后tlmgr,以下代码不再起作用:

\documentclass{article}
\ExplSyntaxOn
\cs_new_protected_nopar:Nn \my_input_add:n 
{
  \seq_put_right:Nn \l_file_search_path_seq { #1 }
}
\cs_new_protected_nopar:Nn \my_file_input: { \file_input:n {ysgrifennu-LEARN-compact/hello} }
\cs_new_eq:NN \myinput \my_file_input:
\cs_new_eq:NN \myinputadd \my_input_add:n
\ExplSyntaxOff
\myinputadd{~/Dogfennau/Fy_Ysgrifau/dysgu/ymresymiadau}

\begin{document}
\myinput
\end{document}

具体来说,ysgrifennu-LEARN-compact/hello没有找到,

!! LaTeX Error: File 'ysgrifennu-LEARN-compact/hello' not found.

For immediate help type H <return>.
 ...                                              
                                                  
l.138 \myinput

~//Dogfennau/Fy_Ysgrifau/dysgu/ymresymiadau/ysgrifennu-LEARN-compact/hello.tex存在。上周,pdflatex毫不费力就找到了它。

如果我用我的主目录路径替换,则可以找到该文件。但是,早期的 TeX Live(更新前的 2023 和更早版本)不需要这样做。为了检查,我使用 TeX Live 2022 编译了相同的代码~,文件可以正常找到。~/Dogfennau/Fy_Ysgrifau/dysgu/ymresymiadaupdflatex

更新前找到文件

这是预料之中的吗?有什么方法可以恢复旧的行为吗?如果可以避免,我宁愿不对我的主目录的路径进行硬编码,因为不这样做会使事情更具可移植性。

编辑

下面是一个使用 的例子,它显示\input可以使用~,但是\myinput会失败,而使用旧版 TeX Live 都可以成功编译。

\documentclass{article}
\ExplSyntaxOn
\cs_new_protected_nopar:Nn \my_input_add:n 
{
  \seq_put_right:Nn \l_file_search_path_seq { #1 }
}
\cs_new_protected_nopar:Nn \my_file_input: { \file_input:n {ysgrifennu-LEARN-compact/hello} }
\cs_new_eq:NN \myinput \my_file_input:
\cs_new_eq:NN \myinputadd \my_input_add:n
\ExplSyntaxOff
\myinputadd{~/Dogfennau/Fy_Ysgrifau/dysgu/ymresymiadau}

\begin{document}
\input{~/Dogfennau/Fy_Ysgrifau/dysgu/ymresymiadau/ysgrifennu-LEARN-compact/hello}
\myinput
\end{document}

这是使用 TeX Live 2022 成功编译的日志文件。具体来说,我曾经TEXMFHOME=/d /usr/local/texlive/bin.2022/pdflatex prawf编译过。

This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex 2022.11.12)  11 OCT 2023 14:44
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**prawf
(./prawf.tex
LaTeX2e <2022-11-01>
L3 programming layer <2022-11-02>
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/article.cls
Document Class: article 2022/07/02 v1.4n Standard LaTeX document class
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2022/07/02 v1.4n Standard LaTeX file (size option)
)
\c@part=\count185
\c@section=\count186
\c@subsection=\count187
\c@subsubsection=\count188
\c@paragraph=\count189
\c@subparagraph=\count190
\c@figure=\count191
\c@table=\count192
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen140
)
(/usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
File: l3backend-pdftex.def 2022-10-26 L3 backend support: PDF output (pdfTeX)
\l__color_backend_stack_int=\count193
\l__pdf_internal_box=\box51
)
(./prawf.aux)
\openout1 = `prawf.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 137.
LaTeX Font Info:    ... okay on input line 137.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 137.
LaTeX Font Info:    ... okay on input line 137.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 137.
LaTeX Font Info:    ... okay on input line 137.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 137.
LaTeX Font Info:    ... okay on input line 137.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 137.
LaTeX Font Info:    ... okay on input line 137.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 137.
LaTeX Font Info:    ... okay on input line 137.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 137.
LaTeX Font Info:    ... okay on input line 137.

(/home/cfr/Dogfennau/Fy_Ysgrifau/dysgu/ymresymiadau/ysgrifennu-LEARN-compact
/hello.tex)
(/home/cfr/Dogfennau/Fy_Ysgrifau/dysgu/ymresymiadau/ysgrifennu-LEARN-compact
/hello.tex) [1

{/usr/local/texlive/2022/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./praw
f.aux) ) 
Here is how much of TeX's memory you used:
 439 strings out of 474971
 8992 string characters out of 5776128
 349853 words of memory out of 5000000
 22017 multiletter control sequences out of 15000+600000
 469259 words of font info for 28 fonts, out of 8000000 for 9000
 1141 hyphenation exceptions out of 8191
 34i,5n,38p,179b,107s stack positions out of 10000i,1000n,20000p,200000b,200000s
</usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmr1
0.pfb>
Output written on prawf.pdf (1 page, 11187 bytes).
PDF statistics:
 13 PDF objects out of 1000 (max. 8388607)
 7 compressed objects within 1 object stream
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

这是当前 TeX Live 2023 和编译失败的日志。具体来说,我曾经TEXMFHOME=/d pdflatex prawf编译过。

This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=pdflatex 2023.10.10)  11 OCT 2023 14:47
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**prawf
(./prawf.tex
LaTeX2e <2023-06-01> patch level 1
L3 programming layer <2023-08-29>
(/usr/local/texlive/2023/texmf-dist/tex/latex/base/article.cls
Document Class: article 2023/05/17 v1.4n Standard LaTeX document class
(/usr/local/texlive/2023/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2023/05/17 v1.4n Standard LaTeX file (size option)
)
\c@part=\count185
\c@section=\count186
\c@subsection=\count187
\c@subsubsection=\count188
\c@paragraph=\count189
\c@subparagraph=\count190
\c@figure=\count191
\c@table=\count192
\abovecaptionskip=\skip48
\belowcaptionskip=\skip49
\bibindent=\dimen140
)
(/usr/local/texlive/2023/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
File: l3backend-pdftex.def 2023-04-19 L3 backend support: PDF output (pdfTeX)
\l__color_backend_stack_int=\count193
\l__pdf_internal_box=\box51
)
(./prawf.aux)
\openout1 = `prawf.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 137.
LaTeX Font Info:    ... okay on input line 137.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 137.
LaTeX Font Info:    ... okay on input line 137.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 137.
LaTeX Font Info:    ... okay on input line 137.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 137.
LaTeX Font Info:    ... okay on input line 137.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 137.
LaTeX Font Info:    ... okay on input line 137.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 137.
LaTeX Font Info:    ... okay on input line 137.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 137.
LaTeX Font Info:    ... okay on input line 137.

(/home/cfr/Dogfennau/Fy_Ysgrifau/dysgu/ymresymiadau/ysgrifennu-LEARN-compact
/hello.tex)

! LaTeX Error: File 'ysgrifennu-LEARN-compact/hello' not found.

For immediate help type H <return>.
 ...                                              
                                                  
l.139 \myinput
              
? 
[1

{/usr/local/texlive/2023/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./prawf.aux)
 ***********
LaTeX2e <2023-06-01> patch level 1
L3 programming layer <2023-08-29>
 ***********
 ) 
Here is how much of TeX's memory you used:
 441 strings out of 474934
 9046 string characters out of 5759816
 1917791 words of memory out of 5000000
 22064 multiletter control sequences out of 15000+600000
 558069 words of font info for 36 fonts, out of 8000000 for 9000
 1141 hyphenation exceptions out of 8191
 35i,5n,50p,180b,107s stack positions out of 10000i,1000n,20000p,200000b,200000s
</usr/local/texlive/2023/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>

Output written on prawf.pdf (1 page, 11181 bytes).
PDF statistics:
 13 PDF objects out of 1000 (max. 8388607)
 7 compressed objects within 1 object stream
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

同一个例子可以pdflatex在 TeX Live 2021 和 TeX Live 2020 中成功编译。对于 TeX Live 2019,\input会失败,但如果启用语法\file_input:n,则可以编译。\usepackage{expl3}expl3

相关内容