Closed eposse closed 1 month ago
Tested on macOS 13.6.5, dvisvgm v3.2.2 automatically detects ghostscript v10.03.0 installed by Homebrew. No LIBGS
environment variable nor --libgs
option is needed.
Thank you @muzimuzhi for testing this. I still don't have access to a Mac and can't provide much help.
Option --libgs
and variable LIBGS
probably don't work because of the more strict security measures introduced in recent macOS versions. That's why path /usr/local/lib
is now hardcoded in dvisvgm to lookup the GS library on Mac. Maybe Sonoma introduced even more restrictions that prevent loading the library. That would have to be investigated by someone on a corresponding system, though.
Ok, I did a bit more experimenting, and I have now some success.
First, I tried installing dvisvgm with MacPorts (I don't have Homebrew, and it's a bad idea having both Homebrew and MacPorts installed at the same time). It looks like this version comes with the Ghostscript library statically linked:
dvisvgm -V1
dvisvgm 3.1.2 (x86_64-apple-darwin23.2.0)
-----------------------------------------
brotli: 1.1.0
clipper: 6.2.1
freetype: 2.13.2
Ghostscript: 10.03.0
kpathsea: 6.3.5
mutool: 1.23.11
potrace: 1.16
xxhash: 0.8.2
zlib: 1.3.1
Note that it is older than the version included by MacTeX, which is 3.2.2.
But when I ran dvisvgm, I got a lot of kpathsea errors:
dvisvgm hello.dvi
warning: kpathsea: /opt/local/share/texmf-local/ls-R: No usable entries in ls-R.
warning: kpathsea: See the manual for how to generate ls-R.
warning: kpathsea: /opt/local/etc/texmf/ls-R: No usable entries in ls-R.
warning: kpathsea: See the manual for how to generate ls-R.
warning: kpathsea: /opt/local/var/db/texmf/ls-R: No usable entries in ls-R.
warning: kpathsea: See the manual for how to generate ls-R.
warning: kpathsea: /opt/local/share/texmf/ls-R: No usable entries in ls-R.
warning: kpathsea: See the manual for how to generate ls-R.
warning: kpathsea: /opt/local/share/texmf-texlive/ls-R: No usable entries in ls-R.
warning: kpathsea: See the manual for how to generate ls-R.
WARNING: map file ps2pk.map not found
WARNING: map file pdftex.map not found
WARNING: map file dvipdfm.map not found
WARNING: map file psfonts.map not found
WARNING: none of the default map files could be found
pre-processing DVI file (format version 2)
WARNING: PostScript header file tex.pro not found
WARNING: PostScript header file texps.pro not found
WARNING: PostScript header file special.pro not found
WARNING: PostScript header file color.pro not found
PostScript error: undefined in TeXDict
Apparently that version of dvisvgm doesn't play well with the TeXlive version installed by MacTeX, as the tree structures are in different directories, usually under /usr/local/
whereas MacPorts installs on /opt/local
.
I started to try to do symlinks from the expected /usr/local/
TeX folders to the ones in /opt/local/
but realized that the directory structure doesn't match, so that would be a bit of a mess.
Instead, I installed the minimal variant of texlive provided by MacPorts, and that works. Well, it performs the conversion without errors, and even produces the correct output for a TikZ picture, but the output is not exactly as I expected. Nevertheless, that's a separate issue.
So the workaround is not to use MacTeX, but use either the MacPorts or the HomeBrew versions of TeX and dvisvgm.
Since the issue seems to be solved with a workaround, I'm closing this ticket. Feel free to reopen it if necessary.
I've ran into the same problems reported in Issues #66, #143, and #157, and also looked at issue #197, but I still get the same error message stating that Ghostscript is not found (macOS) when trying to use dvisvgm with a small file generated from latex:
See attached file at the end.
This happens even after setting
LIBGS
:or using the
--libgs
command-line option.But I get the same result.
Following the FAQ instructions, I can verify this:
so Ghostscript is enabled, which according to the FAQ, means that the library should link at runtime. But
So no
Ghostscript
there.And no
ps
here either.This is dvisvgm that was bundled with MacTeX 2024. When installing it I made sure to install Ghostscript and its libraries:
I even tried manually adding
/usr/local/lib
toLD_LIBRARY_PATH
,DYLD_LIBRARY_PATH
andDYLD_FALLBACK_LIBRARY_PATH
without effect.Why is dvisvgm not detecting the library?
I'm on macOS Sonoma 14.4.1.
The source LaTeX file is here: hello.txt. I changed the extension to
.txt
as it didn't allow me to upload a.tex
file.GitHub won't let me upload the
.dvi
file, but I generated it from the file above with(after renaming
hello.txt
tohello.tex
, of course).I appreciate any help. Thanks.