12-06-2011, 09:59 AM | #1 |
Enthusiast
Posts: 27
Karma: 10
Join Date: Mar 2009
Device: Kindle, iPhone, iPad
|
LaTeX to HTML conversion
I have the latex source of a book and want to read the book in Kindle. I know if I can get the html files, then calibre can do the rest of the job.
I thought LaTeX-->HTML should be very easy, since I've already got all the source files. However, I've tried many different tools including latex2html, tt4h, plastex, pandoc etc., and none of them produce satisfactory result. Is there any good LaTeX to HTML conversion software? |
12-06-2011, 10:03 AM | #2 |
Grand Sorcerer
Posts: 19,226
Karma: 67780237
Join Date: Jul 2011
Device: none
|
It should be, but there's some stuff in LaTeX that probably won't convert too well. LaTeX is a bit more placement-oriented than HTML which is a bit more free-flow based. There are other things that LaTeX does well like equations that HTML is not going to support too much.
What kinds of issues are causing you grief or what kind of source material is it? That might lead people to better recommendations. |
Advert | |
|
12-06-2011, 10:14 AM | #3 |
Enthusiast
Posts: 27
Karma: 10
Join Date: Mar 2009
Device: Kindle, iPhone, iPad
|
The book source is available at https://launchpad.net/fenics-book, which contains a lot of math formulas and pdf images.
I took a lot of effort manually converting all the pdf and png images to eps images, so that latex2html won't complain. However, after this much effort, latex2html still failed to convert any of the math formulas or figures to images. The log files (book.aux and images.log) are attached. |
12-06-2011, 10:26 AM | #4 |
Well trained by Cats
Posts: 29,785
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
@konzifan
You do realize TEX was written by Dr. Knuth because he got tired of printers mangling formulas in his Math Textbooks? |
12-06-2011, 10:34 AM | #5 |
Grand Sorcerer
Posts: 19,226
Karma: 67780237
Join Date: Jul 2011
Device: none
|
The pdf images and math formulas are going to give you fits. Right now, the e-reader formats just aren't that useful when it comes to scientific (espeically math) stuff.
It can be done, but from previous threads, there's no real easy solution for it outside of some manual labour. |
Advert | |
|
12-06-2011, 10:51 AM | #6 |
Enthusiast
Posts: 27
Karma: 10
Join Date: Mar 2009
Device: Kindle, iPhone, iPad
|
latex2html used to give me quite good results (even for documents with a lot of math formulas and figures). However, it hasn't been updated for almost 10 years, and might be too old to understand some of the new latex commands.
|
12-08-2011, 04:29 PM | #7 |
Enthusiast
Posts: 27
Karma: 10
Join Date: Mar 2009
Device: Kindle, iPhone, iPad
|
After trying different options, I found the most satisfactory result is obtained by compiling latex into A5 (or 6") size pdfs (as discussed in https://www.mobileread.com/forums/sho...d.php?t=107585). I wish Kindle could support table of contents and internal links, then those pdfs would be excellent to read, given that they present the math equations and figures beautifully.
|
12-11-2011, 09:13 AM | #8 |
Linux User
Posts: 2,279
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
|
In many ways it's the same issue as with PDF->HTML. LaTeX is designed to produce print matter (dvi, pdf) as such there are many things in TeX that can not be expressed easily or at all in HTML and vice versa.
If you want it on the eReader, making a PDF with eReader formats in the font size you like might indeed be the best option. However not even that always works, it depends on how the TeX document is made and how well it copes with "small" paper geometry... Out of the genuine tex->html converters I've had best results with plastex. It requires some fiddling and the html some manual fixing. But at least it's something. Commenting unnecessary stuff out of the TeX first (such as header / footer / pagenumbers / etc) might help also. |
12-14-2011, 10:47 AM | #9 | |
Digital Amanuensis
Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
|
Quote:
Also tex4ht does a good job in converting LaTeX -> (X)HTML. |
|
12-14-2011, 04:41 PM | #10 |
Digital Amanuensis
Posts: 727
Karma: 1446357
Join Date: Dec 2011
Location: Turin, Italy
Device: Several eReaders and tablets
|
I forgot to mention that LaTeXML is a promising project as well.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
docbook vs. latex vs. html | danmc | Workshop | 4 | 09-15-2011 02:15 PM |
Problem with html -> Mobi conversion - html tags visible. | khromov | Calibre | 9 | 08-06-2011 11:25 AM |
HTML Conversion | yoss15 | Conversion | 12 | 07-28-2011 04:42 PM |
conversion TO html | in_the_fade | Calibre | 4 | 04-29-2010 10:51 AM |
Chaîne complète d'édition : HTML, LaTeX, PDF, EPUB à venir. | Randy11 | Software | 2 | 04-05-2009 11:42 AM |