option -depth

Asked by depauw-n

Great thanks for your dvisvgm.
I want to use it to include small math-snippets in web pages.
See example in
http://www.math.sciences.univ-nantes.fr/~depauw/s22m050/build/html/ensembles.html#familles
I need to v-adjust each svg math-snippets, depending of his depth (with respect to baseline).
Would it be possible to mimick the option -depth of dvi2png ?

Question information

Language:
English Edit question
Status:
Answered
For:
dvisvgm Edit question
Assignee:
Martin Gieseking Edit question
Last query:
Last reply:
Revision history for this message
Martin Gieseking (martin-gieseking) said :
#1

Thanks for your suggestion.
Unfortunately, dvi files don't contain any information about text baselines by default so that's not possible to extract reliable depth information. If a file consists of multiple lines of text, a single depth value wouldn't make much sense either.

LaTeX packages, like "preview" can be used to put additional data into the dvi file and this data can be extracted by a dvi driver.
Since a --depth option would only work with this kind of enriched dvi files, I'm a bit reluctant to add it.
However, I might add some code that looks for box information generated by the "preview" package. If it's present, dvisvgm could print it by default together with the page size message.

Revision history for this message
Martin Gieseking (martin-gieseking) said :
#2

I've implemented the evaluation of the bounding box data created by the preview package. If they are present in the DVI file, dvisvgm prints an additional message with the width, height, and depth values to the console.
This feature will be part of the next release 1.4.

Can you help with this problem?

Provide an answer of your own, or ask depauw-n for more information if necessary.

To post a message you must log in.