Closed davidstraka2 closed 3 years ago
I can't really help with Mac specific issues because I don't have access to one. However, as far as I can tell from the missing graphics elements and the positioning errors shown in the screenshots, it's a Ghostscript related issue.
Do you get a warning message from dvisvgm during a conversion that Ghostscript can't be found? Does dvisvgm -V1
list Ghostscript in the output?
Thanks for the fast reply! You're right about the Ghostscript warning (processing of PostScript specials is disabled (Ghostscript not found)
, WARNING: 56 PostScript specials ignored. The resulting SVG might look wrong.
). I ran both latex and dvisvgm commands at once in CI (as I too don't have a Mac myself) and only looked that the job step finished successfully and skimmed through the log file (where there's only latex output and no dvisvgm output, which I didn't realize), so I completely missed the warning, apologies for that.
The dvisvgm -V1
output confirms that:
dvisvgm 2.11.1
--------------
brotli: 1.0.9
clipper: 6.2.1
fontforge: 20160721
freetype: 2.10.4
kpathsea: 6.3.3
potrace: 1.16
xxhash: 0.8.0
zlib: 1.2.11
Weirdly enough, Ghostscript should be installed since MacTeX depends on it (https://formulae.brew.sh/cask/mactex) and the CI output includes
==> Installing ghostscript
==> Pouring ghostscript--9.54.0.catalina.bottle.tar.gz
🍺 /usr/local/Cellar/ghostscript/9.54.0: 683 files, 149MB
while installing MacTeX using Homebrew.
Perhaps it's not present in PATH and needs to be added? Though that's somewhat confusing to me, since on my Windows 10 there's no Ghostscript in PATH and dvisvgm works fine.
Ok, good to hear that it's "only" a Ghostscript issue. If Ghostscript is not linked to the dvisvgm binary, dvisvgm tries to dlopen the GS library when needed which makes the dynamic linker look for it in its search path. Maybe the GS package from Homebrew doesn't update the ld search path and therefore dvisvgm can't find the file. You can use environment variable LIBGS
or command-line option --libgs
to specify the absolute path of the library file.
Got it. I also just found the "Why is dvisvgm’s PostScript support disabled on my machine?" in the FAQ, which explains it nicely. Thanks for your help!
When an SVG image is generated from a DVI document containing TikZ output, the resulting SVG is missing any shapes but the text, and all the text is aligned to the top of the image with characters overlapping. This is happening specifically on macOS; on Windows and Linux everything seems to be working.
Software versions used: macOS 10.15.7, MacTeX 2021.0328 (comes with dvisvgm 2.11.1)
Commands used:
latex image.tex
dvisvgm --no-fonts image.dvi
The DVI file generated seems to not be the issue, since when the DVI file generated on macOS is copied over to Windows 10 and then the Windows version of dvisvgm (the one included in texlive) is used on that file, the resulting SVG is fine.
TeX source of a simple reproducible example:
For a comparison of two versions (ok Windows version and broken macOS version) of a more complex SVG (not the one in the simple example above), see the image below.
A GitHub Actions workflow to generate outputs on macOS and upload job artifacts: