Re: [DISCUSSION] What should we do with undocumented x^(superscript inside /round/ braces) syntax? (was: Subscript with parenthesis)

2024-02-17 Thread Mark Barton



> On Feb 17, 2024, at 5:33 AM, Ihor Radchenko  wrote:
> 
> WDYT?
+1

I use the curly braces since I often use underscores for other reasons. There 
would be no impact to me and this is the first I ever heard that parentheses 
would work. 




Re: [DISCUSSION] What should we do with undocumented x^(superscript inside /round/ braces) syntax? (was: Subscript with parenthesis)

2024-02-17 Thread Thomas Dye
+1

Tom

> On Feb 17, 2024, at 9:38 AM, William Denton  wrote:
> 
> On Saturday, February 17th, 2024 at 07:07, Ihor Radchenko 
>  wrote:
> 
>> I tentatively propose to remove the x^(2-i) example from the docstring
>> and mark the ^(...) syntax deprecated.
>> 
>> WDYT?
> 
> I think it's very sensible.  It's surprising ^(...) works like this, and if 
> anyone was using it (perhaps by accident) it will be easy to change when 
> necessary.
> 
> 
> Bill
> 
> --
> William Denton
> https://www.miskatonic.org/
> Librarian, artist and licensed private investigator.
> Toronto, Canada
> 
> 




Re: [DISCUSSION] What should we do with undocumented x^(superscript inside /round/ braces) syntax? (was: Subscript with parenthesis)

2024-02-17 Thread William Denton
On Saturday, February 17th, 2024 at 07:07, Ihor Radchenko  
wrote:

> I tentatively propose to remove the x^(2-i) example from the docstring
> and mark the ^(...) syntax deprecated.
> 
> WDYT?

I think it's very sensible.  It's surprising ^(...) works like this, and if 
anyone was using it (perhaps by accident) it will be easy to change when 
necessary.


Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada




[DISCUSSION] What should we do with undocumented x^(superscript inside /round/ braces) syntax? (was: Subscript with parenthesis)

2024-02-17 Thread Ihor Radchenko
Ihor Radchenko  writes:

> "Tom Alexander"  writes:
>
>> Some additional things I'm noticing:
>>
>> - when using parenthesis, :use-brackets-p is nil, so they're not equivalent 
>> to curly braces.
>
> `org-element-subscript-parser' uses `org-match-substring-regexp', which
> indeed allows foo_(...). This is not documented in org-syntax.org and in
> the manual (12.3 Subscripts and Superscripts).

Inconsistent with LaTeX syntax, Org mode not only allows
x^{superscript}, but also x^(superscript) with round braces used for
grouping.

This does not seem to be documented in the manual and is only vaguely
mentioned in the `org-use-sub-superscripts' docstring in a single
example:

 x_{i^2} or   x^(2-i)braces or parenthesis do grouping.

The rest of the docstring only refers to {} or just to genetic "braces".

This situation is awkward, because such subtle inconsistency between Org
and LaTeX syntax can be very surprising.

To demonstrate, try to export the following to pdf:

# ---
Direct latex code =$foo^(bar)$= :: @@latex:$foo^(bar)$@@

Org mode markup =foo^(bar)= :: foo^(bar)
# ---

The first line will only create superscript for "(", while the second
line will make the whole "(bar)" into superscript.

-

I tentatively propose to remove the x^(2-i) example from the docstring
and mark the ^(...) syntax deprecated.

WDYT?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at