emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Timothy <tecosaur@gmail.com>
Cc: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] Don't fill displayed equations
Date: Sat, 02 Oct 2021 13:06:55 +0200	[thread overview]
Message-ID: <877devofcg.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <875yuhjhpa.fsf@gmail.com> (Timothy's message of "Fri, 01 Oct 2021 15:43:35 +0800")

Hello,

Timothy <tecosaur@gmail.com> writes:

> Is it? I can't use verbatim like this:
>
> =
> some
> verbatim
> text
> =
>
> but I can do
>
> \[
> some
> display
> equation
> \]
>
> It seems to me that \[ ... \] is already treated differently from other
> inline markup.

There is some misunderstanding here. 

You cannot use verbatim like the above because its definition forbids
spaces on the inner side of the markers (for obvious reasons). There is
no such restriction in \[...\] markup. For citations, you can also write

  [@cite:
  @foo
  ]

if you like.

But this is orthogonal to the type of element, i.e., inline or block.

Inline means the object is always enclosed in a paragraph (or a verse
block, or possibly a table cell). In particular, it cannot get past the
boundaries of its container. Corollary: since a blank line in Org ends
a paragraph, objects cannot contain blank lines. Both verbatim objects
and \[...\] snippets share those limitations.

> If that's the only way that Org could treat \[ ... \] differently from
> \( ... \), I'd be strongly in favour of this.

I think it is not necessarily a bad thing that \(...\) and \[...\] are
the same. Some export back-ends can tell the difference between them,
others do not care. This is the same for, e.g., verbatim and code. Not
all back-ends use a different output for them. IOW, it is not
necessarily right to treat them differently just because some back-ends
do treat them differently. Org is simply agnostic to this subtleties.

> I prefer \[ ... \] over \begin{equation*}...\end{equation*} as it's much
> more succinct, and helps reduce the "markup noise" in my documents. 

This is all about taste. But at least you have a choice. With your
patch, I may have to struggle with filling whenever some paragraph
contains \[...\], without any choice.

Also, it could be possible to overlay "\[" over \begin{equation*} thus
negating the markup noise.

> I don't think this is an insignificant concern, brevity may not be
> something I'm very good at in emails 😛 but is something I look for in
> syntax.

You probably have noticed that Org syntax is not very much into brevity.

> I must admit, I don't see the downside here --- how does this break the
> filling function for the rest of you? This only affects \[ ... \] blocks
> that have already been put on their own line.

No it doesn't. Without additional guards, filling a paragraph could
split a line and send an otherwise mid-line block at the beginning of
a line. But this is not the point. The point is much more basic,
actually. It is related to the uniformity of filling behaviour, as
already explained.

> Why can't we apply LaTeX expectations to LaTeX elements in Org? Applying
> LaTeX expectations to Org as a whole is clearly a silly idea, but Org
> copies \[ .. \] from LaTeX and it is a LaTeX construct.

Nope, it is obviously borrowed to LaTeX, but they are not the same.

I think I understand where you're coming from. Relying much on LaTeX,
you probably grew habits on how your equations should be formatted in
a LaTeX document. Applying this formatting in an Org document doesn't
work, tho, because Org has little understanding of true LaTeX syntax. It
just needs a way to quickly write maths.

  \[
  ... equation ...
  \]

should be seen as a LaTeXism.

>> Notwithstanding filling behaviour, \[...\] in Org is much more limited
>> than \[...\] in LaTeX.
>
> I'd be curious to hear how, as I personally haven't run into any
> instances where \[ ... \] has behaved differently other than when an
> environment starts on a new line in of a \[ ... \] block (which can
> easily be fixed by putting something like \!\ at the start of the
> line).

As explained above, for example, \[...\] cannot contain blank lines.
They cannot contain, e.g., "|" at the beginning of a line, too.
Full-fledged LaTeX environments do not have those limitations.

> I don't want "advanced" LaTeX code, I just want my display equations to
> be treated as display equations consistently 😂.

It is a "display equation" in LaTeX. There is no such thing as
a "display equation" in Org, even though you probably see it as such due
to your LaTeX background. There, \[...\] is just another way to write
maths within a paragraph.

Regards,
-- 
Nicolas Goaziou


  reply	other threads:[~2021-10-02 11:11 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30 17:20 [PATCH] Don't fill displayed equations Timothy
2021-09-30 17:44 ` Timothy
2021-09-30 18:51 ` Nicolas Goaziou
2021-09-30 18:54   ` Timothy
2021-09-30 19:02     ` Nicolas Goaziou
2021-09-30 19:17       ` Colin Baxter
2021-09-30 22:11         ` Nicolas Goaziou
2021-09-30 22:26           ` Tim Cross
2021-09-30 19:28       ` Timothy
2021-09-30 20:45       ` Timothy
2021-09-30 22:55         ` Nicolas Goaziou
2021-10-01  7:38           ` Stefan Nobis
2021-10-01 20:41             ` Nicolas Goaziou
2021-10-02  8:17               ` Org syntax: \[ \] as block element instead of inline object Max Nikulin
2021-10-02 10:47                 ` Stefan Nobis
2021-10-02  9:57               ` [PATCH] Don't fill displayed equations Stefan Nobis
2021-10-02 10:04               ` Eric S Fraga
2021-10-02 10:18                 ` Timothy
2021-10-02 11:24                   ` Eric S Fraga
2021-10-02 14:21                     ` Max Nikulin
2021-10-02 17:51                       ` Tom Gillespie
2021-10-02 18:28                         ` Timothy
2021-10-02 18:57                           ` Tom Gillespie
2021-10-02 20:25                             ` org-latex-preview and latex export blocks Timothy
2021-10-03  8:50                         ` [PATCH] Don't fill displayed equations Max Nikulin
2021-10-03 10:56                           ` Stefan Nobis
2021-10-03 12:04                             ` Max Nikulin
2021-10-04  5:57                               ` Tom Gillespie
2021-10-04 17:11                                 ` Max Nikulin
2021-10-03 12:35                           ` Ihor Radchenko
2021-10-01  7:43           ` Timothy
2021-10-02 11:06             ` Nicolas Goaziou [this message]
2021-10-02 11:24               ` Timothy
2021-10-03  8:49                 ` Ihor Radchenko
2021-10-03  8:50                   ` Timothy
2021-10-03  9:13                     ` Ihor Radchenko
2021-10-03  9:14                       ` Timothy
2021-10-03  9:41                         ` Ihor Radchenko
2021-10-03  9:42                           ` Timothy
2022-06-18  6:00                             ` Ihor Radchenko
2021-10-01 14:42         ` Greg Minshall
2021-10-04  6:05         ` Timothy
2021-10-04  7:11           ` Tom Gillespie
2021-10-04  7:15             ` Timothy
2021-10-04  8:11           ` Przemysław Pietrzak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877devofcg.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=tecosaur@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).