# \DeclareMathOperator at the beginning of a comment disables some link parsing

In a comment of the form $\DeclareMathOperator\a{a}$Here's a [link](http://mathoverflow.net) and [another link](http://mathoverflow.net) $\a$, neither link is parsed; in a comment of the form $\DeclareMathOperator\a{a}$Here's a [link](http://mathoverflow.net)$\DeclareMathOperator\a{a}$ $\a$ and [another link](http://mathoverflow.net), the second link is parsed and the first is not; and in a comment of the form Here's a [link](http://mathoverflow.net)$\DeclareMathOperator\a{a}$ and [another link](http://mathoverflow.net) $\a$, both links are parsed.

• @MartinSleziak, thanks! I tried to guess at a minimal test case from some that had happened to me in the wild, and I guessed wrong. I posted a few more variants beneath your comment. It seems from a few tests that it only happens when \DeclareMathOperator is at the beginning, and only when \a is actually used, and that the affected span is between the declaration and the use. I updated the sample text accordingly. Dec 18, 2020 at 15:04
• $\DeclareMathOperator\a{a}$Here's a [link](mathoverflow.net) $\a$ and another link. Dec 18, 2020 at 16:25
• So it seems that the problem can be replicated also on meta, not only on main. (I am mentioning this because of the first version of this question saying that "apparently the problem does not occur on MMO".) In the previous comment I have posted this: $\DeclareMathOperator\a{a}$Here's a [link](http://mathoverflow.net) $\a$ and [another link](http://mathoverflow.net). Dec 18, 2020 at 16:27

This answer is intended for testing.

Please include the source code used in the comments into the answer — so that we can check when the link works and when it doesn't.

• 1 $\DeclareMathOperator{\Hom}{Hom}$ [link](http://mathoverflow.net) $\Hom (U\times V,W)$ and [another link](http://mathoverflow.net).
• 2 $\DeclareMathOperator{\Hom}{Hom}$ [link](http://mathoverflow.net) $\Hom$ and [another link](http://mathoverflow.net).
• 3 $\DeclareMathOperator{\R}{\mathbb R}$[link](http://mathoverflow.net) $\R$ and [another link](http://mathoverflow.net).
• 4 $\DeclareMathOperator{\R}{\mathbb R}$ [link](http://mathoverflow.net) $\R$ and [another link](http://mathoverflow.net). — The difference between this comment and the one before is just the space added before the first link.
• 5 A $\DeclareMathOperator\a{a}$[link](http://mathoverflow.net) $\a$ and [another link](http://mathoverflow.net).
• 6 A [link](http://mathoverflow.net) $\DeclareMathOperator\a{a}$and [another link](http://mathoverflow.net) $\a$. The problem seems to concern parsing of links between a \DeclareMathOperator with no following space and the invocation of that math operator, wherever they occur in the comment.
• 7 $\DeclareMathOperator\a{a}$A [link](http://mathoverflow.net) and [another link](http://mathoverflow.net) $\a$.
• 9 $\def\R{\mathbb R}$[link](http://mathoverflow.net) $\R$ and [another link](http://mathoverflow.net) - this one uses "def" rather than DeclareMathOperator
• 10 $\let\vp\varphi$[link](http://mathoverflow.net) $\vp$ and [another link](http://mathoverflow.net) - this one uses "let" rather than DeclareMathOperator
• $\DeclareMathOperator{\Hom}{Hom}$ link $\Hom (U\times V,W)$ and another link. Dec 18, 2020 at 16:35
• $\DeclareMathOperator{\Hom}{Hom}$ link $\Hom$ and another link. Dec 18, 2020 at 16:36
• $\DeclareMathOperator{\R}{\mathbb R}$[link](mathoverflow.net) $\R$ and another link. Dec 18, 2020 at 16:37
• $\DeclareMathOperator{\R}{\mathbb R}$ link $\R$ and another link. Dec 18, 2020 at 16:38
• A $\DeclareMathOperator\a{a}$[link](mathoverflow.net) $\a$ and another link. Dec 18, 2020 at 16:58
• A link $\DeclareMathOperator\a{a}$and [another link](mathoverflow.net) $\a$. Dec 18, 2020 at 16:59
• $\DeclareMathOperator\a{a}$A [link](mathoverflow.net) and [another link](mathoverflow.net) $\a$. Dec 18, 2020 at 17:00
• $\def\R{\mathbb R}$[link](mathoverflow.net) $\R$ and another link - this one uses "def" rather than DeclareMathOperator Dec 19, 2020 at 8:29
• $\let\vp\varphi$[link](mathoverflow.net) $\vp$ and another link - this one uses "let" rather than DeclareMathOperator Dec 19, 2020 at 8:34