
次の LaTeX ドキュメントの出力は、最後の LaTeX2e リリース以降に変更されています。
\documentclass{article}
\begin{document}
\IfFileExists
{}
{ yes }
{ no }
\end{document}
リリース 2020-02-02:いいえ
リリース 2020-10-01:はい
なぜですか? これは意図されたものですか?
—アップデート—
test.tex.erb
最初に Ruby によって処理されるファイルを使用するとします。
\documentclass{article}
\begin{document}
\newcommand{\mypath}{<%= @image.path %>}
\IfFileExists
{\mypath}
{\includegraphics{\mypath}}
{ no image }
\end{document}
@image.path
時々空白になりnil
ます\mypath
。これは、\includegraphics{\mypath}
最新の LaTeX2e リリース (2020 年 10 月) 以降で失敗する原因になります。以前の LaTeX2e バージョンでは、「no image」というテキストはエラーなしでレンダリングされていました。
解決
私たちが使用する簡単な解決策は次のとおりです。
\newcommand{\mypath}{<%= @image.path || './inexistant.txt' %>}
問題は解決しました。ありがとうございます。