emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [patch][ox-latex] context-aware subscript


From: Nicolas Goaziou
Subject: Re: [O] [patch][ox-latex] context-aware subscript
Date: Wed, 28 Aug 2013 15:38:42 +0200

Hello,

Rasmus <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]