markup
markup copied to clipboard
Markdown doesn't recognize \operatorname anymore
Until a short while ago (approximately 1-3 months, can't say for sure), using \operatorname in github gists worked just fine. Now it doesn't work anymore, see e.g. the following gist of mine:
https://gist.github.com/kasparthommen/d996b49b965a44dbfedc8677575a70ec
In fact, it doesn't work in this issue text either, see below.
$\operatorname{P}(A) = 1$
I have the same issue -- latex code I wrote last year no longer renders correctly:
https://github.com/mdehling/kolkin-style-transport/blob/679ca79ded0d53963f69a883c40b561b439a4c42/README.md
Can this be fixed?
Also seeing this. Please fix.
Yes, this is very strange. The \operatorname function in MathJax Markdown is extremely important, especially when using operators like floor() and ceiling(), which are typically not recognized as common math functions (so \floor cannot be used like \cos can).
Until Github fixes this, here is a temporary solution:
You can use \text instead of \operatorname...
Does Not Work:
Code:
$$ \operatorname{floor}(x) $$
Output:
$$ \operatorname{floor}(x) $$
Works (sort of):
Code:
$$ \text{floor}(x) $$
Output:
$$ \text{floor}(x) $$
The downsides to using this method are:
- It doesn't look exactly the same as other mathematical operators such as
sin()andcos(). - It doesn't have built-in spacing around it like other mathematical operators do.
- It is somewhat unprofessional to put annotation text into an equation where an operator is supposed to be, for those who are actually looking into the markdown code.
This could be working on some computers but not others. For those of you who don't see any error in the section labeled "Does Not Work", here is an image of what we are seeing:
Please fix this very soon. People shouldn't have to use PDFs instead of markdown files just so that they can show a simple math function in an equation.
As a workaround, you can use \mathop with \text to get the correct spacing for an operator:
$$ 2 \mathop{\text{tanh}} x = 0 $$
results in
$$ 2 \mathop{\text{tanh}} x = 0 $$