You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Markdown math rendering fails on multiple subscripts with curly brackets #1575
In the meantime, a workaround is to use trailing spaces after underscore symbols: \mathbf{x}_ {i,j} = \mathbf{y}_ {i,j} renders as $\mathbf{x}_ {i,j} = \mathbf{y}_ {i,j}$
Reacted by Giovanni Palma, Mingjian He, Lado Razmadze, PhD, Tobias Bora, Sʜɪᴍᴜʀᴀ Yū, Prasanth, Daira-Emma Hopwood, A Profile, Ben Clarke, B. Oskam and 19 more
If the two subscripts are in two expressions but in the same line, render is broken as well.
Range of $\mathbf{d}_{ij}$ and $\mathbf{d}_{ij} \cdot \Delta E$
will be rendered as "Range of $\mathbf{d}{ij}$ and $\mathbf{d}{ij} \cdot \Delta E$", but the workaround also work for this case "Range of $\mathbf{d}_ {ij}$ and $\mathbf{d}_ {ij} \cdot \Delta E$"
I suspect this happens because a_b is detected as one word, so emphasis doesn't come in, but in a}_b, there is a word boundary between } and _, so it can be detected as emphasis.
Inline math expression:$\sum_{i=1}^{m}$$\sum_{i=1}^{m}$ Summation superscript rendering is bad!
Another e.g., $\frac{1}{2m}\sum_{i=1}^{m}{(\hat{y} _{i} - y _{i})}^{2}$$\frac{1}{2m}\sum_{i=1}^{m}{(\hat{y} _{i} - y _{i})}^{2}$
Block math expression: Summation superscript is okay! $$\sum_{i=1}^{m}$$$$\sum_{i=1}^{m}$$
Another e.g., $$\frac{1}{2m}\sum_{i=1}^{m}{(\hat{y} _{i} - y _{i})}^{2}$$
@prasanth-ntu I was looking for the same and found a workaround on a github gist of some repo. One of the solutions described there was the following ${\sum}_{k=0}^{K}$ = ${\sum}_{k=0}^{K}$. Although, these issues require #github's attention and hopefully should be fixed at some point 🤞
Activity
stroitzsch commentedon Jul 18, 2022
In the meantime, a workaround is to use trailing spaces after underscore symbols:$\mathbf{x}_ {i,j} = \mathbf{y}_ {i,j}$
\mathbf{x}_ {i,j} = \mathbf{y}_ {i,j}renders aszhongzachary commentedon Aug 4, 2022
Same issue, thanks for the workaround tho!
giopalma commentedon Aug 20, 2022
In some cases also without curly brackets don't work.
Example:
19 =_2 010011The workaround works fine.
tautomer commentedon Oct 27, 2022
If the two subscripts are in two expressions but in the same line, render is broken as well.
will be rendered as "Range of $\mathbf{d}{ij}$ and $\mathbf{d}{ij} \cdot \Delta E$", but the workaround also work for this case "Range of$\mathbf{d}_ {ij}$ and $\mathbf{d}_ {ij} \cdot \Delta E$ "
tobiasBora commentedon Nov 21, 2022
To give more strange examples (but thanks a lot for the workaround), if I put a single expression it works, if I copy/paste it it fails:
Gives$V^{a}_{x}$
But
Gives $V^{a}{x} V^{a}{x}$
My bet is that github confuses it with emphasis (like in
_emphasis_), explaining why adding a space solves the issue…tobiasBora commentedon Nov 21, 2022
Also something similar happens with stars (I guess again because it thinks it's bold, so the same work around also works):
Gives
$V^{*}$ (ok)
Gives $V^{} V^{}$ (bad!)
Gives
$V^{ * } V^{ * }$ (ok)
ImpleLee commentedon Dec 1, 2022
I suspect this happens because
a_bis detected as one word, so emphasis doesn't come in, but ina}_b, there is a word boundary between}and_, so it can be detected as emphasis.So
a _b c_dis working buta _b c_ dis not.ImpleLee commentedon Dec 1, 2022
For non-inline math, as an alternative, we can use
to replace
$$.I have more experiments at ImpleLee/c4w#1 .
prasanth-ntu commentedon Mar 10, 2023
Inline math expression:$\sum_{i=1}^{m}$ Summation superscript rendering is bad!$\frac{1}{2m}\sum_{i=1}^{m}{(\hat{y} _{i} - y _{i})}^{2}$
$\sum_{i=1}^{m}$Another e.g.,
$\frac{1}{2m}\sum_{i=1}^{m}{(\hat{y} _{i} - y _{i})}^{2}$Block math expression: Summation superscript is okay!
$$\sum_{i=1}^{m}$$
$$\frac{1}{2m}\sum_{i=1}^{m}{(\hat{y} _{i} - y _{i})}^{2}$$
$$\sum_{i=1}^{m}$$Another e.g.,
Any workarounds?
it trying out github/markup#1575
Fix math rendering due to markup issue
mbaudin47 commentedon Jun 2, 2023
See e.g. ${\boldsymbol{x}1, ..., \boldsymbol{x}{i-1}, \boldsymbol{x}_{i+1}, ..., \boldsymbol{x}_n}$, which fails to render.
kirk86 commentedon Jun 13, 2023
@prasanth-ntu I was looking for the same and found a workaround on a github gist of some repo. One of the solutions described there was the following${\sum}_{k=0}^{K}$ . Although, these issues require #github's attention and hopefully should be fixed at some point 🤞
${\sum}_{k=0}^{K}$=Fix math rendering in GitHub
doc | Even more GitHub workarounds
27 remaining items
[skip ci] revising README.md (to be continued)
[skip ci] revising README.md (to be continued)
revising README.md (to be continued)
revising README.md (to be continued)
revised README.md
Added spaces after underscore due to LaTEX bugs in GitHub...
github-actions commentedon Aug 16, 2024
Stale issue message
Use trailing spaces workaround for underscripts
Use trailing spaces workaround for underscripts
Revamp the documentation (#324)
fix: README.org
cdfh commentedon Jun 3, 2026
This bug is still unfixed. The best workaround is to use the syntax described here:
jgm/pandoc#9121
fix(math): use GitHub's verbatim math forms so expressions render int…