View Full Version : Vector graphics and math equations

07-20-2011, 06:13 PM
I have written a 500+ page college textbook on computer architecture and assembly language programming. It has over 100 figures (vector graphics), over 300 computer code listing, many tables, and many math equations. I wrote it in LaTeX, so it is beautifully formatted for a printed page, 8.5" x 11". This is a completed book; it has been used in the classroom at three colleges over the past ten years. Despite excellent reviews, traditional publishers feel that the market isn't big enough for them to make money on it.

I also produced a pdf version that has 0.1" margins and no binding gutter. It includes hyperlinks for all cross references and syntax coloring for the computer code listings. Students prefer this format for their mobile readers.

I would like to convert it to epub format so I can sell it on PubIt. (B&N runs many college bookstores.) But with all the figures, code listings, etc., that will not be a trivial task. Conversion programs like Calibre do not work on the figures, equations, and tables. I am prepared to do the conversion "by hand" but would like to know the best formats for vector graphics figures, math equations, etc. before this undertaking, since it will be a lot of work.

For example, I "drew" the figures using LaTeX's vector drawing commands. I would need to create a "master" file and temporarily paste each "drawing" into it for processing by LaTeX. From there I can produce either svg or png files. I believe that I can also do this with math equations. I assume that I will have to tweak tables "by hand."

Questions: What are the best formats for vector graphics and/or math equations in epub? Am I going in the right direction? Are there better ways to do this?

07-20-2011, 07:51 PM
SVG will certainly be superior for the figures, and frankly I'd investigate using it for the equations as well, since setting them in xhtml/css is going to be a royal pain (ePub3 has embraced MATHML, but that's for the future).

Don't even bother touching calibre, it'll just introduce more work cleaning things up. Start from the ground-up in Sigil and keep the styles as simple and consistent as possible.

07-23-2011, 02:50 PM
If you code the figures using the LaTeX package tikz (which is awesome), I believe you can then convert them to SVG.