# Tex file to HTML conversion

I tried to convert multiple .tex files, but I'm having problems with it, I tried htlatex, pandoc, latex2html, but none of them have worked. The one who at least show signs of success was using the command "htlatex" on prompt, but after some time it shows

\pgfcomp-version-0-65.sty"
! Undefined control sequence.
\pgfsys@svg@newline ->\Hnewline

l.190   \pgfusepathqfill}

?


When I try to type something, it shows:

Type <return> to proceed, S to scroll future error messages,
R to run without stopping, Q to run quietly,
I to insert something, E to edit your file,
1 or ... or 9 to ignore the next 1 to 9 tokens of input,
H for help, X to quit.


But I don't know what I should do.

Notes: It's a main file which call the others with de input command and it is full of math formulas and graphs. I'm using Miktex/texStudio. After that conversion I want to convert again to EPUB, AZW3, etc...

Sorry for my english and Thanks for the help

• Welcome to TeX.SX! Please add a minimal but complete example document to the question that produces the error. Without seeing your actual code, it's hard to guess what could be the problem. Also, what went wrong when trying the other tools? Nov 11 '18 at 3:10
• Nov 22 '18 at 3:00

If you want to use tex4ht, don't use the htlatex command, use make4ht instead. It has much more features and fixes some common issues.

The issue you got is a known bug in Tikz which is still not patched unfortunately. The fix is to save the following code as pgfsys-tex4ht-alt.def:

\input pgfsys-tex4ht.def
\def\pgfsys@svg@newline{^^J}


It needs to be requested in the document using the following code in the preamble?:

\ifdefined\HCode
\def\pgfsysdriver{pgfsys-tex4ht-alt.def}
\fi


Another possibility is to use the TikZ externalization, which is bit more complicated, but the resulting images are best. See this post for details.

• This solution doesn't work with a tikz cd environment within an equation environment such as$$\begin{tikzcd} y(U\cap V) \arrow[rd, "f_y"]\\ U\cap V\subseteq M \arrow[r, "f"] \arrow[d,"x"'] \arrow[u,"y"]& \mathbb{R}.\\ x(U\cap V) \arrow[ru,"f_x= f_y\circ y\circ x^{-1}"'] \end{tikzcd}$$ Nov 26 '18 at 0:35
• Do you know how to make such a code work? Nov 26 '18 at 0:36
• @IvánMauricioBurbano could you please post it as another question with full compilable document? it should be possible, I hope. Nov 26 '18 at 7:52