On Tuesday 16 July 2002 5:53 pm, David Kastrup wrote:
> The snippet info outputs the exact dimensions of the TeX box.  The
> tightpage option adds additional side bearings to that in order to
> arrive at the PostScript page size so as not to cut off anything that
> might slightly protrude out of the TeX box.  So the total size of the
> graphics is larger by those side bearings, and the ascent ratio is
> also slightly influenced by it.  Probably not more than very few
> pixels at most, if at all.
>
> If I call the tp numbers tp1, tp2, tp3, tp4, and the snippet values
> ht, dp, wd, then we have, strictly speaking,
>
> ascent = max(0,ht,-dp)+tp4
> descent = max(0,-ht,dp)-tp2
>
> The tightpage dimensions can be modified by the user; in that case,
> before the next snippet, the changed values will be printed out in a
> new Tightpage line (the separate prlyx.def that you have had in your
> hands before printed out the tightpage info itself, and just once at
> the start of the document.  Which should not make a difference, as I
> don't think anybody ever fiddled with those settings, least of all in
> mid-document).

Thanks for the clear explanation.

I'll modify the shell script so:
grep  -E 'Preview: [S-T]' 1lyxpreview.log > 1lyxpreview.metrics

and use this .metrics file to perform the calculation within LyX.

cat 1lyxpreview.metrics

Preview: Tightpage -32890 -32890 32890 32890
Preview: Snippet 1 492688 0 744653
Preview: Snippet 2 1441792 163840 16026923
Preview: Snippet 3 282168 0 377591
Preview: Snippet 4 1619363 449545 16026923

If the Tightpage changes, then Ihat will be accommodated automatically.

Angus


Reply via email to