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

Example of Latex to PDF conversion #12

Open
tim-peterson opened this issue Feb 16, 2013 · 6 comments
Open

Example of Latex to PDF conversion #12

tim-peterson opened this issue Feb 16, 2013 · 6 comments

Comments

@tim-peterson
Copy link

I just did a pull request, deae452, to show Latex to PDF conversion. The test document I used can be viewed/downloaded from here. This conversion is successful in several areas but fails when it comes to: 1) generating a table and 2) generating math equations (compare images below):

The way its supposed to look:
Screen Shot 2013-02-15 at 9 07 47 PM

The way my PHP script + Docverter renders the output:
Screen Shot 2013-02-15 at 9 07 26 PM

.

@peterkeen
Copy link
Collaborator

Yeah, unfortunately one of the things that Docverter doesn't actually do is render LaTeX, which I realize is something that the documentation sort of claims. I don't really see this changing anytime soon, either, since it would require a very large LaTeX install on the server.

@tim-peterson
Copy link
Author

Is not wanting to install LaTeX a cost($) issue, i.e., don't want to allow people to convert using your servers?

If so, perhaps your documentation can at least explain to people how to implement LaTeX conversion if you know how to do it. Doing LaTeX conversion was a big reason I investigated Docverter in the first place, so would want to limit the confusion of future Docverter users.

Or rather is the problem that you don't know all the steps to make the LaTeX conversion work? I of course don't either but either way would be good to comment on this in the documentation.

@peterkeen
Copy link
Collaborator

There are multiple issues. First, because I'm targeting Docverter to be
installed on heroku, the amount of disk space that you can use is very
limited. 100mb is basically it, which doesn't cut it for a full-blown LaTeX
install. Second, I made the tradeoff early on to focus on whatever -> html
-> pdf conversions because I felt the styling possibilities for html -> pdf
are way better than using LaTeX as the intermediary. I'm sorry that
Docverter probably won't cut it for what you want to do. I should probably
just remove mention of LaTeX from the docs, since all it does is confuse.

On Fri, Feb 15, 2013 at 6:34 PM, tim peterson [email protected]:

Is not wanting to install LaTeX a cost($) issue, i.e., don't want to allow
people to convert using your servers?

If so, perhaps your documentation can at least explain to people how to
implement LaTeX conversion if you know how to do it. Doing LaTeX conversion
was a big reason I investigated Docverter in the first place, so would want
to limit the confusion of future Docverter users.

Or rather is the problem that you don't know all the steps to make the
LaTeX conversion work? I of course don't either but either way would be
good to comment on this in the documentation.


Reply to this email directly or view it on GitHubhttps://github.com//issues/12#issuecomment-13638879.

@tim-peterson
Copy link
Author

I think the LaTeX conversion would be a strong addition but understand your perspective/limitations.

Just FYI, you can indefinitely get a free micro-instance on EC2 which gives you 5Gb. I could never figure out Heroku but EC2 came very easy to me as there are easily google-able install examples for pretty much everything you'd ever want to do. If you've already used up your free tier on EC2, then yeah removing mention of LaTeX and/or providing explanation of how to extend Docverter (or suggest to use pdfTex to make the pdf) would be best.

@cben
Copy link

cben commented Mar 8, 2014

What's your stance towards math support in markdown->tex and markdown->html conversions?

I'd like to use docverter for tex export from my markdown editor http://github.com/cben/mathdown; if people then want to compile the tex online I'd offer them import to sharelatex.com / writelatex.com.
And docverter is already used (for various conversions) by https://github.com/yoavram/markx.

If you care about math for non-PDF outputs, I'll try to send PRs to support:

  • Use MathJax in html output.
  • Options to enable tex_math_single_backslash (for me), tex_math_double_backslash (for Markx) pandoc extensions. And perhaps (need to figure it out) disable latex_macros (both latex and mathjax can handle macros themselves).

@cben
Copy link

cben commented Oct 5, 2015

Friendly ping: would you accept PRs to support math (without requiring latex)?

A few things have improved and it should be totally possible to render math even to PDF via HTML without running LaTeX.
I see you generate PDF using https://github.com/flyingsaucerproject/flyingsaucer.
It doesn't run javascript so we can't just use MathJax. But it's possible to preprocess math into SVG using https://github.com/mathjax/MathJax-node. It seems flyingsaucer doesn't render SVG out of the box but there is example source how to do it.
The other good option is KaTeX (or MathJax 2.6 with CommonHTML output) which simply generates static HTML + CSS. I'm not sure flyingsaucer's CSS 2.1 support will suffice.

How do you feel about replacing flyingsaucer with a real browser engine, e.g. phantomjs? At least as an option?

In any case, just being able to pass the few pandoc options to support math in non-PDF outputs would be easy and definitely useful.

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

3 participants