all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: "Rudolf Adamkovič" <salutis@me.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Update Org to MathJax 3
Date: Sat, 08 Oct 2022 15:20:17 +0800	[thread overview]
Message-ID: <87h70ekci6.fsf@localhost> (raw)
In-Reply-To: <m2a667n4ax.fsf@me.com>

Rudolf Adamkovič <salutis@me.com> writes:

> Hello smart people!
>
> With all the talk about Emacs 29, I figured we should update Org Mode to
> use MathJax 3, to catch up with the rest of the world.
>
> From the documentation (for MathJax 3.0 released in 2019):
>
>> Version 3.0 of MathJax is a complete rewrite of MathJax from the
>> ground up, and its usage and configuration is significantly different
>> from that of MathJax version 2.
>
> In practice, MathJax 3.2 renders mathematics faster and better, plus it
> significantly improves LaTeX support.  For instance, one can typeset
> calculus with the built-in (!) 'physics' package, like in LaTeX.
>
> More information on the recent progress (made in 2019-2021):
>
> https://docs.mathjax.org/en/latest/upgrading/whats-new-3.0.html
> https://docs.mathjax.org/en/latest/upgrading/whats-new-3.1.html
> https://docs.mathjax.org/en/latest/upgrading/whats-new-3.2.html

Thanks a lot for this patch!

> See the attached [working, but WIP] patch.
>
> My question for you:
>
> How do we change the 'org-html-mathjax-options'?
>
> - 'scale' has now the value in [0, 1] and not in [0, 100]
> - 'scale' should exist as a number and not string
> - 'font' did not make it to MathJax 3 [*]
> - 'linebreaks' did not make it to MathJax 3 [*]
> - 'autonumber' has the values in lowercase now
> - 'autonumber' became 'tags' in MathJax terminology
>
> [*] coming in MathJax 4, currently in alpha
>
> How does Org mode approach these kind of breaking changes?

The general rule is "do not break working Org files" or backwards
compatibility in other words. See
https://bzg.fr/en/the-software-maintainers-pledge/

In particular, it means that the existing #+HTML_MATHJAX options should
not be broken when a user uses default value of
org-html-mathjax-options and org-html-mathjax-template.

WRT this patch, we can employ two different approaches:
1. Keep old Mathjax as default, but add MathJax 3 to customization
   options and parse the other options depending on the MathJax version
   in the :path.
2. Change the defaults to MathJax 3. Then, we will also need to make
   sure that incompatible option syntax in historic Org files does not
   break the export.

The option (1) is easy. We just need to choose two different sets of
options in custom interface for org-html-mathjax-options and
org-html-mathjax-template. The in-buffer options will then be parsed
depending on the :path.

The option (2) will make Org export nicer by default, but more tricky to
implement.

In (2), all the aspects of (1) should still be retained. But in
addition, you will also need to detect option values incompatible with
MathJax 3 during export. If there is mismatch between the option format
and the MathJax version, (a) try to convert the options, which should be
possible e.g. for scale and autonumber. (b) if conversion is not
possible (say, the options contain font setting), throw a warning and
fallback to compatible MathJax version.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
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>


  reply	other threads:[~2022-10-08  7:20 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-07 13:36 Update Org to MathJax 3 Rudolf Adamkovič
2022-10-08  7:20 ` Ihor Radchenko [this message]
2022-10-08 21:32   ` Rudolf Adamkovič
2022-11-05  0:20     ` [PATCH] " Rudolf Adamkovič
2022-11-05 12:01       ` Ihor Radchenko
2022-11-05 16:56         ` Rudolf Adamkovič
2022-11-05 22:44           ` Rudolf Adamkovič
2022-11-06  3:52             ` Ihor Radchenko
2022-11-06 23:49               ` Rudolf Adamkovič
2022-11-07  3:02                 ` Ihor Radchenko
2022-11-07 20:56                   ` Rudolf Adamkovič
2022-11-08  5:20                     ` Ihor Radchenko
2022-11-08 23:37                       ` Rudolf Adamkovič
2022-11-09  0:05                         ` Rudolf Adamkovič
2022-11-09  5:40                           ` Ihor Radchenko
2022-11-09 23:01                             ` Rudolf Adamkovič
2022-11-10  2:34                               ` Ihor Radchenko
2022-11-11 12:50                                 ` Rudolf Adamkovič
2022-11-13  4:24                                   ` Ihor Radchenko
2022-11-13 20:52                                     ` Rudolf Adamkovič
2022-11-14  4:33                                       ` Ihor Radchenko
2022-11-19 13:10                                         ` Bastien Guerry
2022-11-21  2:51                                           ` Ihor Radchenko
2022-11-22 20:56                                             ` Rudolf Adamkovič
2022-11-23 11:11                                               ` Ihor Radchenko
2022-11-23 23:08                                                 ` Rudolf Adamkovič
2022-11-09  2:49                         ` Ihor Radchenko

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

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

  git send-email \
    --in-reply-to=87h70ekci6.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=salutis@me.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.