From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.help Subject: Re: preview-latex: frob line lengths? Date: 10 Dec 2002 13:59:07 +0100 Organization: T-Online Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <843cpbb457.fsf@lucy.cs.uni-dortmund.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1039526114 12564 80.91.224.249 (10 Dec 2002 13:15:14 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 10 Dec 2002 13:15:14 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18LkEA-0003Fw-00 for ; Tue, 10 Dec 2002 14:15:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18Lk4s-0006BN-01 for gnu-help-gnu-emacs@m.gmane.org; Tue, 10 Dec 2002 08:05:34 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed.news.nacamar.de!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 88 Original-X-Trace: news.t-online.com 1039525147 04 30961 loJLExjXSTA94u 021210 12:59:07 Original-X-Complaints-To: abuse@t-online.com X-Sender: 520018396234-0001@t-dialin.net X-Face: 2FEFf>]>q>2iw=B6,xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN;i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Original-Xref: shelby.stanford.edu gnu.emacs.help:107936 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:4476 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:4476 --=-=-= Sven Utcke writes: > David Kastrup 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: --=-=-= Content-Disposition: attachment Content-Description: Extract from prcounters.def %% %% 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'. --=-=-= 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 --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://mail.gnu.org/mailman/listinfo/help-gnu-emacs --=-=-=--