Using the package currfile
:
\setcounter{foo}{\inputlineno}%
\def\barfile{.aux/\currfilebase\thefoo.bar}%
\def\texfile{.aux/\currfilebase\thefoo.tex}%
% ...
\input{\texfile}
then the counter value is doubled:
! LaTeX Error: File `.aux/filename363363.tex' not found.
When \texfile
contains only \fname
or only \thefoo
, I do not see any repetition. Also, using the package fink
and \def\fname{\finkfile}
, no issues arise.
Minimal working example:
Create a main file containing:
\documentclass{article}
\usepackage{currfile}
\newcounter{counter}
\setcounter{counter}{0}
\begin{document}
\def\texfile{\currfilebase\thecounter.tex}
\input{a_main0.tex}
\input{\texfile}
\end{document}
and another file called a_main0.tex
. Typesetting raises the error:
...
(./a_main.aux) (./a_main0.tex)
! LaTeX Error: File `a_main00.tex' not found.
Clearly, the file a_main0.tex
is found by \input
, but not when the file name is given using \texfile
, because the character "0" gets duplicated.