1

I'm trying to use TeX4ht with Tikz and running into problems. Here's my minimal example

\documentclass{article}
\ifdefined\HCode
\def\pgfsysdriver{pgfsys-dvisvgm4ht.def}
\fi
\usepackage{tikz}
\begin{document}
This is a test
\begin{tikzpicture}
  \draw (0,0) -- (1,1);
\end{tikzpicture}
\end{document}

The output html file shows a missing graphic image.

I'm using TeXLive 2021 on a Mac, installed with MacTeX, and using TeXShop 5.0.

The command I use is "make4ht myfile.tex" (not including the quotation marks.

The make4ht messaging show the warnings

--- warning --- Improper groups in \special{t4ht+}... idv[2]
processing of PostScript specials is disabled (Ghostscript not found)
pre-processing DVI file (format version 2)
processing page 2
  DVI error: stack not empty at end of page

I suspect the main issue is "missing Ghostscript" but I have Ghostscript installed. I can run it from the command line with "gs" or "rungs". In fact it's installed in two locations, once via homebrew at /opt/homebrew/bin/gs and once via a bundle with TeXShop at /usr/local/bin The latter is also linked to via a symbolic link contained in /Library/TeX/texbin.

I've tried creating a config file for make4ht that has various combinations of \Configure{Ghostscript}{rungs} or \Configure{Ghostscript}{/opt/homebrew/bin/gs} etc., but can't get rid of the Ghostscript not found error.

Any advice?

4
  • I was able to generate the html page correctly. I am using pdfTeX, Version 3.141592653-2.6-1.40.24 (MiKTeX 22.3) with the package miktex-ghostscript-bin-64 (MikTeX executable for windows x64) installed. Commented Aug 21, 2022 at 18:28
  • Ghostscript is called from dvisvgm when you use the TikZ driver for TeX4ht, so \Configure{Ghostcript} cannot fix that. It is possible that the driver in your distribution is old, you can try to place the current version of the driver to the directory with your document, and try if it fixes this issue. If it fails too, please update your question with the debug log (using make4ht -m draft -a debug myfile.tex)
    – michal.h21
    Commented Aug 21, 2022 at 19:06
  • Thanks for the help. dvisvgm fails to find Ghostscript when I run it from the command line. I will reinstall Ghostscript and follow the steps here tex.stackexchange.com/questions/559640/… and let you know if that works. Commented Aug 21, 2022 at 19:24
  • Sure, that seems like a probable reason. I hope reinstall will help.
    – michal.h21
    Commented Aug 21, 2022 at 19:54

1 Answer 1

1

Thanks to michal.h21!

From the command line dvisvgm couldn't find Ghostscript. More precisely it couldn't find the dynamic libraries. So I followed the steps at Making dvisvgm and Ghostscript from MacTeX talk to each other

  1. Reinstalled Ghostscript, use the customize option to add the libgs dynamic libary
  2. export the environment variable for LIBGS
  3. Download the latest dvisvgm driver that Michael mentioned in his comment. Everything works!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .