hackmd-io-issues
hackmd-io-issues copied to clipboard
LaTeX not rendering when downloading note as html
Is this a hackmd.io issue?
Yes, the bug happens on https://hackmd.io
What's the problem
LaTeX is not rendering when downloading as html
Current behaviour
I've tried in Firefox, Chrome, and Edge (both downloading from and viewing in). Here is a screenshot of one of my notes:
Steps to reproduce:
Write some LaTeX, try to download your note as html
.
Was there any progress here? It's still occurring in my environment too.
-
On hackmd
-
via downloading html file
-
the code
$$
C_{i}=\frac{L_i}{{}_{k_i}\mathrm{C}_2}=\frac{2L_{i}}{k_{i}\left(k_{i}-1\right)}
$$
Was there any progress here?
Hi guys, thanks for keeping this issue in track. There is no near plan to fix this, we are working on other tasks. We will list this as known issue.
As a workaround,
- download the HTML file
- add the following, right after
<head>
-
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
-
- delete the code between
<span class="MathJax_Preview" style="color: inherit;">
and<script type="math/tex; mode=display" id="MathJax-Element-1">
(1
would be a specific number)- I've provided an example: https://gist.github.com/Xilorole/f9d4d167c3583923a0bef795690d32ea/revisions?diff=unified
worked for me. What you need was this;
<div id="doc" class="markdown-body container-fluid comment-inner comment-enabled" data-hard-breaks="true"><p><span class="mathjax"><script type="math/tex; mode=display" id="MathJax-Element-1">
C_{i}=\frac{L_i}{{}_{k_i}\mathrm{C}_2}=\frac{2L_{i}}{k_{i}\left(k_{i}-1\right)}
</script></span></p></div>
I hope this helps.
A simpler (but uglier) workaround is to change the math renderer.
Result of the first formula:
A workaround building upon @Xilorole's comment:
- download the HTML file
- add the following, right after
<head>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
...and then add span.MathJax_CHTML {display: none}
in the <style>
of the document.
This avoids having to manually delete all the badly rendered characters.
I hope this will get fixed, though! :)