[tex4ht] Problems generating svg when tikz is involved with tex4ht
Nasser M. Abbasi
nma at 12000.org
Tue Oct 24 07:51:41 CEST 2023
I've been having problems with TL 2023 using tex4ht when
tikz is involved.
The svg images generated are bad according to the browsers.
Here is a MWE taken from 4 years old answer
https://tex.stackexchange.com/questions/488733/what-is-current-status-of-using-tikz-with-tex4ht
When compiling the above code using the command
make4ht --shell-escape -ulm default -a debug foo3.tex 'mathjax,htm'
The output is all mangled and does not display right.
I've put a zip file with everything in it in this folder
https://12000.org/tmp/oct_23_2023/
The zip file is called tikz_problem_with_tex4ht.zip
The tex file is exactly the same from the answer above and
is inside the zip file. Here it is again:
-------------------------
\documentclass[12pt]{article}
% it makes no difference to comment or not
%\ifdefined\HCode
% \def\pgfsysdriver{pgfsys-dvisvgm4ht.def}
%\fi
\usepackage{tikz}
\usepackage{amsmath}
\begin{document}
\begin{tikzpicture}
\coordinate[label =above:$0$, label =below:{$u=0$}] (A) at (0,0);
\coordinate[label =above:$\pi$, label =below:{$u_x=0$}] (B) at (4,0);
\draw (A) -- node[above] {$u_t = k u_{xx} $} node[below] {$f(x)$} ++ (B);
\node at (A)[circle,fill,inner sep=1pt]{};
\node at (B)[circle,fill,inner sep=1pt]{};
\end{tikzpicture}
\end{document}
-----------------------
Could someone please try to compile it and see if they get same
problem? May be there is a problem on my Linux?
Also when I open one svg image generated it says at the top
--------------------------
The old, written in PostScript, PDF interpreter has been removed entirely.
You should cease using -dNEWDPF as it has no effect n
-----------------------------
And when I click on the image the browser says
--------------------------
This page contains the following errors:
error on line 1 at column 1: Document is empty
Below is a rendering of the page up to the first error.
--------------------------
I am on Linux, on Virtual box. Using TL 2023 updated 2 days ago.
I've asked what I think is related to this problem here
<https://tex.stackexchange.com/questions/699129/problem-using-tex4ht-with-algpseudocodex-package-when-adding-indent-guide-lines>
With same bad display from bad svg images. Because the indent lines in
the above package uses tikz.
But Michal is not able to reproduce it on his computer.
Any suggestion what else to try?
Thanks
--Nasser
More information about the tex4ht
mailing list.