Re: Depreciating TeX-style LaTeX fragments

2022-01-16 Thread Rudolf Adamkovič
Colin Baxter 😺  writes:

> \(g=\lim_{\delta m\to 0}(\delta F/\delta m)\)
>
> Backslash city! I know which one I'd prefer to read.

Further, in-text single-letter variables that permeate mathematical
writing, and I think everyone would agree that $k$ reads well.  Alas, as
soon as one needs to write $k$-th, it stops working and one must rewrite
as \(k\)-th.  So, one often ends up using both ways anyway, right?

Rudy

-- 
"Logic is a science of the necessary laws of thought, without which no
employment of the understanding and the reason takes place." -- Immanuel
Kant, 1785

Rudolf Adamkovič  [he/him]
Studenohorská 25
84103 Bratislava
Slovakia



Re: Depreciating TeX-style LaTeX fragments

2022-01-16 Thread Greg Minshall
Colin,

> > Colin Baxter writes:
> >> Ah, LaTeX3 - whatever happened to that?
...
> Yes, I know. My remark was tongue in cheek.

which leaves open whether your tongue was already in your cheek at:

> Indeed. Compare something like
> 
> $g=\lim_{\delta m\to 0}(\delta F/\delta m)$
> 
> with
> 
> \(g=\lim_{\delta m\to 0}(\delta F/\delta m)\)

?

additionally, fwiw, i was a long time '$...$'-user.  at one point i was
betrayed, and switched to '\(...\)'.  it may be more to type (i hadn't
noticed the suggestion Eric just sent in), but i liked the
repeatability.  and, in terms of parsing, i'm very sympathetic to having
"directional" end markers.

cheers, Greg



Re: Depreciating TeX-style LaTeX fragments

2022-01-16 Thread Colin Baxter 😺
> Juan Manuel Macías  writes:

> Colin Baxter writes:
>> Ah, LaTeX3 - whatever happened to that?

> If you're a LaTeX user, you're already using LaTeX3 to a very high
> extent, even if you don't see it. The current idea is not to
> replace LaTeX2e with LaTeX3 as a new version, but to gradually
> incorporate elements of LaTeX3 into the LaTeX kernel, like the new
> syntax, xparse, etc. LaTeX3 is already present in many aspects of
> LaTeX, and that is an undeniable advance. If anyone is interested
> in the state of the art, this short talk by Frank Mittelbach at
> TUG 2020 is very illustrative:

Yes, I know. My remark was tongue in cheek.



Re: Depreciating TeX-style LaTeX fragments

2022-01-16 Thread Anthony Cowley



