From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Exponents / subscripts Date: Wed, 22 Oct 2014 11:54:58 +0200 Message-ID: <87d29kjuod.fsf@gmx.us> References: <87zjcs0yxw.fsf@nicolasgoaziou.fr> <87k33v13g5.fsf@nicolasgoaziou.fr> <8761fenzxi.fsf@gmx.us> <87y4s9mlef.fsf@nicolasgoaziou.fr> <87fveh89wi.fsf@gmx.us> <87ppdkmppl.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgsdI-0008Dn-Ok for emacs-orgmode@gnu.org; Wed, 22 Oct 2014 05:55:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XgsdC-0005p4-RP for emacs-orgmode@gnu.org; Wed, 22 Oct 2014 05:55:08 -0400 Received: from mout.gmx.net ([212.227.15.19]:51717) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgsdC-0005mt-IB for emacs-orgmode@gnu.org; Wed, 22 Oct 2014 05:55:02 -0400 Received: from W530 ([217.130.110.20]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0LqALY-1YKb5w3dnk-00dm1V for ; Wed, 22 Oct 2014 11:55:01 +0200 In-Reply-To: <87ppdkmppl.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Wed, 22 Oct 2014 11:13:58 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi, Nicolas Goaziou writes: > Rasmus writes: > >> Had preview-latex supported Org I'd maybe agree, but I disagree >> strongly at this time. > > Patch welcome. Cf. a recent thread on emacs.devel it's pretty non-trivial to make preview-latex work outside of AUCTeX. >> sub/superscript works well with entities and makes it very easy to >> edit math and get approximate live feedback. > > Unfortunately, some users complain about the approximation. OTOH, I'm > pretty sure that most LaTeX users can parse sub/superscript LaTeX code > without any fontification at all. Of course they can, but it takes more effort. Compare: (1) \beta E_{t}[\sum_{j=3Dt}^{T} z_{j}^{e}] (2) =CE=B2E_{t}[=E2=88=91_{j=3Dt}^{T} z_{j}^{e}] (3) =CE=B2E=E2=82=9C[=E2=88=91=E2=B1=BC=E2=82=8C=E2=82=9C=E1=B5=80z=E2=B1= =BC=E1=B5=89] (3) takes no effort to read, whereas the barebone (1) and the entities-only (2) still take considerable amount of effort to parse IMO. >> IOW and IMO, the "bug", if any, is the fontification of superscript in >> math. > > This is not Org's job since you're talking about a non-compatible > syntax. I think it should be done in a different library (i.e., not > "org.el"), if at all. An external library is ideal (had it existed), but where to stop? Are entities wrapped in math "supported syntax"? E.g. "$\alpha\beta\gamma\delta$". > You want to implement a subset of Auctex. Either you delegate it to that > major mode (=C3=A0 la Babel), at the price of some slowdown, or you dupli= cate > code from it (i.e., `font-latex-match-script'). > In both cases, you need to know when point is on a math snippet or > environment, which should rely on `org-element-context' if you're > serious about it. So your strategy would be to disable fontification within math (since the syntax is not org), and delegate it to a separate library, say tex-fold.el (which also doesn't work out-of-the-box in Org-buffers)? In theory it's ideal, but consistency (e.g. supported entities) and comparability is probably issues. I know nothing on the technical level of fortification so I'm not sure I could work on this issue efficiently. > This doesn't solve the leak of Org's fontification on math snippets and > environments. But it would if you can delegate parsing of math to a separate library, no? =E2=80=94Rasmus --=20 To err is human. To screw up 10=E2=81=B6 times per second, you need a compu= ter