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 10:33:26 +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: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1039512997 1330 80.91.224.249 (10 Dec 2002 09:36:37 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 10 Dec 2002 09:36:37 +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 18Lgoc-0000L3-00 for ; Tue, 10 Dec 2002 10:36:34 +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 18Lgne-0001O7-01 for gnu-help-gnu-emacs@m.gmane.org; Tue, 10 Dec 2002 04:35:34 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!fr.usenet-edu.net!usenet-edu.net!fr.clara.net!heighliner.fr.clara.net!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: 55 Original-X-Trace: news.t-online.com 1039512807 01 20651 DnGLEITVSWY4fo 021210 09:33:27 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:107924 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:4468 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:4468 kai.grossjohann@uni-duisburg.de (Kai Großjohann) writes: > The default setting of preview-latex is to frob inline math, too. I > think I will like it, though after 5 minutes I'm not sure yet :-) > > But if, in the source code there is a line break, like $f(x) = 1 + > 2x + 3x^2 + 4x^4$, then the output will have a long line because the > formula is displayed all in one line. This problem becomes > especially pronounced when I use macros with short names which > produce long formulas. > > Ideas? There are basically two approaches: the insane and the sane one. The insane one is somewhat easier to do but will probably only work with the Emasc port, not the XEmacs one. The insane one would be to "export" newlines within formulas into an after-string of "\n". This would make cursor movements behave _very_ strange though. The sane solution is not to break the line in the first place. There are several ways for that: one is $f(x)=1+2x+3x^2+4x^4$, which obviously does the right thing. The best way probably would be to add a text property to the previews that would cause AUC TeX not to reformat inside of previews when it does paragraph formatting. Even better would be if this property also told AUC TeX how much space the preview takes up. Then AUC TeX could be told to a) format such that the previewed source looks nice/does not wrap b) format such that the original source looks nice/does not wrap c) format defensively such that both previewed and original source do not wrap. This would be done simply by declaring the respective width of the resulting large character as a) the image length b) the source code length c) the maximum of both. It just happens that I am maintainer of AUC TeX also. Contributions in that area would be a killer feature: it is one of the things people are constantly complaining about. One should probably also backport other changes in reformatting from Emacs to AUC TeX (which has its own formatting code). 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, I have just fixed in the latest CVS release: using a checkbox on preview-required-option-list's `counters' option will fix that. > preview-latex really rocks. Help it rock more. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum