3
$\begingroup$

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.

$\endgroup$
3
  • 1
    $\begingroup$ @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. $\endgroup$
    – LSpice
    Commented Dec 18, 2020 at 15:04
  • 1
    $\begingroup$ $\DeclareMathOperator\a{a}$Here's a [link](mathoverflow.net) $\a$ and another link. $\endgroup$ Commented Dec 18, 2020 at 16:25
  • 1
    $\begingroup$ 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). $\endgroup$ Commented Dec 18, 2020 at 16:27

1 Answer 1

2
$\begingroup$

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$.
  • 8 $\newcommand{\R}{\mathbb R}$[link](http://mathoverflow.net) $\R$ and [another link](http://mathoverflow.net) - this one uses "newcommand" rather than DeclareMathOperator
  • 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
$\endgroup$
10

You must log in to answer this question.

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