I am used to define some complicated and frequent mathematical expressions to be able to use them easily in my papers. For example I have defined
\def\c{{\mathbb{C}}} for $\mathbb{C}$ (the field of complex numbers).
However sometimes there are more complicated formulas and mathematical expressions which involve one, two, or more variables (or parameters). For example, consider $Hom_{\mathbb{Z}} (M,N)$ which involves two variables $M$ and $N$.
My question is "how can I define such expressions generally with the ability to change the variable inside them.

\Homz{M}{N}to give this output? – marczellm Jan 24 '13 at 12:08\cfor some command (for example, complex numbers). I'm warning because it happened to me. I got a file with this personal command used a lot of times and I was not able to use the\c cto produceç. So some find/replace was necessary. – Sigur Jan 24 '13 at 12:11\def\a{\alpha}\def\b{\beta}\def\c{\gamma}. One day he wrote me because of a mysterious error; his coauthor for a paper was Turkish and his family name began with Ş. Well, he could type the name directly in UTF-8, but the problem is that LaTeX translates this into\c{S}. Chaos ensues. Don't use\def, unless you know precisely what you're doing, after having carefully checked what a command we proceed to redefine does. – egreg Dec 01 '22 at 17:32