Have anyone an idea how i can use \IfFileExist{}{}{}
for file names with spaces?
f.e. didn't work
\newcommand{\runI}{D:/Test/run1 - T2}
\newcommand\IG[2][]{\IfFileExists{#2}{\includegraphics[#1]{#2}}{\fbox{File #2 doesn't exist}}}
\begin{figure}[htbp]
\centering
\IG[trim = 40mm 10mm 40mm 2mm,clip = true, width=0.4\textwidth]{\runI/LatexTestFig2.png}
\caption{run 1}
\label{overflow}
\end{figure}
f.e. work
\newcommand{\runII}{D:/Test/run1-T2-Kopie}
\newcommand\IG[2][]{\IfFileExists{#2}{\includegraphics[#1]{#2}}{\fbox{File #2 doesn't exist}}}
\begin{figure}[htbp]
\centering
\IG[trim = 40mm 10mm 40mm 2mm,clip = true, width=0.4\textwidth]{\runII/LatexTestFig2.png}
\caption{run 1}
\label{overflow}
\end{figure}
what can I do? THX
grffile
package? ctan.mirrorcatalogs.com/macros/latex/contrib/oberdiek/…graphics
will give a warning here anyway, is there a reason you are adding a test by hand?grffile
would have been my first guess as well, but remember: spaces in filenames are evil chat.stackexchange.com/transcript/message/13311129#13311129"
to be used to quote a filename containing bad characters like spaces so"\runI/LaTeXFile.png"
should work"\runI/LaTeXFile".png
. But this is on TL2010, if it matters.