[tex4ht] [Pgfplots-features] pgfplots creation of two SVGs, inclusion of wrong one in html

Christian Feuersaenger cfeuersaenger at googlemail.com
Wed Sep 14 22:21:03 CEST 2011

Hi Johannes,

you are a fast write, I see :)

Yes, you did send me your script thanks! I will copy it now to keep a 
reference at hand.

You are right, results are not perfect. In fact, I tried another example 
and stumbled over problems with math mode inside of nodes -- in these 
case, the SVG contains − which appears to be bad. Unfortunately, 
the tikz driver can no longer produce mathml (the '/tikz/tex4ht 
node/escape=true' switch does not seem to work) which should probably 
fix it!?

Do you know a solution for this problem? Interestingly, your examples 
works produces a legend (which is partially correct) when I provide
\tikzset{/tikz/tex4ht node/escape=true,every node/.style={tex4ht 
after \begin{document}. But the other nodes appear to be broken. Very 
strange all that.

I haven't heard anything about a tool which produces correct SVG output 
of tikz, no. But that does not mean anything, I admit - I haven't 
followed much about tex4ht development recently. I would just like it to 
work with reliably. If they managed to fix the tex4ht driver of tikz, 
that would probably be a good patch for tikz.

Best regards


Am 14.09.2011 22:08, schrieb Johannes Wilm:
> Hey,
> that sounds really good. The final SVG is still not perfect though -- 
> the legend is not drawn for example, and the SVG is not alrge enough 
> to contain all the text.
> I did send you the link to my spaghetti-code work-around script, right?
> http://dl.dropbox.com/u/5518978/latex2compile
> Whatever happened to the effort for perfect tikz -> SVG conversion 
> that was supposed to come out within a few weeks? Have you heard more 
> about that?
> On Wed, Sep 14, 2011 at 1:35 PM, Christian Feuersaenger 
> <cfeuersaenger at googlemail.com <mailto:cfeuersaenger at googlemail.com>> 
> wrote:
>     Hi Johannes,
>     a couple of months ago, you reported a problem with SVG output of
>     pgfplots: there have been TWO SVG rather than one per figure.
>     Although I assume that the issue is no longer important for you,
>     you may be interested in the following news:
>     I am currently working on a prototype which allows pgfplots to
>     save one temporary pgf node - and this node was the cause for the
>     outer SVG. I have just ran an experiment with
>     htlatex testXXX.tex
>     on your example. I only uncommented some of your \HCode
>     instructions and added my new feature 'cell picture=false' to the
>     option list and got the attached results (just one SVG).
>     Best regards
>     Christian
>     Am 27.07.2011 03 <tel:27.07.2011%2003>:04, schrieb Johannes Wilm:
>         Hi again,
>         sorry for cross-posting. I am not quite sure whether this
>         falls into the expertise of one or the other group.
>         The attached is a test case of a document which includes a
>         graph I've created with pgfplots and then converted to html
>         using tex4ht. I fixed the SVG-output with the script I
>         recently mailed around.
>         The problem is this: There is only one graph. Yet for some
>         reason 2 SVG files are created. The second SVG-file seems to
>         just be empty, whereas the first one includes the graph. For
>         some reason the HTML-code that is being output only includes
>         the second, empty, SVG-file.
>         This is what I ran:
>         /dvilualatex test.tex
>         dvilualatex test.tex/
>         /dvilualatex test.tex/
>         /tex4ht -f/test.tex/
>         /t4ht -f/test.tex/
>         /fix_svg_legend.py test-1.svg/
>         /fix_svg_legend.py test-2.svg/
>         Obviously I could make a script that simply exchanges all
>         occurrences of "test-2" with "test-1" and so on. But
>         strangely, when the legend is in a separate svg, the legend
>         works fine, so the numbering wouldn't work out that way.
>         I believe this is my very last issue with the whole setup. So
>         if it cannot be resolved, I'll spend another day on a quick
>         fix rather than trying to switch tools as some have
>         recommended I do.
>         Sincerely,
>         -- 
>         Johannes Wilm
>         http://www.johanneswilm.org
>         tel: +1 (520) 399 8880 <tel:%2B1%20%28520%29%20399%208880>
>         ------------------------------------------------------------------------------
>         Got Input?   Slashdot Needs You.
>         Take our quick survey online.  Come on, we don't ask for help
>         often.
>         Plus, you'll get a chance to win $100 to spend on ThinkGeek.
>         http://p.sf.net/sfu/slashdot-survey
>         _______________________________________________
>         Pgfplots-features mailing list
>         Pgfplots-features at lists.sourceforge.net
>         <mailto:Pgfplots-features at lists.sourceforge.net>
>         https://lists.sourceforge.net/lists/listinfo/pgfplots-features
> -- 
> Johannes Wilm
> http://www.johanneswilm.org
> tel: +1 (520) 399 8880

More information about the tex4ht mailing list