michal-h21 / make4ht

Build system for tex4ht
132 stars 15 forks source link

Multiple tikzpicture calls in one paragraph #71

Closed danielezambelli closed 9 months ago

danielezambelli commented 2 years ago

Hello!

I have encountered a new problem with tikz.

If I run tikzpicture in different paragraphs everything works as I expect, however if multiple tikzpictures are run in the same paragraph they are not correctly recognized.

A minimal example: ` \documentclass[10pt,a4paper]{memoir}

\usepackage{tikz} \usetikzlibrary{ arrows, arrows.meta, matrix,}

\newcommand{\vectAB}[7][black]{% Vettore con etichette agli estremi. % Syntax: \vectAB[parametri]{pi}{pf}{posni}{nomei}{posnf}{nomef} % Example: % \vectAB[green]{(8, 0)}{(12, 6)}{below left}{A}{above left}{B} \begin{tikzpicture}[x=5mm, y=5mm, smooth] \draw [->, #1] #2 node [#4]{$#5$} -- #3 node [#6]{$#7$}; \end{tikzpicture} }

\begin{document} \vectAB[blue]{(8, 0)}{(12, 6)}{below left}{A}{above left}{B}

\vectAB[red]{(8, 0)}{(12, 6)}{below left}{C}{above left}{D}

\vectAB[blue]{(8, 0)}{(12, 6)}{below left}{E}{above left}{F} \vectAB[red]{(8, 0)}{(12, 6)}{below left}{G}{above left}{H} % Error

\end{document} ` tikzpicture.txt

Thanks for your attention.

Daniele

michal-h21 commented 2 years ago

I get a correct result with current dvisvgm4ht driver. This version is also included the development version of PGF, but it seems that the version on CTAN doesn't include these fixes, and it fails for multiple pictures in the paragraph.

So the solution is to use https://github.com/michal-h21/dvisvgm4ht until PGF get an update in TeX distributions.

danielezambelli commented 2 years ago

Thanks!