I have searched for "namespaces", but all of these posts seem to ask for something way more advanced.
The problem I encounter can be solved by renaming everything, but that does not seem "right".
There are bunch of commands in my document such as \renewcommand{\vec}[1]{\mathbf{#1}}
for vectors in the physics part. However, I would like to include papers in my final thesis where sometimes the same command is used with a different definition (different field). Hence, the files would compile on themselves, but if I include them in my larger document (such that they get page numbers and included in the TOC) this will give collisions.
So my question is: Is it possible to "rewrite" a prefix in a command on a per-file basis? That would be, I define \newcommand{\jonas@vec}[1]{\mathbf{#1}}
and in my particular document jonas.tex
I would rewrite all commands \jonas@vec
to the one with the part without \jonas@
. This would allow me to use the same syntax, but have a different definition.
\begingroup...\endgroup
, so it is just a matter of figuring out a system to define where the group begins and ends. I usually limit the redefinitions to be within environments so only that environment sees this new definition, but outside of this specific environment the usual meaning is applied.