[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LaTeX-Fill-Paragraph and inline images

From: Felix E. Klee
Subject: Re: LaTeX-Fill-Paragraph and inline images
Date: Sun, 09 Feb 2003 18:44:35 +0100
User-agent: KNode/0.7.1

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.
>>      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 
> 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".


reply via email to

[Prev in Thread] Current Thread [Next in Thread]