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: LaTeX-Fill-Paragraph and inline images Date: 09 Feb 2003 17:37:32 +0100 Organization: T-Online Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <843cmxjvr7.fsf@lucy.is.informatik.uni-duisburg.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 1044808750 17571 80.91.224.249 (9 Feb 2003 16:39:10 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 9 Feb 2003 16:39:10 +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 18huU1-0004ZH-00 for ; Sun, 09 Feb 2003 17:39:09 +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 18huVN-0007o6-00 for gnu-help-gnu-emacs@m.gmane.org; Sun, 09 Feb 2003 11:40:33 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!eusc.inter.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: 45 Original-X-Trace: news.t-online.com 1044808652 02 5390 ZjCfEOUSS6Ah4 030209 16:37:32 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:109987 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:6492 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:6492 "Felix E. Klee" writes: > Kai Großjohann wrote: > >> Therefore, I'm looking for a LaTeX-Fill-Paragraph replacement that > >> breaks lines correctly when inline images are used. Instead of > >> specifying a fill column the user would specify the desired width of > >> paragraphs in pixels or centimeters. This might also be interesting > >> when using variable width fonts instead of fixed width fonts. > > > > Does this problem come from using images, or from using overlays? I > > think it's probably the overlays, but I'm not sure. > > What are overlays? The problem occurs because LaTeX-Fill-Paragraph > formats text according to the underlying source code, it doesn't know > about the inline images. An formatting algorithm that might work would > be something like this: > > 1. Go to the beginning of a paragraph. > 2. Remove all newlines from that paragraph > 3. Set the variable LINE_WIDTH to 0. > 4. Add the width of the next visible entity (single character, inline > image, ...) to LINE_WIDTH. > 5. If LINE_WIDTH > MAX_LINE_WIDTH then > a) In the paragraph add a newline before the last entity processed. > b) Go back one entity. > c) Continue at step 3 unless we're finished with formatting the > paragraph. > else > Continue at step 4. If things were that easy... The intent of the formatting from AUCTeX is to make the source more readable. Are those images part of the source? Debatable. But it may not be a good idea to break things like text math across lines when it can be reasonably avoided, anyway. Your "algorithm" also more or less seems to imply using "entities". AUCTeX not only formats, it also indents. Should it be looking inside of "entities" for that purpose? And so on... Of course, the current interaction (or rather its completely absence) of preview-latex and AUCTeX is not nice in that regard. Would you want to work on it? -- David Kastrup, Kriemhildstr. 15, 44793 Bochum