2

I followed the instructions in this other question to generate an ePub from Latex with SVG images(I don't want to use ePub 3.0) with tex4ebook, but the generated epub has no images.

I already found this question and I have the package dvisvgm. But I still have the same problem.

This is my .tex file:

\documentclass{book}
\usepackage{mathtools,amsmath,mathrsfs}
\usepackage{amsthm}
\title{Calculus}
\author{Anon}
\begin{document}
\maketitle
\chapter{Chapter title} 
Expression: $\int x^2  dx$
\end{document}

The configuration file, myconfig.cfg:

\Preamble{xhtml,pic-align,pic-m,}
  \Configure{Picture}{.svg}  
  \makeatletter
  \Configure{graphics*}
  {svg}
  {
    {\Configure{Needs}{File: \Gin@base.svg}\Needs{}}
    \Picture[\csname a:GraphicsAlt\endcsname]{\csname Gin@base\endcsname.svg
            \csname a:Gin-dim\endcsname}
  }
  \begin{document}
  \EndPreamble

And I've tried with and without the .mk4 file mentioned in the previous question but I get the same result.

I use the command tex4ebook -c myconfig.cfg tex4htExample.tex

This is the .log file and the terminal output. I can't find the missing package or error.

Edit:

Installed Ubuntu on a virtual machine and installed Texlive with sudo apt-get install texlive-full and I installed tex4ebook. I ran the same command and I had no errors, but the result still has not any SVG file. I've opened the ePub in iBooks, Sigil and Adobe Digital Editions and all of them shows no image(or non existing image) where the expression is supposed to be.

This are the files after calling tex4ebook:

content.opf            tex4htExample.css   tex4htExample.log
efficient.mk4          tex4htExample.dvi   tex4htExample.ncx
myconfig.cfg           tex4htExample-epub  tex4htExample.tex
tex4htExample.4ct      tex4htExample.epub  tex4htExample.tex~
tex4htExample.4tc      tex4htExample.html  tex4htExample.tmp
tex4htExample.aux      tex4htExample.idv   tex4htExample.xref
tex4htExamplech1.html  tex4htExample.lg    zztex4htExample.ps

In the source code of the epub I can see it's trying to print the image tex4htExample0x.svg, but this doesn't exists.

If I run the command saving the output like this:

tex4ebook -c myconfig.cfg tex4htExample.tex > linuxterminal.log

On Linux, I get this output on the screen but not in linuxterminal.log:

This is dvips(k) 5.993 Copyright 2013 Radical Eye Software (www.radicaleye.com)
' TeX output 2015.10.31:1458' -> 
</usr/share/texlive/texmf-dist/dvips/base/tex.pro>
</usr/share/texlive/texmf-dist/dvips/config/alt-rule.pro>
</usr/share/texlive/texmf-dist/dvips/base/texps.pro>. 
</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr7.pfb>
</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb>
</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmex10.pfb>[1] 
sh: 1: convert: not found
This is dvips(k) 5.993 Copyright 2013 Radical Eye Software (www.radicaleye.com)
' TeX output 2015.10.31:1458' -> 
</usr/share/texlive/texmf-dist/dvips/base/tex.pro>
</usr/share/texlive/texmf-dist/dvips/config/alt-rule.pro>
</usr/share/texlive/texmf-dist/dvips/base/texps.pro>. 
</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr7.pfb>
</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb>[2] 
sh: 1: convert: not found
cp: cannot stat 'tex4htExample0x.svg': No such file or directory
cp: cannot stat 'tex4htExample1x.svg': No such file or directory

And a slightly different one on Mac:

This is dvips(k) 5.995 Copyright 2015 Radical Eye Software (www.radicaleye.com)
' TeX output 2015.10.31:1505' -> 
</usr/local/texlive/2015/texmf-dist/dvips/base/tex.pro>
</usr/local/texlive/2015/texmf-dist/dvips/config/alt-rule.pro>
</usr/local/texlive/2015/texmf-dist/dvips/base/texps.pro>. 
</usr/local/texlive/2015/texmf-dist/fonts/type1/public/amsfonts/cm/cmr7.pfb>
</usr/local/texlive/2015/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb>
</usr/local/texlive/2015/texmf-dist/fonts/type1/public/amsfonts/cm/cmex10.pfb>
[1] 
pstoedit: version 3.62 / DLL interface 108 (built: Feb 20 2015 - release build - g++ 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56) - 64-bit) : Copyright (C) 1993 - 2013 Wolfgang Glunz
Problem during opening /usr/local/Cellar/pstoedit/3.62_1/lib/pstoedit/libp2edrvmagick++.0.so:dlopen(/usr/local/Cellar/pstoedit/3.62_1/lib/pstoedit/libp2edrvmagick++.0.so, 1): Library not loaded: /usr/local/lib/libMagick++-6.Q16.5.dylib
  Referenced from: /usr/local/Cellar/pstoedit/3.62_1/lib/pstoedit/libp2edrvmagick++.0.so
  Reason: image not found
