I have a document with a large number of Tikz pictures and I need to generate a html page from it. I have declared a driver to have TikZ pictures as SVGs (after this question) and run htlatex main.tex
:
\ifx\HCode\UnDef\else\def\pgfsysdriver{pgfsys-tex4ht.def}\fi
However, for some pictures SVGs are correctly generated for some they are not (e.g., TikZ pictures from answers to this question). For most of them, I got XML Parsing Error: mismatched tag error with </text>
mentioned, e.g.:
alt="ExAAel " class="pic-halign" ></text>
Is there any website that would help me to understand which kind of TikZ pictures are supported by htlatex?
UPDATE:
Because of problems with SVG generation, I decided to try to generate pngs. I use tikzexternalize as Andrew Stacey suggested. I am on MacOs so I also needed to install (with macports) poppler to have pdftoppm and pnmtopng. Here is my example document:
\documentclass[11pt,a4paper]{article}
\usepackage{pgf}
\usepackage{tikz}
\usepackage{pgf}
\usetikzlibrary{external}
\tikzexternalize[prefix=figures_external/]
\begin{document}
\tikzset{external/system call={pdflatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource" && pdftoppm "\image.pdf" | pnmtopng > "\image.png"}}
\tikzset{external/figure name={tikz-figure}}
\begin{tikzpicture}
% Picture code
\end{tikzpicture}
\end{document}
Unfortunately I got the following error:
> Package tikz Error: Sorry, the system call 'pdflatex -halt-on-error > -interact ion=batchmode -jobname "figures_external/braids-figure0" "\def\tikzexternalreal > job{example_tikz_external}\input{example_tikz_external}" && pdftoppm > "figures_e xternal/braids-figure0.pdf" | pnmtopng > > "figures_external/braids-figure0.png"' did NOT result in a usable > output file 'figures_external/braids-figure0' (expe cted one of > .pdf:.jpg:.jpeg:.png:). Please verify that you have enabled system > calls. For pdflatex, this is 'pdflatex -shell-escape'. Sometimes it is > also nam ed 'write 18' or something like that. Or maybe the command > simply failed? Error messages can be found in > 'figures_external/braids-figure0.log'. If you continu e now, I'll try > to typeset the picture. See the tikz package documentation for > explanation. Type H <return> for immediate help.
I wonder what could be a reason that the externalize call fails.
\usetikzlibrary{external} \tikzexternalize \tikzset{external/system call={pdflatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource" && pdftoppm "\image.pdf" | pnmtopng > "\image.png"}} \tikzset{external/figure name={braids-figure}}