reproducible-reporting / reprepbuild

Build tool for Reproducible Reporting
GNU General Public License v3.0
1 stars 1 forks source link

How can I add dependencies for dynamically generated LaTeX tables? #6

Closed yingxingcheng closed 1 year ago

yingxingcheng commented 1 year ago

If one has a latex file like the following, and these tables are created by a python script. Is it possible to add dependencies for these latex tables?

\begin{document}

\input{table_1.tex}
\input{table_2.tex}
...
\input{table_100.tex}

\end{document}
tovrstra commented 1 year ago

They should get picked up automatically, but I noticed there were some issues with that due to some internals of latexmk. Fix is on the way...

tovrstra commented 1 year ago

Can you test if 98ea0f4 fixes your problem?

tovrstra commented 1 year ago

For future reference, the "solution" is to use \warninput instead of \input and to add the following to the preamble:

% \warninput command: like \input but prints a warning
% when a file is missing and lets latex carry on.
\makeatletter
\newcommand{\warninput}[1]{%
  \filename@parse{#1}%
  \InputIfFileExists{#1}{}{%
    \message{LaTeX Warning: File `%
    \filename@base.\ifx\filename@ext\relax tex\else\filename@ext\fi'%
    not found on input line \the\inputlineno}%
  }%
}
\makeatother

Not an elegant solution, but the best I can come up with so far.