I am having troubles making make4ht working with Tikz pictures. My computer is a Mac M1 Sonoma 14.2.1, I have TeX Live 2024 and Ghostscript 10.03.0 on my computer:

lualatex --version
This is LuaHBTeX, Version 1.18.0 (TeX Live 2024)

gs --version

I read the following posts, but unfortunately could not solve my problem:

  1. Why is dvisvgm’s PostScript support disabled on my machine? https://dvisvgm.de/FAQ/
  2. 'dvisvgm' doesn't detect 'libgs' with MacTex 2023 and 'libgs' installed - MacOS 12.7.2 (Monterey)

So, when I run dvisvgm -V1, I do not have gs support:

dvisvgm -V1
dvisvgm 3.2.2 (aarch64-apple-darwin20.6.0)
brotli:   1.1.0
clipper:  6.2.1
freetype: 2.13.2
kpathsea: 6.4.0
mutool:   1.23.11
potrace:  1.16
xxhash:   0.8.2
zlib:     1.3.1

echo $LIBGS

It seems that this problem has recently been reopened on GitHub: https://github.com/mgieseki/dvisvgm/issues/267

Has anyone found a solution to this without using MacPorts? I have Homebrew, and I do not want to have another package manager.

Here is the MWE that shows the problem (taken from TeX4ht and Tikz missing Ghostcript):



\section*{Tikz picture}
    \coordinate[label =above:$0$,   label =below:{$u=0$}] (A) at (0,0);
    \coordinate[label =above:$\pi$, label =below:{$u_x=0$}] (B) at (4,0);

    \draw (A) -- node[above] {$u_t = k u_{xx} $}  node[below] {$f(x)$} ++ (B);

    \node at (A)[circle,fill,inner sep=1pt]{};
    \node at (B)[circle,fill,inner sep=1pt]{};


which is saved in test.tex and I compile with:

make4ht --lua test.tex "mathml, mathjax" 

(Note that lua is useless for this test, but I will need it for my real case). I get:

[STATUS]  make4ht: Conversion started
[STATUS]  make4ht: Input file: test.tex
pre-processing DVI file (format version 2)
processing of PostScript specials is disabled (Ghostscript not found)
processing page 2
  WARNING: 115 PostScript specials ignored. The resulting SVG might look wrong.
  graphic size: 46.321112pt x 10.949997pt (16.280009mm x 3.848484mm)
  output written to test0x.svg
1 of 3 pages converted in 0.209179 seconds
[STATUS]  make4ht: Conversion finished

If I use the driver pgfsys-dvisvgm.def instead of pgfsys-dvisvgm4ht.def, then it compiles but the output picture is not correct. Note that the drivers are up to date. Lastly, I tried the tricks from Making dvisvgm and Ghostscript from MacTeX talk to each other, but it did not work either.

  • The latest versions of macOS introduced several restrictions regarding the dynamic loading of libraries. The paths of the required libraries must be hard-coded in the code of applications like dvisvgm. Specifying the path with LIBGS or --libgs doesn't work any longer on Mac. dvisvgm currently looks for libgs in /usr/local/lib. If it's located in a different directory, macOS prevents loading it.
    – Martin
    Commented Apr 20 at 20:15
  • @Martin I have the dynamic library in the /usr/local/lib: readlink -f /usr/local/lib/libgs.dylib, which returns /usr/local/share/ghostscript/10.03.0/lib/libgs.dylib.10.03. Is it a problem that it is not the lib per se, but a link in /usr/local/lib?
    – mistral
    Commented Apr 21 at 7:16
  • I'm not a Mac user, so I don't really know, what kind of restrictions have been added to macOS. However, dvisvgm looks for /usr/local/lib/libgs.dylib.N and (alternatively) /usr/local/lib/libgs.N.dylib where N is the ABI version of the library (10 at the moment). You could try to create a symlink /usr/local/lib/libgs.dylib.10 pointing to the actual library and check if it works. If it doesn't work, macOS probably prohibits the loading of dylibs via symlinks across directory boundaries. In this case, the actual library files need to located in /usr/local/lib.
    – Martin
    Commented Apr 21 at 9:47
  • You can try to use the tikz+ option: make4ht --lua test.tex "mathml,mathjax,tikz+". It uses a different TikZ driver instead of dvips, so it could work in your case. It has some issues, but it seems to work for your MWE on my system.
    – michal.h21
    Commented Apr 21 at 10:54

1 Answer 1



what worked for me was actually to copy the dynamic library file to /usr/local/lib/, a link did not work (thank you to @Martin for pointing out this solution in the comments).

Given I used Homebrew to install Ghostscript 10.03.0, it gives the following command:

sudo cp /opt/homebrew/Cellar/ghostscript/10.03.0/lib/libgs.dylib /usr/local/lib

Every time a new version of Ghostscript is installed I will have to copy the new version of the lib...

I also added /usr/local/lib/ to my PATH.

Now dvisvgm -V1 returns:

dvisvgm 3.2.2 (aarch64-apple-darwin20.6.0)
brotli:      1.1.0
clipper:     6.2.1
freetype:    2.13.2
Ghostscript: 10.03.0
kpathsea:    6.4.0
mutool:      1.23.11
potrace:     1.16
xxhash:      0.8.2
zlib:        1.3.1

You must log in to answer this question.

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