Problem during opening of pstoedit driver plugin: /usr/local/Cellar/pstoedit/3.62_1/lib/pstoedit/libp2edrvmagick++.0.so. This is no problem as long the driver in this library is not needed. Possibly you need to install further libraries and/or extend the LD_LIBRARY_PATH (*nix) or PATH (Windows) environment variables.
Problem during opening /usr/local/Cellar/pstoedit/3.62_1/lib/pstoedit/libp2edrvmagick++.so:dlopen(/usr/local/Cellar/pstoedit/3.62_1/lib/pstoedit/libp2edrvmagick++.so, 1): Library not loaded: /usr/local/lib/libMagick++-6.Q16.5.dylib
  Referenced from: /usr/local/Cellar/pstoedit/3.62_1/lib/pstoedit/libp2edrvmagick++.so
  Reason: image not found
Problem during opening of pstoedit driver plugin: /usr/local/Cellar/pstoedit/3.62_1/lib/pstoedit/libp2edrvmagick++.so. This is no problem as long the driver in this library is not needed. Possibly you need to install further libraries and/or extend the LD_LIBRARY_PATH (*nix) or PATH (Windows) environment variables.
cp: tex4htExample0x.svg: No such file or directory

I actually have no idea if this is relevant. Trying to find some clue.

And, just in case, the terminal output.

  • the second linked question deals with png pictures. in your case, you need dvisvgm command. can you run it from the command line? could you also attach the terminal output? (not the log file, it doesn't contain possible error messages from make4ht) – michal.h21 Oct 22 '15 at 22:14
  • Thanks for your comment, @michal.h21. Terminal output attached. And yes, I can run dvisvgm – Danowsky Oct 22 '15 at 22:20
  • I can't reproduce the error, but it seems that you have also file myconfig.cfg.tex, which is included instead of myconfig.cfg. try to remove this file – michal.h21 Oct 31 '15 at 9:51
  • You're right. I selected the option for always showing extensions on Mac and I renamed them and the error disappeared. The SVG files are not been created though. I just updated the question. – Danowsky Oct 31 '15 at 20:14
  • On Linux, install imagemagick. – Paul Gaborit Oct 31 '15 at 20:19
1

I've got some errors related to graphicx package when I executed your sample. It happened because some internal graphicx macros are used in the .cfg file. Inclusion of graphicx package helped.

The modified file looks like:

\documentclass{book}
\usepackage{mathtools,amsmath,mathrsfs}
\usepackage{graphicx}
\usepackage{amsthm}
\title{Calculus}
\author{Anon}
\begin{document}
\maketitle
\chapter{Chapter title} 

Expression: $\int x^2  dx$
\end{document}

note also blank line after \chapter, for some reason paragraph wasn't created here, which resulted in non-valid e-pub file. So we make explicit paragraph here.

Using the .mk4 file from the linked question, I've got correct result:

enter image description here

  • Not working for me with those changes. e-Pub resulting with no images :/ – Danowsky Oct 22 '15 at 22:50
  • @Danowsky and do you see image in tex4htExamplech1.html? It is also possible that your ePub viewer doesn't support svg images – michal.h21 Oct 22 '15 at 22:52
  • No, I don't see it either in the .html. Actually, I opened the ePub with Sigil in addition to my ePub viewer. – Danowsky Oct 22 '15 at 23:00
  • are you doing this in Linux? I use Mac, but I don't know if that can be related. – Danowsky Oct 22 '15 at 23:02
  • In output.txt (line 336) looks like a message from Make4ht: Unsupported output format svg – Danowsky Oct 22 '15 at 23:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.