There are no namespaces in (La)TeX like in most programming languages. Following macro definitions will overwrite the previous ones (when defining macros with TeX's \def
) or cause an error (when using LaTeX's \newcommand
).
You can however copy the definition of one macro to another using \let\somenewmacro\someexistingmacro
. The resulting macro is then independent from the other and does not use it later, like it would be the case when using \newcommand{\somenewcommand}{\someexistingmacro}
.
In order to not cause error when the existing macro is defined again using \newcommand
you can simply change its meaning to \relax
so that \newcommand
thinks it does not exists (as the does-already-exists check can not differ between a \relax
and an undefined macro).
Basically try:
\usepackage{inenglish}
\let\houseinenglish\house
\let\house\relax % to 'undefine' it so that \newcommand\house works again
\usepackage{inspanish}
\let\houseinspanish\house % or just use \house
Note that is is cumbersome if you have a lot of macros. Also if the macros uses further internal macros - also with the same names in both packages - you are in trouble.
translations
package and make a meta-macro.