4
$\begingroup$

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}$

$\endgroup$
10
  • 1
    $\begingroup$ That's a well known issue $\Bbb N$ ;-) $\endgroup$
    – Asaf Karagila Mod
    Jun 30, 2013 at 15:58
  • $\begingroup$ How many of you wanted to post a Dothraki "It is known" meme after reading this? ;-) $\endgroup$ Jun 30, 2013 at 16:02
  • $\begingroup$ I don't claim it is a bug $\newcommand{mathbf}[1]{\text{;-) }#1}$. What about comments? :-) $\endgroup$
    – joro
    Jun 30, 2013 at 16:08
  • $\begingroup$ @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.) $\endgroup$
    – Asaf Karagila Mod
    Jun 30, 2013 at 16:24
  • 1
    $\begingroup$ 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. $\endgroup$
    – user9072
    Jun 30, 2013 at 16:26
  • 6
    $\begingroup$ @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}?! $\endgroup$ Jun 30, 2013 at 16:51
  • $\begingroup$ @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. $\endgroup$
    – user9072
    Jun 30, 2013 at 17:10
  • $\begingroup$ Previously discussed on Meta.Math.SE: meta.math.stackexchange.com/questions/4130/… $\endgroup$ Jul 1, 2013 at 1:51
  • 1
    $\begingroup$ So, if an answer contains \newcommand\RR{\mathbb{R}}, another contains \newcommand\RR{\mathcal{R}}, and a third uses \RR without defining it, the symbol shown in the third answer depends on the order in which the previous answers are visualized? Sounds tricky. $\endgroup$ Jul 2, 2013 at 9:08
  • $\begingroup$ 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. $\endgroup$ Feb 12, 2020 at 8:15

2 Answers 2

2
$\begingroup$

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.

$\endgroup$
3
  • $\begingroup$ What about comments ;-) $\endgroup$
    – joro
    Jun 30, 2013 at 16:10
  • $\begingroup$ 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 $\endgroup$ Jul 1, 2013 at 2:12
  • $\begingroup$ @peter not necessary, newcommand overwrites itself if used twice in a page. $\endgroup$ Jul 1, 2013 at 2:21
0
$\begingroup$

Just testing mathbb.

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

...and

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

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .