1

The test code:

\documentclass{amsart}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{fadings}

\DeclareMathOperator\Spec{Spec}
\newcommand\Z{\mathbb Z}
\newcommand\OO{\mathcal O}

\begin{document}

\begin{figure}
\centering

\begin{tikzpicture}[auto]
\draw[->, very thick] (-1,0) -- (-1,5);
\draw[->, very thick] (0,-1) -- (5,-1);
\draw (6,-1) node {$\Spec \OO_{C^\flat}$};
\draw (-1,5.2) node {$\Spec \Z_p$};
\draw[very thick, color=red] (0,0) -- (0,5);
\draw[thick] (0,0) -- (5,0);
\draw[very thick, color=green] (0,0) -- (3.55,3.55);
\draw[color=red] (1,3.5) node {$\mathrm{crystalline}$};
\draw[color=red] (1,4.1) node {$\Spec W(k)$};
\draw[dashed] (0,5) arc [start angle=90, end angle=0, radius=5];
\draw[inner color=blue, color=white] (4,0) circle [radius=.4];
\draw[color=blue] (4,-.6) node {$\Spec W(C^\flat)$};
\draw[color=blue] (4,0.75) node {$\mathrm{\acute{e}tale}$};
\draw[color=green] (32:3.5) node {$\Spec \OO_C$};
\draw[color=green] (30:2.6) node {$\mathrm{de~Rham}$};
\end{tikzpicture}

\caption{A picture of some parts of $\Spec A_{\inf}=``\Spec \OO_{C^\flat}\times \Spec \Z_p"$.}\label{fig:Ainf}
\end{figure}

\end{document}

The result of tex4ebook, as far as I see, the nodes vanish. I wonder a workaround for this. Thanks!

2

The TikZ driver for tex4ht doesn't support many more complicated features, especially regarding to the node contents. It is safer to use the alternative driver, which uses Dvisvgm for the SVG creation and it keeps much more details. After installation of the alternative driver, add the following code before \usepackage{tikz}:

\ifdefined\HCode
  \def\pgfsysdriver{pgfsys-dvisvgm4ht.def}
\fi 

This is the result: enter image description here

  • Is there any method to put the code about HCode somewhere (say, create a .4ht file) instead of modify the tex source code directly? – Yai0Phah Apr 24 at 12:13
  • @Yai0Phah you can put it to another TeX file and include the main unmodified TeX file using the \input command. – michal.h21 Apr 24 at 12:36

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.