
다음 라텍스 문서의 출력은 마지막 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 버전에서는 "이미지 없음"이라는 텍스트가 오류 없이 렌더링되었습니다.
해결책
우리가 사용하는 쉬운 솔루션은 다음과 같습니다.
\newcommand{\mypath}{<%= @image.path || './inexistant.txt' %>}
문제 해결됨. 감사합니다.