I have an automatically generated .tex file containing some content and a couple, usually just one, \newcommand
calls.
Usually I display the content and load the commands with \input
but sometimes I'd like to just import the commands it defines without displaying anything.
Is there an easy way to achieve it?
EDIT: Here's a little example of what I'd like to do:
table.tex:
\begin{tabular}{|l|r|}
\hline%
foo & bar \\
bar & foo \\
\hline%
\end{tabular}
\newcommand\tabledata{This is a foo table about bars}
mwe.tex:
\documentclass[a4paper,11pt]{report}
\begin{document}
\begin{table}[h]
\centering
\input{table.tex}
\caption{About this table: \emph{\tabledata}}
\end{table}
\end{document}
Sometimes I'd like to not display the table but just \tabledata
while keeping the normal \input
behavior working. Also I'd like to keep the \tabledata
local but I could do fine with \renewcommand
.
I sometimes call \tabledata
inside a secondary \ContinuedFloat\caption
, but let's not get too specific about my case.