[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX] [preview-latex] Play nice with fill-paragraph and/or auto-f
From: |
David Kastrup |
Subject: |
Re: [AUCTeX] [preview-latex] Play nice with fill-paragraph and/or auto-fill-mode or longlines-mode |
Date: |
Mon, 10 Mar 2014 13:03:55 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Tassilo Horn <address@hidden> writes:
> Johannes <address@hidden> writes:
>
> Hi Johannes,
>
>> The result are lines, that use actual newline characters to limit the
>> length of each line (to the value fill-column). If the line contains a
>> formula this could look like this example:
>>
>> Lorem ipsum dolor sit amet, consectetur $\int_0^t x^2
>> + x dx$ veniam, quis nostrud exercitation ullamco.
>>
>> Preview latex will render the math expression and put it in line first line
>> and emacs will put everything on one long line.
>>
>> Proposed Solution:
>> If the expression replaced by preview-latex contains a newline
>> character, a newline character should be appended or prepended to the
>> replacing expression.
>>
>> Is this possible?
>
> Yes, it's possible in general by adding a linebreak as before-string or
> after-string property to the overlay. However, then the text you see
> when moving point into the preview image doesn't really match the
> original text.
We had similar discussions in the history of preview-latex. Ultimately,
something like
>> Lorem ipsum dolor sit amet, consectetur $\int_0^t x^2
>> + x dx$ veniam, quis nostrud exercitation ullamco.
looks incredibly ugly in its source anyway, so the focus moved to make
AUCTeX filling nicer. As a result, you are usually better off
customizing LaTeX-fill-break-at-separators, and then have refilling make
the line look nicer even before preview-latex gets to work.
It turns out that LaTeX-fill-break-at-separators is nil by default.
That's a bad default I think. My personal setting is
'({ } \\\( \\\) \\\[ \\\]) and that does a much better job of formatting
the original line in an amicable manner that also looks good after
preview-latex did its job.
I do remember that there were discussions about its default settings and
I thought that we more or less agreed on a subset of the full
possibilities, so I am somewhat surprised that the default of this
option actually is nil. That seems subfabulous and does not really
match my memory.
There might be independent value of getting preview-latex deal with
badly chosen line breaks, but I think the main aim should be to let
AUCTeX choose nice line breaks rather than let preview-latex make bad
breaks show nicer.
--
David Kastrup