I would like to include graphics which have a filename with leading zeros. The filenames are:
pic_001_test.png pic_002_test.png . . . pic_028_test.png
I'm able to output leading zeros in a \forloop
but I can't use them in the \includegraphics
command:
\documentclass{article}
\usepackage{forloop}
\usepackage{graphicx}
\usepackage{fmtcount}
\begin{document}
\newcommand{\filename}{}
\newcounter{i}
\forloop{i}{1}{\value{i} < 4}{
\begin{figure}
\renewcommand{\filename}{pic\_\padzeroes[3]{\decimal{i}}\_test.pdf}
\includegraphics[scale=0.6]{pic_00\arabic{i}_test.png}
\caption{Screenshot\_\arabic{i}}
\filename
\end{figure}
}
\end{document}
The following code does not work due to "! undefined control sequence":
\newcommand{\filename}{}
\newcounter{i}
\forloop{i}{1}{\value{i} < 4}{
\begin{figure}
\renewcommand{\filename}{pic\_\padzeroes[3]{\decimal{i}}\_test.pdf}
\includegraphics[scale=0.6]{\filename}
\caption{Screenshot\_\arabic{i}}
\end{figure}
}
\padzeroes
isn't expandable