Skip to content

no mathjax result in the exported files #43

Open

Description

@fyears

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.

Activity

  1. yoavram commented on Jun 21, 2013

    @yoavram
    Owner

    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

  2. yoavram commented on Jun 24, 2013

    @yoavram
    Owner

    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.

  3. fyears commented on Jun 24, 2013

    @fyears
    Author

    @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.

  4. yoavram commented on Jul 9, 2013

    @yoavram
    Owner

    @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/)?

  5. fyears commented on Jul 9, 2013

    @fyears
    Author

    @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.

  6. fyears commented on Jul 9, 2013

    @fyears
    Author

    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.

  7. yoavram commented on Jul 11, 2013

    @yoavram
    Owner

    @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!

  8. added a commit that references this issue on Mar 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions