marginalia
marginalia copied to clipboard
Bug or missing documentation for LaTex code when MD markup conflicts
In some cases, there is a conflict between LaTeX markup and MD's. An example is:
\\(C_{1},...,C_{j}\\)
If you use that LaTeX code in your comment, then it won't be managed by MathJax. The issue is that Marginalia is parsing the LaTeX code within the LaTeX code and will add the <em>...</em>
markup which will render MathJax nonoperational.
To fix that, you have to single escape the MD markup like this:
\\(C\_{1},...,C\_{j}\\)
And that will work.
However:
- this will only work in comments, not in docstrings.
- if you try that code in docstring, you will get a compilation error since it is single escaped (would need to be double escaped)
Could this kind of usecases be handled directly in Marginalia before processing the MD code?
This was an issue for me as well. I'd have appreciated the above documentation that @fgiasson provided in the html.clj
documentation.