[tex4ht] SVG figures cause font styling to be lost

Nasser M. Abbasi nma at 12000.org
Mon Jun 1 01:33:28 CEST 2015

I can't tell why it does not work when including the tex
source code for the tikz pic.

But here is a workaround. The result is in a zip with my .cfg included
which is at this link:


I changed your latex file to be to include the image itself
instead of include the tikz code. This means some pre-processing
is needed:


Here \textbf{is} a \texttt{circuit} for \textit{you}.

\begin{figure}[!ht] \centering
\caption{Here \textbf{is} a \texttt{circuit} for \textit{you}.}

Here \textbf{is} a \texttt{circuit} for \textit{you}.

Then made the tikz file to be self contained document:


Then compiled it

pdflatex t_circuit.tex

then convert to svg using

pdf2svg t_circuit.pdf t_circuit.svg

and now build the main tex file using:

make4ht -d html -c nma.cfg my_fig.tex

Now it work. The fonts changes correclty below the image.

The zip file has the .cfg and the generated HTML so you can see the result.

Again, I do not know why it does not work when including the tikz source
code directly.


On 5/31/2015 4:14 PM, Bob Plantz wrote:
> > I use Dwight Aplevich's circuits macros to create drawings, which produces
> > .tex files. htlatex creates great svg files for the drawings. However,
> > after the first such drawing, all font styling (bold, italic, etc.) is lost.
> >
> > I have traced the problem to a switch from <span> to <tspan> in the html
> > code at the point of the first use of svg. Is there a workaround for this
> > bug?
> >
> > I have attached an example. I'm using texlive 2014 in Ubuntu 15.04. The
> > attached example can be expanded with
> >        tar xvfz bobs_figures.tgz
> > Then
> >        cd bobs_figures
> >        htlatex my_fig.tex
> > gives the example.
> >
> > The problem still exists when I use make4ht.
> >
> > --Bob
> >

More information about the tex4ht mailing list