I would like to convert a scientific book with lots of formulas and tables to epub3
. So far I have read all the posts that are tagged and related to tex4ebook
, tex4ht
etc. and I have managed to produce an epub3
version of my book with the formulas looking ok.
So far my command is:
tex4ebook -f epub3 filename mathml
Now, suppose that my tex has the following tikzpicture (borrowed from here).
\begin{tikzpicture}
% Time axis
\draw (0,0) -- node[below=1cm] {Time $\to$} (6,0);
% Emotional axis
\draw (0,0) -- node[left] {\parbox{2cm}{\centering $\uparrow$ \\ Emotional \\ intensity}} (0,4);
% Time ticks
\foreach \x [count=\j] in {0.2,3,4.5,6} {
\draw (\x,0) coordinate (t\j) -- (\x,-0.1cm) node[below] (tt\j) {Time \j};
}
\node[below] at (tt1.south) {(Emotional event)};
% Curves
\draw (t1) .. controls +(1,2) .. node[above right] {Experienced} (t2);
\draw[dashed] (t1) .. controls +(1,4) .. node[above right] {Predicted} (t4);
\end{tikzpicture}
I am not able (or I do not understand how to do it), to use tex4ebook
to get the epub
to contain the above image. What should I add to the previous command for the tikzpicture
to show? I have succeeded in completing all the instructions in all the relative tex4ebook
StackExchange
tags and be able to produce for example a pdf
with luatex
that contains the above image, but I do not know what to do to make it work with the tex4ebook
command.
Can anyone tell me the steps I have to take? Thank you
tikz
picture somewhere else and using it in your real document by\includegraphics
is a better approach?@Christian + michal
, Thank you both for your replies.@michal
, thank you fortex4ebook
. So do you think externalization should be applied also to figures of this form too?: \begin{figure}[H]\hspace*{\fill}% \begin{game}{2}{2}[$t_1=S$] & $F$ & $NF$\\ $F$ &$1$, -$2$ &$2$, -$1$\\ $NF$ &-$1$, $2$ &$0, 0$ \\ \end{game}\hspace*{10mm}% \begin{game}{2}{2}[$t_1=W$] & $F$ & $NF$\\ $F$ &-$1,1$ &$2$, -$1$ \\ $NF$ &$0, 2$ &$0, 0$\\ \end{game}\hspace*{\fill}% \caption[]{\textit{A game with incomplete information}} \end{figure}%(usingsgame
package).@michal
:Does externalization excludes the usage ofmathml
? If no, how can I use it, cause so far steo 1. is to usepdflatex -shell-escape filename
, 2.htlatex filename myconfig
(I do not know if runninghtlatex filename myxonfig xhtml
makes any improvements). Btw I think there is a bug in your answer for extarnalization:{; inkscape -z -f "\image.pdf" -l "\image.svg"}
should be; inkscape -z -f "\image.pdf" -l "\image.svg"
(just delete the brackets, otherwise the svgs you are producing have an}
appended at their end.