From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: [patch][ox-latex] context-aware subscript Date: Wed, 28 Aug 2013 13:55:52 +0200 Message-ID: <87r4deqbav.fsf@gmx.us> References: <877gfjqq6w.fsf@pank.eu> <87tximt7bb.fsf@gmail.com> 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]:43721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEeLy-0005yJ-Ez for emacs-orgmode@gnu.org; Wed, 28 Aug 2013 07:56:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VEeLs-0004vo-2y for emacs-orgmode@gnu.org; Wed, 28 Aug 2013 07:56:02 -0400 Received: from mout.gmx.net ([212.227.17.21]:55092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEeLr-0004vb-OJ for emacs-orgmode@gnu.org; Wed, 28 Aug 2013 07:55:55 -0400 Received: from pank ([87.57.37.13]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0LxPAo-1W7z4S0IB8-016wXy for ; Wed, 28 Aug 2013 13:55:54 +0200 In-Reply-To: <87tximt7bb.fsf@gmail.com> (Nicolas Goaziou's message of "Mon, 19 Aug 2013 10:26:32 +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: n.goaziou@gmail.com Cc: emacs-orgmode@gnu.org Hi Nicolas, Nicolas Goaziou writes: > Thanks for the patch. Here are some comments about it. Sorry about the late reply > Rasmus writes: > >> Currently one can't write something like \beta_t and get a nice >> result >> in org when exporting to LaTeX (where nice result :=3D $\beta_t$). >> This >> patch tries to fix it. > > Translating \beta_t into $\beta$$_\text{t}$ and \beta_bar into > $\beta$$=C2=A0\text{bar}$ is intended. I know it's intended but I dislike it. In earlier version of ox-latex.el it didn't use the \text-macro. > Unless you explicitly ask for math mode, Org defaults to text > mode. The > fact that it needs to go through math mode to insert some entities is > not relevant.=20 I disagree that it is irrelevant. Even so, the spacing is wrong cf. below. > IOW, there's a difference between \beta_{$t$} and \beta_t. No doubt. > Also, merging consecutive subscript and superscript is fragile (and > the > code in `org-latex--script-size' could be improved in that area), as > it > also depends on user's filters. Here is a contrived example: > > Let's assume I have a filter which removes any subscript with the > letter > "a" in it. With the following code: > > \beta_a > > Trying to merge both the entity and the subscript will return > > $\beta > > which is wrong. OK. Perhaps it can be made less fragile. >> As is evident from the pdf output >> >> $\alpha$$\beta$$_{\text{t}}$ =E2=89=A0 $\alpha$$\beta$$_{{t}}$ =E2=89= =A0 >> $\alpha\beta_{t}$ >> >> There seems to be no difference between $\alpha$$\beta$ and >> $\alpha\beta$ in the pdf, but the latter is more aesthetically >> pleasing in the source. > > Beautifying LaTeX code is fine, unless it means adding yet another > variable, and making some assumptions about user's configuration. If > it ain't broken, don't fix it. But it is broken, since even=20 (*) $\beta$$_{\text{t}}$ doesn't produce the correct output (spacing is wrong; compare to $\beta_{\text{t}}$). In LaTeX, (*) represents two "math elements", although the intention was to get only one. To sum up, my (implicit) claim and what I intended to fix with the patch, was 1. Fixing the bug that subscripts produce wrong output. 2. Try to make the type of subscript configurable. Previously, "math subscripts" were forced, now \text subscripts are forced. =20=20=20=20=20 Please let me know whether either 1. or 2. is up for discussion or whether the current state is to be accepted. =E2=80=93Rasmus --=20 =E2=A0=A0=E2=A0=B5