socmap / pandoc

Automatically exported from code.google.com/p/pandoc
GNU General Public License v2.0
0 stars 0 forks source link

Math formula in epub. #300

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Currently, epub supports images. Using --gladtex option, it was possible to 
include math formula for HTML, Slidy and S5 output. It would be great to have 
an automatic mechanism for epub output as well. A possibility would be to give 
the option:

--glatex=<path to gladtex script>

such that pandoc could process the images and create the correct content 
structure in the epub file.

Arguably, the change can also be done in gladtex. At least the latex formula 
should be enclosed with the markup <eq> in the epub unzipped main file.

Original issue reported on code.google.com by gmo...@gmail.com on 29 Apr 2011 at 12:17

GoogleCodeExporter commented 8 years ago
I've pushed a change to the github master branch that allows you to use 
--gladtex with epub output.  You'll need to write your own script to unpack the 
epub, run gladtex to generate images, and possibly update epub metadata (I 
think the image files will need entries in content.opf).  But at least it 
should be possible to do this now.

--mathml now also has an effect.  I follow 
http://www.dessci.com/en/reference/ebooks/EPUBMath_spec.htm here.  
Unfortunately, this doesn't produce good results in any ebook reader I have 
tried.

Original comment by fiddloso...@gmail.com on 29 Apr 2011 at 6:09

GoogleCodeExporter commented 8 years ago
Thanks, I also attach here a shell script that does the work. It depends on 
gladtex and tidy and I used a hack to make it work with the current release of 
pandoc.

Usage:
  markdown2epub input.mkd -o output.epub

Original comment by gmo...@gmail.com on 25 May 2011 at 1:48

Attachments:

GoogleCodeExporter commented 8 years ago
Hi!

Great stuff! There were two problems for the script in the .tex file I tested 
it with: multiple-line equations, and labels to the equations don't work, but 
otherwise this combination of pandoc & gladtex (& tidy & sed & ...) is the 
first way coming close to make LaTeX documents readable in an E-reader friendly 
format!

Original comment by Locke...@gmail.com on 7 Aug 2011 at 5:43