Closed ma-chengyuan closed 1 year ago
In TeX 1 in = 72.72 pt = 72 bp, while in SVG 1 in = 72 pt (see SVG spec 1.1, sec. 7.10 Units). Or you can think of 1 SVG pt = 1 TeX bp. Since 1 in = 25.4 mm, 215.9 mm = 8.5 in = 614.295 pt (in TeX) = 612 pt (in SVG). Thus, scaling factor is exactly 1.
Yes, @muzimuzhi is absolutely correct. dvisvgm uses TeX's length units in the message output, i.e. 1pt = 1/72.27 in. SVG's points, however, are slightly bigger. TeX therefore calls them "big points" (1 bp = 1/72 in). SVG, on the other hand, uses the abbreviation pt
rather than bp
, which can lead to some confusion. So, TeX's pt
is not the same as SVG's pt
. That's why the values in the SVG files are smaller by factor 72/72.27.
I am writing a program where I need to clip parts of the svg generated by dvisvgm based on the output of synctex. To do that I need to know how the tex coordinates are mapped to svg coordinates. I observed that dvisvgm seems to shrink the page a little bit in the conversion, i.e.
becomes
Some empirical testing suggests that the scaling factor is about 0.996264. I plugged this in my program as a magic constant but there still seems to be some precision issues. I am very curious about where this shrinking comes from, and, if possible, how exactly does dvisvgm transform the coordinates?
Thanks!