mgieseki / dvisvgm

A fast DVI, EPS, and PDF to SVG converter
https://dvisvgm.de
GNU General Public License v3.0
295 stars 28 forks source link

the depth info is missing when using latex package hyperref #246

Closed c-ding-math closed 10 months ago

c-ding-math commented 10 months ago

I have a tex file test.tex like this:

\usepackage[active,tightpage]{preview}
\begin{document}
\begin{preview}
$A$
\end{preview}
\end{document}

If I use

latexmk -output-format=dvi test.tex
dvisvgm test.dvi

then I get the everything as expected in the stdout:

...
width = ..., height=..., depth=...
...

But when I add the latex package hyperref in the tex file

\usepackage[active,tightpage]{preview}
\usepackage{hyperref}
\begin{document}
\begin{preview}
$A$
\end{preview}
\end{document}

then the width, height and depth info won't show.

mgieseki commented 10 months ago

At the moment, dvisvgm only supports the hypertex mode of the hyperref package. The PS mode can interfere with the processing of the preview data. The following variant should work:

\usepackage[hypertex]{hyperref}
mgieseki commented 10 months ago

I've improved the evaluation of the preview extents so that they are now also recognized if additional PS code interferes with the data.