我按照另一个问题使用 用 Latex 生成带有 SVG 图像的 ePub(我不想使用 ePub 3.0)tex4ebook
,但是生成的 epub 没有图片。
我已经找到了这个问题我有这个包dvisvgm
。但是我仍然有同样的问题。
这是我的.tex
文件:
\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}
配置文件myconfig.cfg
:
\Preamble{xhtml,pic-align,pic-m,}
\Configure{Picture}{.svg}
\makeatletter
\Configure{graphics*}
{svg}
{
{\Configure{Needs}{File: \[email protected]}\Needs{}}
\Picture[\csname a:GraphicsAlt\endcsname]{\csname Gin@base\endcsname.svg
\csname a:Gin-dim\endcsname}
}
\begin{document}
\EndPreamble
我尝试过使用和不使用.mk4
上一个问题中提到的文件,但得到的结果相同。
我使用命令tex4ebook -c myconfig.cfg tex4htExample.tex
编辑:
在虚拟机上安装了 Ubuntu,并使用 安装了 Texlive,sudo apt-get install texlive-full
然后安装了tex4ebook
。我运行了相同的命令,没有出现任何错误,但结果仍然没有任何 SVG 文件。我在 iBooks、Sigil 和 Adobe Digital Editions 中打开了 ePub,它们都没有显示表达式应该在的位置的图像(或不存在的图像)。
这是调用 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
在 epub 的源代码中,我可以看到它正在尝试打印图像tex4htExample0x.svg
,但图像并不存在。
如果我运行命令并保存输出如下:
tex4ebook -c myconfig.cfg tex4htExample.tex > linuxterminal.log
在 Linux 上,我在屏幕上看到了这个输出,但没有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
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
我其实不知道这是否相关。试图找到一些线索。
为了以防万一,终端输出。
答案1
当我执行您的示例时,我遇到了一些与graphicx
包相关的错误。这是因为文件graphicx
中使用了一些内部宏.cfg
。包含graphicx
包有所帮助。
修改后的文件如下所示:
\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}
还请注意后面有一个空行\chapter
,由于某种原因,此处未创建段落,导致 e-pub 文件无效。因此我们在此处创建了明确的段落。
使用.mk4
链接问题中的文件,我得到了正确的结果: