all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <David.Kastrup@t-online.de>
Subject: Re: preview-latex: frob line lengths?
Date: 10 Dec 2002 13:59:07 +0100	[thread overview]
Message-ID: <x5fzt6f2sk.fsf@lola.goethe.zz> (raw)
In-Reply-To: vd0isy2ozkn.fsf@kogs31.informatik.uni-hamburg.de

[-- Attachment #1: Type: text/plain, Size: 828 bytes --]

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 #2: Extract from prcounters.def --]
[-- Type: text/plain, Size: 569 bytes --]

%%
%% This is file `prcounters.def',
%% generated with the docstrip utility.

[...]

\def\pr@eltprint#1{\expandafter\@gobble\ifnum\value{#1}=0%
  \csname pr@c@#1\endcsname\else\relax
  \space{#1}{\arabic{#1}}\fi}
\def\pr@eltdef#1{\expandafter\xdef
  \csname pr@c@#1\endcsname{\arabic{#1}}}
\def\pr@ckpt#1{{\let\@elt\pr@eltprint\edef\next{\cl@@ckpt}%
  \ifx\next\@empty\else\typeout{Preview: Counters\next#1}%
  \let\@elt\pr@eltdef\cl@@ckpt\fi}}
\g@addto@macro\pr@ship@start{\pr@ckpt:}
\g@addto@macro\pr@ship@end{\pr@ckpt.}
\endinput
%%
%% End of file `prcounters.def'.

[-- Attachment #3: Type: text/plain, Size: 1671 bytes --]


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

[-- Attachment #4: Type: text/plain, Size: 151 bytes --]

_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnu-emacs

  reply	other threads:[~2002-12-10 12:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-06 14:42 preview-latex: frob line lengths? Kai Großjohann
2002-12-10  9:33 ` David Kastrup
2002-12-10 11:58   ` Sven Utcke
2002-12-10 12:59     ` David Kastrup [this message]
2002-12-13 16:08   ` Kai Großjohann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=x5fzt6f2sk.fsf@lola.goethe.zz \
    --to=david.kastrup@t-online.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.