I have a file 0012
in the directory of the following tex
file. I want to check the existence or non-existence of files inside the \forloop
from 11 to 13.
\documentclass{article}
\usepackage{numprint}
\newcounter{ct}
\newcommand{\fileno}{\npfourdigitnosep\nplpadding{4}\numprint{\arabic{ct}}}
\usepackage{forloop}
\setlength\parindent{0pt}
\begin{document}
\forloop{ct}{11}{\value{ct} < 14} {
% \IfFileExists{0012} {
\IfFileExists{\fileno} {
fileno: "\fileno{}" exists! \\
} {
fileno: "\fileno{}" doesn't exist! \\
}
}
\end{document}
I get this compile error:
! Incomplete \iffalse; all text was ignored after line 15.
<inserted text>
\fi
I have no compiler error if I switch to
\IfFileExists{0012}
which produces this output:
fileno: ”0011” exists!
fileno: ”0012” exists!
fileno: ”0013” exists!
How can I check the existence of files with my \fileno
macro?
I want this output:
fileno: ”0011” doesn't exist!
fileno: ”0012” exists!
fileno: ”0013” doesn't exist!