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 18:44:35 +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=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: main.gmane.org 1044812675 29752 80.91.224.249 (9 Feb 2003 17:44:35 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 9 Feb 2003 17:44:35 +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 18hvVI-0007jc-00 for ; Sun, 09 Feb 2003 18:44:33 +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 18hvWH-0003PC-01 for gnu-help-gnu-emacs@m.gmane.org; Sun, 09 Feb 2003 12:45:33 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsmi-us.news.garr.it!NewsITBone-GARR!news.mailgate.org!newsfeeder.edisontel.com!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!news.uni-stuttgart.de!rz.uni-karlsruhe.de!inka.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 42 Original-NNTP-Posting-Host: puric.inka.de Original-X-Trace: sapa.inka.de 1044812603 7460 193.197.184.17 (9 Feb 2003 17:43:23 GMT) Original-X-Complaints-To: abuse@inka.de Original-NNTP-Posting-Date: 9 Feb 2003 17:43:23 GMT User-Agent: KNode/0.7.1 Original-Xref: shelby.stanford.edu gnu.emacs.help:109991 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:6496 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:6496 David Kastrup wrote: >> 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 theb > 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... The algorithm should not format the source of the entities. It should only format what is visible to the user after he has applied preview-latex. > 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? It would be interesting to try out the algorithm on plain text documents that are displayed with a variable width font. Do you know how to get the width in pixels of an "entity". Felix