auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX-devel] This ascender bug in dvipng mode...


From: Jan-Åke Larsson
Subject: Re: [AUCTeX-devel] This ascender bug in dvipng mode...
Date: Mon, 04 Apr 2005 21:36:12 +0200
User-agent: Debian Thunderbird 1.0 (X11/20050116)

David Kastrup wrote:
Well, actually I think that

7{currentfile token not{stop}if 65781.76 div

should be a dead giveaway if you find a way to search for it
efficiently.  It fishes 7 numeric tokens from the PostScript file
itself and converts them into TeX units.  I think this has always been
in this form in preview-latex.

Correct. And the code just after this snippet has changed. dvipng now
tests for "!userdict" followed by
"7{currentfile token not{stop}if 65781.76 div", in addition to
"!(preview version-string)" followed by "(tightpage)"

The previous test used a long string, which should match the \special
exactly. I suppose (given my minimal Postscript knowledge) that the
following might give the "right" Postscript:

   \special{!(}
\special{!userdict begin/bop-hook{7{currentfile token not{stop}if 65781.76 div DVImag mul}repeat 72 add 72 2 copy gt{exch}if 4 2 roll neg 2 copy lt{exch}if dup 0 gt{pop 0 exch}{exch dup 0 lt{pop 0}if}ifelse 720 add exch 720 add 3 1 roll 4{5 -1 roll add 4 1 roll}repeat <</PageSize[5 -1 roll 6 index sub 5 -1 roll 5 index sub]/PageOffset[7 -2 roll [1 1 dtransform exch]{0 ge{neg}if exch}forall]>>setpagedevice//bop-hook exec}bind def end}
   \special{!)pop}

But that depends on what dvips does to the specials, I guess. In any
case, the string in the middle special is the one used by dvipng<=1.5 to
identify tightpage mode. Any newlines in the string, generated by mail transfer should be single spaces.

I have prepared for the release, but I'll wait until I get a "go" from
you. I might want to add code to avoid "ignored header" messages for the surrounding "(...)pop" if you decide to use the above approach.

/JÅ




reply via email to

[Prev in Thread] Current Thread [Next in Thread]