From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [patch][ox-latex] context-aware subscript Date: Wed, 28 Aug 2013 15:38:42 +0200 Message-ID: <874naaorz1.fsf@gmail.com> References: <877gfjqq6w.fsf@pank.eu> <87tximt7bb.fsf@gmail.com> <87r4deqbav.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEfxm-0008RL-0d for emacs-orgmode@gnu.org; Wed, 28 Aug 2013 09:39:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VEfxf-0004cO-QK for emacs-orgmode@gnu.org; Wed, 28 Aug 2013 09:39:09 -0400 Received: from mail-wg0-f41.google.com ([74.125.82.41]:46830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEfxf-0004cE-LF for emacs-orgmode@gnu.org; Wed, 28 Aug 2013 09:39:03 -0400 Received: by mail-wg0-f41.google.com with SMTP id b12so77618wgh.2 for ; Wed, 28 Aug 2013 06:38:27 -0700 (PDT) In-Reply-To: <87r4deqbav.fsf@gmx.us> (rasmus@gmx.us's message of "Wed, 28 Aug 2013 13:55:52 +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: Rasmus Cc: emacs-orgmode@gnu.org Hello, Rasmus writes: > I know it's intended but I dislike it. In earlier version of > ox-latex.el it didn't use the \text-macro. Earlier versions were broken in many ways. They didn't handle spaces, unicode characters and nested sub/superscript like \text does. >> 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. That's not an easy task. I think it would involve adding implicit pseudo-objects (i.e. object types specific to `latex' back-end). Unfortunately, there's no API for that in either org-element or ox. For now, I think we can put it aside. > But it is broken, since even > > (*) $\beta$$_{\text{t}}$ > > doesn't produce the correct output (spacing is wrong; compare to > $\beta_{\text{t}}$). Correct. Then, fixing it is more important than caring about some user filter. > 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. OK. > 2. Try to make the type of subscript configurable. Previously, > "math subscripts" were forced, now \text subscripts are forced. I think filters are good enough for the job. No need for another configuration variable. Also, entering math mode is easy enough in Org, whereas exiting math mode isn't (if it is forced). I often use constructs like \(I_n\) since I want the "I" char to be in the same font as "n". Regards, -- Nicolas Goaziou