softcover: math equations not displaying properly in EPUB and MOBI

In my Mac OS X, equations are not converted to graphics for displays in EPUB and MOBI. All dependency checks are passed.

When I create a new book by sc new sctest, and sc build:epub, it still does not display equations properly: instead of graphics, I can only see the LaTeX source codes for the equations.

I guess this is an issue in my local system. Any guess?

FYI:

chkwon@MacBook:sctest$ sc check
Checking Softcover dependencies...
Checking for LaTeX...         Found
Checking for GhostScript...   Found
Checking for ImageMagick...   Found
Checking for Node.js...       Found
Checking for PhantomJS...     Found
Checking for Inkscape...      Found
Checking for Calibre...       Found
Checking for KindleGen...     Found
Checking for Java...          Found
Checking for zip...           Found
Checking for EpubCheck...     Found
All dependencies satisfied.
chkwon@MacBook:sctest$ sc build:epub
Building EPUB...
  adding: mimetype (stored 0%)
  adding: META-INF/com.apple.ibooks.display-options.xml (deflated 26%)
  adding: META-INF/container.xml (deflated 33%)
  adding: OEBPS/a_chapter_fragment.xhtml (deflated 77%)
  adding: OEBPS/another_chapter_fragment.xhtml (deflated 62%)
  adding: OEBPS/content.opf (deflated 68%)
  adding: OEBPS/cover.xhtml (deflated 26%)
  adding: OEBPS/frontmatter_fragment.xhtml (deflated 74%)
  adding: OEBPS/images/cover.jpg (deflated 15%)
  adding: OEBPS/images/figures/01_michael_hartl_headshot.jpg (deflated 28%)
  adding: OEBPS/nav.xhtml (deflated 56%)
  adding: OEBPS/styles/custom.css (deflated 29%)
  adding: OEBPS/styles/custom_epub.css (deflated 40%)
  adding: OEBPS/styles/epub.css (deflated 43%)
  adding: OEBPS/styles/page-template.xpgt (deflated 80%)
  adding: OEBPS/styles/pygments.css (deflated 79%)
  adding: OEBPS/styles/softcover.css (deflated 75%)
  adding: OEBPS/toc.ncx (deflated 64%)
  adding: OEBPS/yet_another_chapter_fragment.xhtml (deflated 60%)

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 26 (11 by maintainers)

Commits related to this issue

Most upvoted comments

I was able to get around this on sierra by using the 0.48.5 build of inkscape, which you can download from here: https://inkscape.org/en/release/0.48.5/platforms/

Hope this helps someone… this was a big pain 😃.

OK, this was a nasty one. Not only did PhantomJS 1.9 break on Sierra, but (as you noted) changes to version 2.1.1 broke compatibility with the softcover gem. PhantomJS 2 is also incompatible with the older version of MathJax that came bundled with Softcover. Finally, the latest version of MathJax is compatible with PhantomJS but is (slightly) incompatible with the SVG-extraction algorithm used by Softcover’s page.js script.

I believe I’ve tracked down all the issues and now have a working version. Try out the new 1.3.0 gem to see if it works for you:

$ gem update softcover -v 1.3.0