Is there a way in latex to use a command but redirect the output to another place in another .tex file?
Within commands.tex i defined the command \cmd which gets a three parameters. Within \cmd the command \ThisInAnotherTexFile is being used with the same parameters that has been given to \cmd.
But the the output of \ThisInAnotherTexFile should not be where \cmd is being used but where i want it to be used. For example within a file called sum.tex.
I need it so i can automatically create a table by using only one command (\cmd) within sum.tex with the given parameters as content.
\newcommand{\cmd}[3]{
Error: #1\\
Descrition #2\\
ShortDesc #3\\
\ThisInAnotherTexFile{#1}{#2}{#3}
}
\newcommand{\cmd1}will already generate an error as you can not have numbers in command names. please edit the question to have a more realistic code that shows your issue, it is hard to guess from the current fragment – David Carlisle Mar 17 '22 at 08:31