> On Jan 16, 2022, at 7:13 AM, Eric S Fraga  wrote:
> 
> On Sunday, 16 Jan 2022 at 00:36, Timothy wrote:
>>Hmm. Not sure about this. Keystroke wise we’re comparing $$
>>to \(. The latter can be completed by smartparens, but since
>>single dollars are reasonable Org content the former can’t.
>>At this point the only argument is muscle memory, and if
> 
> As an aside, I will suggest including the following code in your Emacs
> customization:
> 
> #+begin_src emacs-lisp :tangle "esf-org.el"
>  ;; from Nicolas Richard 
>  ;; Date: Fri, 8 Mar 2013 16:23:02 +0100
>  ;; Message-ID: <87vc913oh5@yahoo.fr>
>  (defun yf/org-electric-dollar nil
>"When called once, insert \\(\\) and leave point in between.
>  When called twice, replace the previously inserted \\(\\) by one $."
> (interactive)
> (if (and (looking-at ")") (looking-back "("))
> (progn (delete-char 2)
>(delete-char -2)
>(insert "$"))
>   (insert "\\(\\)")
>   (backward-char 2)))
>  (define-key org-mode-map (kbd "$") 'yf/org-electric-dollar)
> #+end_src
> 
> I've been using this for years now and it works very well: I also had
> $...$ in my muscle memory.

This is a really helpful snippet, but I tried it out for a while a previous 
time this issue came up and found the readability of equations took too much of 
a hit. The “backslash city” really is tough to visually parse. Backslash 
density is already an unfortunate bit of the LaTeX experience, and I didn’t get 
used to the extra slashed characters as bookends over a two week trial.

I still wanted to express my appreciation for you sharing this!

Anthony


Re: Depreciating TeX-style LaTeX fragments

2022-01-16 Thread Juan Manuel Macías
Colin Baxter writes:

> Ah, LaTeX3 - whatever happened to that?

If you're a LaTeX user, you're already using LaTeX3 to a very high
extent, even if you don't see it. The current idea is not to replace
LaTeX2e with LaTeX3 as a new version, but to gradually incorporate
elements of LaTeX3 into the LaTeX kernel, like the new syntax, xparse,
etc. LaTeX3 is already present in many aspects of LaTeX, and that is an
undeniable advance. If anyone is interested in the state of the art,
this short talk by Frank Mittelbach at TUG 2020 is very illustrative:

https://invidious.snopyta.org/watch?v=zNci4lcb8Vo

Best regards,

Juan Manuel 





Re: Depreciating TeX-style LaTeX fragments

2022-01-16 Thread Eric S Fraga
On Sunday, 16 Jan 2022 at 00:36, Timothy wrote:
> Hmm. Not sure about this. Keystroke wise we’re comparing $$
> to \(. The latter can be completed by smartparens, but since
> single dollars are reasonable Org content the former can’t.
> At this point the only argument is muscle memory, and if

As an aside, I will suggest including the following code in your Emacs
customization:

#+begin_src emacs-lisp :tangle "esf-org.el"
  ;; from Nicolas Richard 
  ;; Date: Fri, 8 Mar 2013 16:23:02 +0100
  ;; Message-ID: <87vc913oh5@yahoo.fr>
  (defun yf/org-electric-dollar nil
"When called once, insert \\(\\) and leave point in between.
  When called twice, replace the previously inserted \\(\\) by one $."
 (interactive)
 (if (and (looking-at ")") (looking-back "("))
 (progn (delete-char 2)
(delete-char -2)
(insert "$"))
   (insert "\\(\\)")
   (backward-char 2)))
  (define-key org-mode-map (kbd "$") 'yf/org-electric-dollar)
#+end_src

I've been using this for years now and it works very well: I also had
$...$ in my muscle memory.

The only time it can be annoying is if you wish to edit/write org table
expressions directly instead of using org's features for this, such as
editing the equation (C-c ') or inserting one (C-c = with or without
C-u).

-- 
: Eric S Fraga, with org release_9.5.2-306-g9623da in Emacs 29.0.50



Re: Depreciating TeX-style LaTeX fragments

2022-01-16 Thread Tim Cross


Colin Baxter 😺  writes:

>> Sébastien Miquel  writes:
>
> > Hi, With respect to readability, I only mean to point out that the
> > $…$ syntax is one less character, and that the \(\) characters are
> > quite overloaded.
>
> Indeed. Compare something like
>
> $g=\lim_{\delta m\to 0}(\delta F/\delta m)$
>
> with
>
> \(g=\lim_{\delta m\to 0}(\delta F/\delta m)\)
>
> Backslash city! I know which one I'd prefer to read.
>
> >> this is a good opportunity to point out that $/$$ are very much
> >> second class citizens in LaTeX now, no matter what you may see in
> >> old documents.
>
> > The posts that you quote are 10 years old. As per [0] (2020),
> > there will be no LaTeX3. Nor is it only old documents that use the
> > $…$ syntax : looking for learning ressources (see [1]), everything
> > that I find uses it. That includes The Not So Short Introduction
> > to LaTeX [2] (2021) and
> > https://en.wikibooks.org/wiki/LaTeX/Mathematics.
>
> Ah, LaTeX3 - whatever happened to that?
>
> > Although I have no evidence of this, my expectation is that the
> > majority of tex users use the $…$ syntax (it is in fact widely
> > used outside of tex: in most markdown flavors and texmacs for
> > example). I also expect that a significant proportion of tex users
> > are not aware of the \(…\) syntax. I think here of users that are
> > less tech literate than most of this mailing list.
>
> Agreed.
>
> Best wishes,

While I can see the advantages of $..$ for equations, I think we also
need to keep in mind that org mode is NOT a latex or tex editing mode.
While it is excellent at providing a higher level abstraction which
works well with Latex, other considerations also need to come into play,
especially with respect to efficient and consistent parsing of org mode
syntax. From that perspective, $...$ seem to add complexity which is
making it much harder to get consistency and efficiency in parsing and
processing things like font locking, indentation etc.

The question then becomes "Is the slight reduction in typing and/or
possibly more readable $..$ syntax sufficient justification for more
complex and difficult to maintain code for parsing, font-locking and
indentation/filling? Furthermore, could not the readability issue be
even further enhanced with the \[...\] syntax if we are able to parse
the contents more reliably/efficiently and possibly provide other
mechanisms to improve readability of math/formula? (i.e. better
font-locking, hiding of delimiters etc).

I'm not convinced arguments regarding what authors familiar with writing
in Tex/Latex are familiar with is terribly relevant to org mode. There
are already things in org mode which are inconsistent with what you
would write in pure Tex/Latex and as mentioned, org mode is not just a
front-end for writing Tex/Latex documents. Org has its own flavoured
markup and we should work towards making the syntax of that markup as
consistent, clean and verifiable as possible. 



Re: Depreciating TeX-style LaTeX fragments

2022-01-16 Thread Colin Baxter 😺
> Sébastien Miquel  writes:

> Hi, With respect to readability, I only mean to point out that the
> $…$ syntax is one less character, and that the \(\) characters are
> quite overloaded.

Indeed. Compare something like

$g=\lim_{\delta m\to 0}(\delta F/\delta m)$

with

\(g=\lim_{\delta m\to 0}(\delta F/\delta m)\)

Backslash city! I know which one I'd prefer to read.

>> this is a good opportunity to point out that $/$$ are very much
>> second class citizens in LaTeX now, no matter what you may see in
>> old documents.

> The posts that you quote are 10 years old. As per [0] (2020),
> there will be no LaTeX3. Nor is it only old documents that use the
> $…$ syntax : looking for learning ressources (see [1]), everything
> that I find uses it. That includes The Not So Short Introduction
> to LaTeX [2] (2021) and
> https://en.wikibooks.org/wiki/LaTeX/Mathematics.

Ah, LaTeX3 - whatever happened to that?

> Although I have no evidence of this, my expectation is that the
> majority of tex users use the $…$ syntax (it is in fact widely
> used outside of tex: in most markdown flavors and texmacs for
> example). I also expect that a significant proportion of tex users
> are not aware of the \(…\) syntax. I think here of users that are
> less tech literate than most of this mailing list.

Agreed.

Best wishes,



Re: Depreciating TeX-style LaTeX fragments

2022-01-16 Thread Martin Steffen



Hi

to add my two cents. I am latex user of _many_ years (as user of emacs +
org), and I use it often for math-loaded texts.

I do use $ (I actually did not even know that \( \) is (supposed to be)
the new way  until I saw it generated by org.

As for $$ (or \[), I basically don't use it. I use
begin/end{displaymath}.

I don't care that it's a lot to type in, as I use an editor, that
assists me (said emacs ;-) resp. auc-tex mode).

I like the keybindings for environments there (and with the usual prefix
C-u C-x C-e, one can for instance turn a display-math into an equation,
should one decide later).

$$ I never used. The display-math simply looks nicer and is better
supported by auc-tex in that it uses standard indentation for
environments. For me it's likewise important that the text is properly
indented, and highlighted, so I can read the source file with easy,
while working on it.

Also \[ \] does proper indentation, but as said, I got used to C-x C-e
and that produces for me displaymath (probably it can be customized, but
I am happy with it as is).


Martin












> "Sébastien" == Sébastien Miquel  writes:

Sébastien> Hi,

Sébastien> With respect to readability, I only mean to point out
Sébastien> that the $…$ syntax is one less character, and that the
Sébastien> \(\) characters are quite overloaded.

>> this is a good opportunity to point out that $/$$ are very much
>> second class citizens in LaTeX now, no matter what you may see in
>> old documents.


Sébastien> The posts that you quote are 10 years old. As per [0]
Sébastien> (2020), there will be no LaTeX3. Nor is it only old
Sébastien> documents that use the $…$ syntax : looking for learning
Sébastien> ressources (see [1]), everything that I find uses
Sébastien> it. That includes The Not So Short Introduction to LaTeX
Sébastien> [2] (2021) and
Sébastien> https://en.wikibooks.org/wiki/LaTeX/Mathematics.

Sébastien> Although I have no evidence of this, my expectation is
Sébastien> that the majority of tex users use the $…$ syntax (it is
Sébastien> in fact widely used outside of tex: in most markdown
Sébastien> flavors and texmacs for example). I also expect that a
Sébastien> significant proportion of tex users are not aware of the
Sébastien> \(…\) syntax. I think here of users that are less tech
Sébastien> literate than most of this mailing list.

Sébastien> Regards,

Sébastien> [0]:
Sébastien> 
https://www.latex-project.org/publications/2020-FMi-TUB-tb128mitt-quovadis.pdf
Sébastien> [1]:
Sébastien> 
https://tex.stackexchange.com/questions/11/what-are-good-learning-resources-for-a-latex-beginner
Sébastien> [2]:
Sébastien> https://ctan.tetaneutral.net/info/lshort/english/lshort.pdf

Sébastien> -- Sébastien Miquel





Re: Depreciating TeX-style LaTeX fragments (was: Org Syntax Specification)

2022-01-16 Thread Sébastien Miquel

Hi,

With respect to readability, I only mean to point out that the $…$
syntax is one less character, and that the \(\) characters are quite
overloaded.

this is a good opportunity to point out that $/$$ are very much second 
class citizens in LaTeX now, no matter what you may see in old documents. 



The posts that you quote are 10 years old. As per [0] (2020), there
will be no LaTeX3. Nor is it only old documents that use the $…$
syntax : looking for learning ressources (see [1]), everything that I
find uses it. That includes The Not So Short Introduction to LaTeX [2]
(2021) and https://en.wikibooks.org/wiki/LaTeX/Mathematics.

Although I have no evidence of this, my expectation is that the
majority of tex users use the $…$ syntax (it is in fact widely used
outside of tex: in most markdown flavors and texmacs for example). I
also expect that a significant proportion of tex users are not aware
of the \(…\) syntax. I think here of users that are less tech literate
than most of this mailing list.

Regards,

[0]: 
https://www.latex-project.org/publications/2020-FMi-TUB-tb128mitt-quovadis.pdf
[1]: 
https://tex.stackexchange.com/questions/11/what-are-good-learning-resources-for-a-latex-beginner

[2]: https://ctan.tetaneutral.net/info/lshort/english/lshort.pdf

--
Sébastien Miquel




Re: Depreciating TeX-style LaTeX fragments (was: Org Syntax Specification)

2022-01-15 Thread Timothy
Hi Sebastien,

Thanks for your comments, and your thoughts on the proposed deprecation.

It’s worth explicitly considering why we wouldn’t want to steer people away from
the TeX-syntax LaTeX fragments, so I am glad you have brought up some reasons.
I do not find myself agreeing with them however, and will endeavour to explain
why below.

⁃ It is easier to use
  • Hmm. Not sure about this. Keystroke wise we’re comparing `$$' to `\('. The
latter can be completed by smartparens, but since single dollars are
reasonable Org content the former can’t. At this point the only argument is
muscle memory, and if you’re a LaTeX user (a good target audience for LaTeX
fragments I think), I’d expect LaTeX-style `\(' to be more familiar.
⁃ Easier to read
  • I had a quick look at a document to gauge this for myself, and if anything I
found the opposite (see ). This may be influenced 
by
a minor fontification tweak I made to LaTeX style input though.
⁃ more commonly used (and known) in tex documents (a quick web search for sample
  tex documents confirms the latter).
⁃ Removing this syntax would make org slightly harder to pick up, with respect
  to writing scientific documents.
  • With respect to writing scientific documents, I think we can reasonably
expect people to be familiar with `\(', particularly given the points I 
raise
below.

These points seem to have a common thread in wanting to have Org be like LaTeX.
I find this sensible, but I think this is a good opportunity to point out that
$/$$ are very much second class citizens in LaTeX now, no matter what you may
see in old documents.

To quote from David Carlisle (one of the main members of the LaTeX3 team) on 
[tex.stackexchange]:
> $$ is TeX primitive syntax, which, as others have commented is hard to
> redefine (in classic TeX there is no command name which triggers entering or
> leaving display math).
> LaTeX doesn’t officially support $$. The most noticeable failure if you use
> the syntax is that the fleqn option will no longer affect the display of the
> mathematics, it will remain centered rather than being set flush left.

Another member of the LaTeX3 team, Joseph Wright, has made even stronger
comments about $-syntax on [tex.stackexchange]:
> I’d note with my ’LaTeX3’ hat on that there is a strong chance we’ll favour 
> `\(
> ... \)' to the point of not supporting `$...$' for LaTeX3. So in the long 
> term it
> might be best to get used to `\(...\)'.

In further comments Joseph goes on to say that it is likely that $-syntax will
/not/ be dropped outright, but that $$ likely will be. Among other
things the $-syntax produces worse error reporting and spacing.

So, to sum up LaTeX currently prefers `\(...\)' / `\[...\]' over `$' / `$$', 
and it
looks like people will be pushed more strongly in this direction in future.

More than anything else, I think this demonstrates why aside from annoyances
with the parsing, purely from a user perspective, it would make sense to favour
LaTeX-syntax LaTeX fragments.

All the best,
Timothy


[tex.stackexchange] 


[tex.stackexchange]