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

no mathjax result in the exported files #43

Open
fyears opened this issue Jun 13, 2013 · 7 comments
Open

no mathjax result in the exported files #43

fyears opened this issue Jun 13, 2013 · 7 comments
Labels

Comments

@fyears
Copy link

fyears commented Jun 13, 2013

As we all know that math formula support by mathjax is just js effect. So if someone export a pdf or docx file from the button, we cannot see any math formula result there.

I will consider it a bug. Hope some smart developer guys can fix it.

And at least there should be some warning.

PS: I found a tricky way, in case anyone need it. Click "change display", and print the page using chrome. It's a "better than never" way to export a "right" pdf file.

@yoavram
Copy link
Owner

yoavram commented Jun 21, 2013

Hi
Pandoc is capable of handling mathjax and convert it to real math.
The problem is that:
a) Docverter doesn't support this, and b) latexonline API is broken.

So, if you got Pandoc and LaTeX on your machine you can use Markx locally to produce PDFs with math.
Otherwise, you got to use workarounds until the latexonlne API comes back (opened issue here: aslushnikov/latex-online#2)

About the "there should be a warning" - Markx is not my work, it's a hobie project. Hopefully it's useful enough so that other people contribute. You are welcome to add a warning and open a pull-request.

Yoav

@yoavram
Copy link
Owner

yoavram commented Jun 24, 2013

OK, latex-online now works.

To convert Markdown with LaTeX to PDF you need to change the converter to Pandoc (by clicking the "D" button) and then convert to PDF (by clicking the Download and Convert menu and choosing PDF).

@fyears, please let me know if this works for you.

@yoavram yoavram closed this as completed Jun 24, 2013
@fyears
Copy link
Author

fyears commented Jun 24, 2013

@yoavram I select "pdf" and "word", the files are what we would expect. Cool.

But one more thing, bad news: I select "html", and the file can not deal with the display mode formula properly.

@yoavram yoavram reopened this Jun 27, 2013
@yoavram
Copy link
Owner

yoavram commented Jul 9, 2013

@fyears which of the converters ("D" and "P") acts up? "P"? Does the formula appears correctly on the realtime preview? Can you upload the markdown to somewhere (like http://pastebin.com/)?

@fyears
Copy link
Author

fyears commented Jul 9, 2013

@yoavram

Lets' make sure we are talking about the same thing at first: I have NEVER installed markx by myself. I ALWAYS use markx at https://markx.herokuapp.com/# .So you should be able to get the same result as mine easily. Maybe you were talking about the latest code in github, and I was talking about the not-updated version in the website?

Again, now I am using https://markx.herokuapp.com/# . I select "P". I convert the text in the website. The texts are below. The formula appears correctly on the realtime preview. The exported .docx and .pdf files are fine and as expected. But the formula in the exported .html is wrong.

The original markdown:

You can use $LaTeX$. Just write it between `$`s or `\\(` and `\\)` for inline equations and `$$`s or `\\[` and `\\]` for display mode:

- Inline mode $\frac{df(x)}{dt}=lim_{x \to 0}{\frac{f(x+h)-f(x)}{h}}$
- Display mode: $$\frac{df(x)}{dt}=lim_{x \to 0}{\frac{f(x+h)-f(x)}{h}}$$

The full rendered html code in the exported markx.html file:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="pandoc" />
  <title></title>
</head>
<body>
<p>You can use <span class="math"><em>L</em><em>a</em><em>T</em><em>e</em><em>X</em></span>. Just write it between <code>$</code>s or <code>\\(</code> and <code>\\)</code> for inline equations and <code>$$</code>s or <code>\\[</code> and <code>\\]</code> for display mode:</p>
<ul>
<li>Inline mode <span class="math">$\frac{df(x)}{dt}=lim_{x \to 0}{\frac{f(x+h)-f(x)}{h}}$</span></li>
<li>Display mode: <br /><span class="math">$\frac{df(x)}{dt}=lim_{x \to 0}{\frac{f(x+h)-f(x)}{h}}$</span><br /></li>
</ul>
</body>
</html>

Hope it helps.

@fyears
Copy link
Author

fyears commented Jul 9, 2013

Some additional tips:

I did some search, and found that <span class="math"> is usually used by jsmath . However the pandoc converter can't convert the formula with correct html, js and css code. It's not an easy job to fix the bug.

@yoavram
Copy link
Owner

yoavram commented Jul 11, 2013

@fyears The online version is the most updated AFAIK. And I didn't think you installed markx. So we are on the same page 👍

From what you wrote I think that the problem may be solved by inserting the --mathjax option (see Pandoc Guide) in the pandoc function in server.py.

I'll try it and will update - it may take some time, though, because I'm a bit busy these days.

Thanks a lot for helping out debugging this!

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

No branches or pull requests

2 participants