From: David Kastrup <David.Kastrup@t-online.de>
Subject: Re: preview-latex: frob line lengths?
Date: 10 Dec 2002 10:33:26 +0100 [thread overview]
Message-ID: <x5k7iiz09l.fsf@lola.goethe.zz> (raw)
In-Reply-To: 843cpbb457.fsf@lucy.cs.uni-dortmund.de
kai.grossjohann@uni-duisburg.de (Kai Großjohann) writes:
> The default setting of preview-latex is to frob inline math, too. I
> think I will like it, though after 5 minutes I'm not sure yet :-)
>
> But if, in the source code there is a line break, like $f(x) = 1 +
> 2x + 3x^2 + 4x^4$, then the output will have a long line because the
> formula is displayed all in one line. This problem becomes
> especially pronounced when I use macros with short names which
> produce long formulas.
>
> Ideas?
There are basically two approaches: the insane and the sane one. The
insane one is somewhat easier to do but will probably only work with
the Emasc port, not the XEmacs one. The insane one would be to
"export" newlines within formulas into an after-string of "\n". This
would make cursor movements behave _very_ strange though.
The sane solution is not to break the line in the first place. There
are several ways for that: one is $f(x)=1+2x+3x^2+4x^4$, which
obviously does the right thing. The best way probably would be to
add a text property to the previews that would cause AUC TeX not to
reformat inside of previews when it does paragraph formatting. Even
better would be if this property also told AUC TeX how much space the
preview takes up. Then AUC TeX could be told to
a) format such that the previewed source looks nice/does not wrap
b) format such that the original source looks nice/does not wrap
c) format defensively such that both previewed and original source do
not wrap.
This would be done simply by declaring the respective width of the
resulting large character as
a) the image length
b) the source code length
c) the maximum of both.
It just happens that I am maintainer of AUC TeX also. Contributions
in that area would be a killer feature: it is one of the things
people are constantly complaining about. One should probably also
backport other changes in reformatting from Emacs to AUC TeX (which
has its own formatting code).
The other frequent "unreasonable" complaint (i.e., technically
infeasible and not really possible), namely that equation and section
numbers for regenerated previews should not be arbitrary, I have just
fixed in the latest CVS release: using a checkbox on
preview-required-option-list's `counters' option will fix that.
> preview-latex really rocks.
Help it rock more.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
next prev parent reply other threads:[~2002-12-10 9:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-06 14:42 preview-latex: frob line lengths? Kai Großjohann
2002-12-10 9:33 ` David Kastrup [this message]
2002-12-10 11:58 ` Sven Utcke
2002-12-10 12:59 ` David Kastrup
2002-12-13 16:08 ` Kai Großjohann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=x5k7iiz09l.fsf@lola.goethe.zz \
--to=david.kastrup@t-online.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).