emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [PATCH] Don't fill displayed equations


From: Max Nikulin
Subject: Re: [PATCH] Don't fill displayed equations
Date: Tue, 5 Oct 2021 00:11:24 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

My thanks to Ihor for the argument concerning code of (maybe external) exproters and to Tom for parser-related considerations.

I think it is a kind of trade-off: breaking change vs. continuously breaking user experience. Do not worry too much, there is almost no chance that I will try to implement my plan, so current state will remain as is. In naive form my idea was:

1. Find the code where \( \) is parsed and remove \[ \] option
2. Find the place where \begin{equation} is handled and add \[ somewhere around.

I fill some misunderstanding since some arguments has the form "it is too hard because it requires ..." where "..." exactly what I was going to discuss.

On 04/10/2021 12:57, Tom Gillespie wrote:

Maybe you are right and Tom was actually assuming \begin{equation*}, not
#+begin_export latex.

Correct. My bad on that one.

By the way, I realized that choice of "\begin{equation}" and not "#+begin_equation" is not clear to me. However it allows to pass \begin{equation} to LaTeX or HTML+MathJax transparently.

Just as Timothy, I believe that \begin{equation*} is unnecessary verbose
when \[ works *mostly* in a similar way.

\begin{equation*} is absolutely required if you want to be able to include
newlines because \[ and \begin are not similar at all as far as parsing
is concerned.

 From the spec: https://orgmode.org/worg/dev/org-syntax.html#LaTeX_Environments
CONTENTS can contain anything but the “\end{NAME}” string.
The spec is not completely accurate since latex environments can't
contain a new heading, but the point is that latex environments are
elements, whereas \[ \] is an object.
                          ^^^^^^^^^^^^
I was going to discuss namely this change.

Isn't the whole point of the \[ ... \], \( ... \), $ ... $, $$ ... $$,
and \begin{env} ... \end{env} and constructs in Org to be consistent
with LaTeX?

For \begin and \end yes. For the others no.

Unsure, but then forbidding \[ \] at all may result in less confusion then current state "inline object that is transformed to block element during export". Making \[ \] a special case for paragraph filling when it is inline object would be even more confusing.

I'm actually fairly certain that such a change should never be made
due to the recent changes in org link syntax. Specifically given how
\[ is used for escapes in links. https://orgmode.org/manual/Link-Format.html
This means that the only place you could reliably use \[ is at the start of a
new line preceded only by whitespace. However, if this were to happen then
pretty much every org document that uses \[ \] is at risk for being broken
because something that was once a single paragraph will now be multiple
paragraphs.

Agree that context-dependent "\]" may cause problems.

If you need multiline use \begin \end, that is what they are there for, and they
fit better with org's general extensible approach to blocks. I would dearly love
to be able to have a single shorthand for src blocks that worked inline and
standalone,

I do not suggest using \[ \] both for inline object and block elements. I hope that even if behavior of \[ \] inside paragraphs were not specified it would not break user files since it will be transparently passed to LaTeX or HTML. However, LaTeX exporter may escape them to have it literally in the output.

Consider the case where you have something like

\[ something something

more content
more content [[www.example.com/\]oops][evil link]] \]

Frankly speaking, with Org I never sure in such cases whether everything inside \[ \] will be literally copied to LaTeX file or some some Org markup will be handled, so it is possible to insert something e.g. inside \text{}.

\[ a

b \]

\[
a
b
\]

a \[ b

c \] d

Similar variants exist for \begin{equation} \end{equation}

In short. Just not worth it.

The value of TeX, markdown, reStructured text, Org is convenience to type in comparison with SGML&XML-based formats that are not really human friendly. In this sense \[ is noticeably better than \begin{equation*}.




reply via email to

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