Say I'm writing a long document and I want to use the letter $n$
to stand for dimension e.g. in $\mathbb R^n$
all over the paper. Late in the writing process I realize that I want $n$
to stand for something else and decide I want to use $m$
instead. I can't just search and replace the letter n
; a regex
search might be too broad, but e.g. replacing $\mathbb R^n$
might be too narrow as it might be $\mathbb R^{2n+1}$
.
To avoid that scenario, is it good practice to use a command e.g. \newcommand{\dimn}{n}
and use $\mathbb R^{\dimn}$
everywhere in the document, a la constants in a programming language? Or is this misuse / abuse or otherwise not a good idea? I will be collaborating with others on this document.