File name with an underscore looks like it gets split in IfFileExists,

Mike Marchywka marchywka at hotmail.com
Sun Nov 7 16:58:34 CET 2021


In an earlier email exchange someone 
suggested  IfFileExists 
to get a file name in the fls file without including it in the output document, 

This seems to work well and I created a command to do that, 

% for archiving and file list 
\newcommand{\mjmusesitem}[2]{

\item {\bf #1 } : 1 is #1 and 2 is  #2 xxx
\IfFileExists{#1}{}{{\bf not found} }

} % mjmuses

However, when there is an underscore in the file the result seems odd.
For example,

\mjmusesitem{./keep/violinxxx.svg}{ Original scalable artwork }
\mjmusesitem{./keep/kmboth.svg}{ Original scalable artwork }
\mjmusesitem{./keep/pmg\_ratios.svg}{ Original scalable artwork }
%\mjmusesitem{./keep/pmg_ratios.svg}{ Original scalable artwork }
\mjmusesitem{./keep/r1vr2na.svg}{ Original scalable artwork }
\mjmusesitem{./keep/r1vr2.svg}{ Original scalable artwork }
\mjmusesitem{./keep/pmg\_ratio.svg}{ Original scalable artwork }

produces this output, note the stray "ratios.svg" appearing twice, 

5. ./keep/violinxxx.svg : 1 is ./keep/violinxxx.svg and 2 is Original scalable artwork xxx
6. ./keep/kmboth.svg : 1 is ./keep/kmboth.svg and 2 is Original scalable artwork xxx
7. ./keep/pmg ratios.svg : 1 is ./keep/pmg ratios.svg and 2 is Original scalable artwork xxx ratios.svg not
found
8. ./keep/r1vr2na.svg : 1 is ./keep/r1vr2na.svg and 2 is Original scalable artwork xxx
9. ./keep/r1vr2.svg : 1 is ./keep/r1vr2.svg and 2 is Original scalable artwork xxx
10. ./keep/pmg ratio.svg : 1 is ./keep/pmg ratio.svg and 2 is Original scalable artwork xxx ratio.svg not
found

Any idea what is going on here?

Thanks. 



 Mike Marchywka 
306 Charles Cox Drive 
Canton, GA 30115
470-758-0799
404-788-1216 





More information about the texhax mailing list.