help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: preview-latex: frob line lengths?


From: David Kastrup
Subject: Re: preview-latex: frob line lengths?
Date: 10 Dec 2002 13:59:07 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Sven Utcke <utcke+news@informatik.uni-hamburg.de> writes:

> David Kastrup <David.Kastrup@t-online.de> writes:
> 
> > The other frequent "unreasonable" complaint (i.e., technically
> > infeasible and not really possible), namely that equation and section
> > numbers for regenerated previews should not be arbitrary, 
> 
> My main complaint about preview LaTeX :-)
> 
> > I have just fixed in the latest CVS release: using a checkbox on
> > preview-required-option-list's `counters' option will fix that.
> 
> How is it done (or maybe it simply omits the number?)?

The LaTeX style is called with a special "counters" option that
outputs all changes of counters (they all get registered in cl@@ckpt
or so) at "checkpoints" which in this case are the start and end of
any preview.

Here is the relevant file, somewhat shortened:

Attachment: txtZcbdFZOeeF.txt
Description: Extract from prcounters.def

As you can see, as customary with preview-latex, a combination of a
bit of TeX trickery solves a complex problem right where it originates.

So you are likely to catch changes in those counters that would
interest you.  Those counter settings are written out to the error
log, and preview-latex records them together with its other error
analysis.  When you now preview a region, the next checkpoint starting
from the start of the region backwards is searched for, and the
counters are set to the value of this checkpoint.  This will not work
before the first preview in a buffer, so in particular it will not
work with C-c C-p C-b; maybe one should then search forward for a
checkpoint so as to be able to insert stuff at the front of a buffer
that is included not as first part in the main document.

(Ok, I'll just do that, just be patient for an hour).

This will impact the speed of the initial full-document run a bit, of
course, but since this is mostly a one-time expense and interactive
work usually mostly deals with much smaller regions, people won't mind
much, I hope.  It will also cause Emacs to exit and restart slightly
slower when you are using the desktop.el package, since then the
previews get saved and restored along with the counter information.

Anyhow, also because the next release will be mostly bugfix related,
the option is not checked by default, LaTeX does not generate the
messages, they don't lower the speed of parsing and the rest of the
operation.

It's performance impacting only if requested, the standard
preview-latex philosophy.

Should be available in 0.7.6, the next release.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

reply via email to

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