[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: The less ambiguous math delimiters in tables
From: |
Ihor Radchenko |
Subject: |
Re: The less ambiguous math delimiters in tables |
Date: |
Thu, 26 Dec 2024 09:17:06 +0000 |
Rudolf Adamkovič <rudolf@adamkovic.org> writes:
>> 1. <begin cell> \(<end cell><begin cell>x<end cell><begin cell>\) <end cell>
>> 2. <begin cell> <begin latex>|x|<end latex> <end cell>
>>
>> Org parser chooses one. It has to choose some.
>> Org parser also chooses a simpler interpretation that does not require
>> backtracking.
>
> But (2) is a *much, much, much* better choice (for the user).
Maybe, but it is also much more complex in terms of parser.
Backtracking will introduce non-linear complexity to the parser,
degrading the performance significantly. It will also make Org syntax
much, much harder in more complex cases - there will still be
ambiguities when you have more than 2 interpretations: e.g.
| \(|x|\) | \(|x|\) |
this one has 3 possibilities:
1. <cell> \(</cell><cell>x...
2. <cell> <latex>|x|\) | \(|x|</latex> </cell>
3. <cell> <latex>|x|</latex> </cell><cell> <latex>|x|</latex> </cell>
And there will be similar situations with even more possibilities. In
fact, the number of ambiguous alternatives can blow up pretty quickly
when the text is complex enough combination of literal and non-literal
markups.
In any case, the way Org parser works in this example is one of the most
fundamental design decisions in the Org markup. We cannot change it at
this point without breaking all the historical documents + third-party
parsers. That's why I am talking about providing markup extension to
address the issue rather than altering the existing parser fundamentals.
--
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
- The less ambiguous math delimiters in tables, Rudolf Adamkovič, 2024/12/24
- Re: The less ambiguous math delimiters in tables, Ihor Radchenko, 2024/12/24
- Re: The less ambiguous math delimiters in tables, Rudolf Adamkovič, 2024/12/25
- Re: The less ambiguous math delimiters in tables, Ihor Radchenko, 2024/12/25
- Re: The less ambiguous math delimiters in tables, Rudolf Adamkovič, 2024/12/25
- Re: The less ambiguous math delimiters in tables,
Ihor Radchenko <=
- Re: The less ambiguous math delimiters in tables, Rudolf Adamkovič, 2024/12/26
- Re: The less ambiguous math delimiters in tables, Ihor Radchenko, 2024/12/26
- Re: The less ambiguous math delimiters in tables, Rudolf Adamkovič, 2024/12/27
- Re: The less ambiguous math delimiters in tables, Ihor Radchenko, 2024/12/27
- Re: The less ambiguous math delimiters in tables, Rudolf Adamkovič, 2024/12/30
- Re: The less ambiguous math delimiters in tables, Ihor Radchenko, 2024/12/31
- Re: The less ambiguous math delimiters in tables, Leo Butler, 2024/12/27
- Re: The less ambiguous math delimiters in tables, Max Nikulin, 2024/12/28
- Re: The less ambiguous math delimiters in tables, Rudolf Adamkovič, 2024/12/30
- Re: The less ambiguous math delimiters in tables, Ihor Radchenko, 2024/12/31