我在变量中定义一条路径:\newcommand{\myfolder}[0]{c:/folder1/folder2}
\input{\myfolder/file1.tex} works
\includegraphics{\myfolder/images/dummypic1.png} works.
如果我使用\graphicspath{{\myfolder/images}}
则\includegraphics{dummypic1.png}
失败。
原因是 \graphicspath 后面添加了一个空白\myfolder
,导致\myfolder/dummypic1.png
扩展为"c:/folder1/folder2 /image/dummypic1.png"
显然\input
或者\includegraphic
不添加空白此行为是上次更新时的新行为,以前的版本按预期工作。
最小示例
\newcommand{\myfolder}[0]{c:/folder1/folder2}
\documentclass[pdftex,12pt,twoside,footsepline,headsepline,a4paper,final]{scrbook} %draft
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[pdftex]{graphicx}
\graphicspath{{\myfolder/images}}
\begin{document}
\includegraphics{\myfolder/images/dummypic1.png} % works
\includegraphics{dummypic1.png} % fails
\end{document}
感谢这个出色的模块提供的帮助。Othmar
Texlive 2023 中的版本图形 66204