From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Felix E. Klee" Newsgroups: gmane.emacs.help Subject: Re: LaTeX-Fill-Paragraph and inline images Date: Sun, 09 Feb 2003 17:23:31 +0100 Organization: (Posted via) INKA e.V. http://www.inka.de/ 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-15 Content-Transfer-Encoding: 8Bit X-Trace: main.gmane.org 1044808005 15411 80.91.224.249 (9 Feb 2003 16:26:45 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 9 Feb 2003 16:26:45 +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 18huHz-00040J-00 for ; Sun, 09 Feb 2003 17:26:43 +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 18huGx-0007Jb-00 for gnu-help-gnu-emacs@m.gmane.org; Sun, 09 Feb 2003 11:25:39 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!newsfeed.hostname.nl!npeer.de.kpn-eurorings.net!rz.uni-karlsruhe.de!inka.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 30 Original-NNTP-Posting-Host: puric.inka.de Original-X-Trace: sapa.inka.de 1044807740 4988 193.197.184.17 (9 Feb 2003 16:22:20 GMT) Original-X-Complaints-To: abuse@inka.de Original-NNTP-Posting-Date: 9 Feb 2003 16:22:20 GMT User-Agent: KNode/0.7.1 Original-Xref: shelby.stanford.edu gnu.emacs.help:109985 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:6490 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:6490 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. Felix