Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LaTeX apparently not parsed properly (issues with double quoting) #136

Open
fgiasson opened this issue Dec 15, 2014 · 2 comments
Open

LaTeX apparently not parsed properly (issues with double quoting) #136

fgiasson opened this issue Dec 15, 2014 · 2 comments

Comments

@fgiasson
Copy link
Contributor

When I check Marginalia's code, I can see that the following LaTeX code get properly parsed:

\\(a \ne 0\\)

Once parsed by Marginalia, it becomes \(a \ne 0\) and it get properly displayed by MathJax.

However, when I use the same LaTeX code in my own application, the double quotes remains the same in the output HTML (\\(a \ne 0\\)), and so it doesn't get parsed by MathJax because it was expecting single quotes.

I am using version 0.8.0

@fgiasson
Copy link
Contributor Author

Ok, I found the issue. But it is still confusing.

First I did test generating LaTeX using Marginalia 0.8.0. It was not working until I specify the configation of MathJax using:

:marginalia {:javascript ["mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"]}

I think this should be updated in the documentation.

However, for my project, even with this fix, it was not working. I found two things:

  1. I had to escape any MD characters. So, this LaTex: \(C_{1},...,C_{j}\) needs to be written \\\\(C\\_{1},...,C\\_{j}\\\\). This was not necessary for the test I made for Marginalia
  2. The other weird thing is that even with that fix, the docstring appears in the code section of the documentation. Normally the docstring is removed, but it in the code output when MathJax code is in the docstring.

It is really not clear why this is happening in my project. I tried to figure out what may be causing this, but the only thing I can see is com.petebevin.markdown.MarkdownProcessor otherwise I can't see where some text processing of the docstring may occurs. Any pointers?

@fgiasson
Copy link
Contributor Author

The issue is that the docstrings and the "outside" comments are handled differently. I just noticed that the code example from the project are not in docstrings.

If I move my LaTex code outside of the docstring (as normal comment before the function) then it works as expected.

Is this a known issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant