I am rolling out my own mathview.el (similar to preview.el but aim to be more efficient) package for editing LaTeX in emacs. Currently it uses dvipng but I would like to use dvisvgm as an alternative. Could someone share how they compile dvisvgm with TeX live 2009 installed to /usr/local/texlive/2009?

The reason I am considering using dvisvgm is that text in pngs doesn't look as thick as normal text in emacs buffer. See this image


I am using Snow Leopard 10.6.4. Thanks.


I don't mind if this question is deleted. Basically the header files of kpathsea must be available. But my tl2009 installation is incomplete so I stopped trying. Also dvipng has a --gamma option to change the darkness of the font, which can be adjusted to make images blend better with text in emacs.

  • I can’t help you with compiling on OS X. However, dvisvgm is included in TeX Live 2010, which - as far as I know - should be released “soon“. The pretest should be mostly identical to the final version.
    – Caramdir
    Aug 28 '10 at 18:24
  • Upgrade to tl2010 is too big a change at the moment. But will do that in a few months time. Thanks.
    – Leo Liu
    Aug 28 '10 at 18:28
  • I grabbed dvisvgm from tl2010 which doesn't seem to depend on anything else except those come with Snow Leopard. Sadly the output is inferior to inkscape.
    – Leo Liu
    Aug 28 '10 at 22:42
  • Can emacs display svg? News to me....
    – Dima
    Aug 28 '10 at 23:55
  • 2
    For a long time. It displays svg perfectly; in fact svg has been discussed to be the default image format for emacs.
    – Leo Liu
    Aug 29 '10 at 5:12

dvisvgm cannot be successfully built using the kpathsea library that's installed with TeX Live 2009 on Mac OS X. There are two problems, the first is that the shared library is broken, it cannot be used. This turns out not to be a problem because none of the binaries in the distribution link to the dynamic library. (Someone should fix that; it's probably an artifact of kpathsea using a custom libtool, klibtool, for some reason.) So the dynamic library and its symlink can be safely removed.

The bigger problem is that the kpathsea does not contain kpse_enc_format so the dvisvgm file FileFinder.cpp does not compile. If you comment out the line containing that (essentially preventing dvisvgm from being able to find .enc files), then it builds, but fails make check.

I tried compiling kpathsea myself to see if that would help, but I'm not actually sure how to configure it properly. You have to replace its config.guess and config.sub with newer ones to get it to configure. I'm not really sure how to get it to point at my texmf tree though. I copied the texmf/web2c/texmf.cnf from my tree over the generated one (and fixed up lines ending in \) but after building, the kpsewhich program couldn't find my files.

The best part is that http://mirror.ctan.org/dviware/tkdvi/kpathsea.tar.gz doesn't actually contain kpse_enc_format either; the entire preceding graf was a waste of time. Oh well.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.