David Kastrup | 11 Oct 2002 18:04
Picon
Favicon

Re: Re: Re: Re: Notes and queries on using preview-latex with LyX

Angus Leeming <a.leeming <at> ic.ac.uk> writes:

> David Kastrup wrote: 
> > Just do the check on \mathindent itself: only assign if it is not
> > undefined:
> > \ifx\mathindent\undefined \else \mathindent=0em \fi
> 
> Perfect!
> 
> The upshot off all this is that I can strip off the left hand margin. 
> Something weird is going on with the right hand margin, however.

Not at all...

> 
> Attached is a small tex file. Dvi file created with
>         latex trial
> 
> Can you spot the differences ;-)
> 
> Interestingly, if I omit the fleqn, mathindent stuff, the behaviour does 
> not change. Ie, dvipng has a bounding box tight to the rhs, but gs does not.
> 
> What I conclude from all this is that the info is their in the dvi
> file but it is being used correctly only by dvipng.

Just the other way round.  The info is there in the dvi file (in the
form of code setting up the postscript paper size), but it is being
used correctly only by GhostScript.  Namely: dvipng has no clue
whatsoever about the TeX dimensions of the box, so it just takes a
look at the marks the characters make.  In contrast, GhostScript (via
the tightpage option) gets its canvas set up to the TeX dimensions of
the box.

And display math, fleqn or not, is paragraph wide material.  Sorry, I
should have mentioned this from the start but its significance has
just escaped me.

Disassembling display math mode material to a depth that would make
it possible to get a tighter box is not possible: I had already once
done to much in that regard (without even getting inside of the
display itself) and this has lead to equation numbers suddenly
jumping to the left of the line.

If you don't want a display, you can always do something like
$\displaystyle ...$.  Text math will give tight boxes.

But frankly, it is my impression that you are on a wrong track.  The
purpose of the previews is to give a rendition of what the output will
be like, so that you do not need a previewer for most viewing
purposes, and all the business with fleqn and shrinking and losing
indentation and placing equation numbers differently is not going to
give that.

We might get dvipng to report a bounding box outside of which it has
not placed any glyphs, but a similar mechanism would not be available
for the fallback via dvips/GhostScript.

--

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Email: David.Kastrup <at> t-online.de

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

Gmane