# MathJax \newcommand appears persistent across the whole page

Probably this is known.

MathJax \newcommand appears to be persistent across the whole page, including the question + all answers.

This potentially might cause some mischief.

Trying to redefine \mathbb in the answers.

Before redefinition: $\mathbb{N}$.

$\newcommand{mathbb}[1]{\text{;-) }#1}$

After: $\mathbb{N}$

• That's a well known issue $\Bbb N$ ;-) – Asaf Karagila Jun 30 '13 at 15:58
• How many of you wanted to post a Dothraki "It is known" meme after reading this? ;-) – Manishearth Jun 30 '13 at 16:02
• I don't claim it is a bug $\newcommand{mathbf}[1]{\text{;-) }#1}$. What about comments? :-) – joro Jun 30 '13 at 16:08
• @Manishearth: I don't follow memes, and have no idea what that meme is about. (I did follow the seasons of GoT though, so I know what Dothraki is.) – Asaf Karagila Jun 30 '13 at 16:24
• IMO, usage of newcommand and related should be discouraged/blocked altogether. This is somehow off-topic here, but I always wanted to say it and this is the best occassion so far. – user9072 Jun 30 '13 at 16:26
• @quid, I am sorry but... why? Have you tried to compose an answer which contains a couple of dozens of \mathbb{R} and or many \operatorname{Ext}?! – Mariano Suárez-Álvarez Jun 30 '13 at 16:51
• @MarianoSuárez-Alvarez: it might be that it is less relevant for things I write, but not completely so. I do not know which of my answers contains most formulas to check. But, since some years (I did this differently before, it's not that I don't know how to do it), I write most of my papers without or essentially without (especially if I have coauthors), which applies on MO, one reason. And, if you write so complicated answers you might use an editor and then run a replace. But I know I'm in the minority here. Also it is irritating while MathJax compiles. And, for reason just brought up. – user9072 Jun 30 '13 at 17:10
• Previously discussed on Meta.Math.SE: meta.math.stackexchange.com/questions/4130/… – Nate Eldredge Jul 1 '13 at 1:51
• This was changed in January 2019, now the scope is a single post (or a single comment). This is related to this change: Problem with posts and comments relying on macros defined elsewhere. – Martin Sleziak Feb 12 at 8:15

This is known

Answers which abuse this can obviously be flagged (or edited, though a flag alerts a moderator who may then give a strict warning to the user)

In fact, there are a bunch of other ways you can use mathjax abusively. Flag if you see it happening.

• What about comments ;-) – joro Jun 30 '13 at 16:10
• Just a pointer: for legitimate situations (where two users use custom macros with identical names), there's the begingroup extension (via \require) docs.mathjax.org/en/latest/tex.html#begingroup – Peter Krautzberger Jul 1 '13 at 2:12
• @peter not necessary, newcommand overwrites itself if used twice in a page. – Manishearth Jul 1 '13 at 2:21

Just testing mathbb.

\mathbb{N}==$\mathbb{N}$

...and

\mathbf{N}==$\mathbf{N}$