Re: Faulty SVG width in default HTML export style
Yuchen Guo writes: > Maybe I'm getting confused here, but as of the latest commit > (cbe3f2d697a973a41a412b826ab9435d5523f3d0): > > - in ox-html.el, `org-html-with-latex' is defined as > `org-export-with-latex', with the comment that: > > `mathjax', t: Do MathJax preprocessing and arrange for MathJax.js to > be loaded. > > - in ox.el, `org-export-with-latex' is defined as `t'. > > Therefore, MathJax is the default export option for math snippets in > HTML exports. My fault. You are right. I missed that `org-export-with-latex' is a variable, not a symbol. If you think that we need to change the default, feel free to open a new thread proposing an alternative. >> 2. We use MathJax script from >> https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js It is >> licenced under Apache 2.0, which is GPL-compatible according to >> https://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses > > Yes. But it is still problematic because: > > - The license is not declared in the script and therefore not compatible > with LibreJS. The license is declared in the script. You can see it by following the script url. It is right on top. The other question is why LibreJS does not recognise the license. Maybe LibreJS can fix it on LibreJS side or maybe we can indicate that MathJax is GPL-compatible on the html page itself (https://www.gnu.org/software/librejs/manual/html_node/Setting-Your-JavaScript-Free.html) For the latter, patches are welcome. > - It is not trivial to `control your computing', as in `modifying the > script and run your modified copy instead.' I am not sure what is the problem here. Apache licence does not restrict modifications and you can use your modified MathJax source by customising org-html-mathjax-options. Best, Ihor
Re: Faulty SVG width in default HTML export style
Ihor Radchenko writes: > 1. MathJax is not the default export option. See org-html-with-latex Maybe I'm getting confused here, but as of the latest commit (cbe3f2d697a973a41a412b826ab9435d5523f3d0): - in ox-html.el, `org-html-with-latex' is defined as `org-export-with-latex', with the comment that: `mathjax', t: Do MathJax preprocessing and arrange for MathJax.js to be loaded. - in ox.el, `org-export-with-latex' is defined as `t'. Therefore, MathJax is the default export option for math snippets in HTML exports. > 2. We use MathJax script from > https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js It is > licenced under Apache 2.0, which is GPL-compatible according to > https://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses Yes. But it is still problematic because: - The license is not declared in the script and therefore not compatible with LibreJS. - It is not trivial to `control your computing', as in `modifying the script and run your modified copy instead.' Maybe LibreJS can provide us the facility to do so. -- Yuchen Guo
Re: Faulty SVG width in default HTML export style
Rudolf Adamkovič writes: >> For me, Emacs using MathJax as default came across as an unpleasant >> surprise: any person aware of the free/libre software movement knows >> that one should never allow Javascript to run in their browser: (ref >> https://www.gnu.org/philosophy/javascript-trap.html ). >> >> MathJax is not even compatible with LibreJS and loads script from >> a bunch of 3rd-party servers like Cloudflare. This enables those 3rd >> parties to track visitors to your website. > > How did that get through the FSF/RMS strict ethical requirements for > Emacs? As soon as the user adds a simple "$1 + 1 = 2$" to their Org > document, the HTML export from Emacs/Org becomes quietly tracked by an > American company. Emacs should never do that, IMO. 1. MathJax is not the default export option. See org-html-with-latex 2. We use MathJax script from https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js It is licenced under Apache 2.0, which is GPL-compatible according to https://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses > (On a related note, the Emacs/Org manual mentions, "if you are following > a system like David Allen's GTD", implicitly promoting a book that the > publisher distributes just with mandatory DRM [1].) > > [1] https://orgmode.org/manual/Stuck-projects.html Emm. No? One can simply read https://en.wikipedia.org/wiki/Getting_Things_Done and free references from there. The fact that GTD methodology is described in some DRM-protected book does not imply that one must use that particular book to learn GTD. It would only be an issue if Org manual contained a direct link to David's book. Best, Ihor
Re: Faulty SVG width in default HTML export style
Yuchen Guo writes: Hi Yuchen! > I think we can solve this issue by looking at how Wikipedia does the > alignment of text and LaTeX snippets. [...] The alignment parameters > are also dependent on the snippet itself. Good idea! > For me, Emacs using MathJax as default came across as an unpleasant > surprise: any person aware of the free/libre software movement knows > that one should never allow Javascript to run in their browser: (ref > https://www.gnu.org/philosophy/javascript-trap.html ). > > MathJax is not even compatible with LibreJS and loads script from > a bunch of 3rd-party servers like Cloudflare. This enables those 3rd > parties to track visitors to your website. How did that get through the FSF/RMS strict ethical requirements for Emacs? As soon as the user adds a simple "$1 + 1 = 2$" to their Org document, the HTML export from Emacs/Org becomes quietly tracked by an American company. Emacs should never do that, IMO. [I decided to CC RMS on this issue.] (On a related note, the Emacs/Org manual mentions, "if you are following a system like David Allen's GTD", implicitly promoting a book that the publisher distributes just with mandatory DRM [1].) [1] https://orgmode.org/manual/Stuck-projects.html Agreed 100 percent with everything else you said. Further, in addition to the ethical issues, MathJax also makes the website render slower. With SVG, mathematics appears instantly, like on Wikipedia. > Unrelated but I think its best to not use Apple dis-services: [...] Definitely, and thank you for the reminder. The address dates back to when I still used Apple services. These days, I do not use them for personal purposes anymore, except for their IMAP server to fetch the messages. That said, I do plan to address the issue for sure. Rudy -- "Thinking is a momentary dismissal of irrelevancies." -- Richard Buckminster Fuller, 1969 Rudolf Adamkovič [he/him] Studenohorská 25 84103 Bratislava Slovakia
Re: Faulty SVG width in default HTML export style
Rudolf Adamkovič writes: > I now wonder if anyone knows how to fix the misaligned baselines of > inline LaTeX fragments (as shown in the second screenshot). I think we can solve this issue by looking at how Wikipedia does the alignment of text and LaTeX snippets. A cursory look at https://en.wikipedia.org/wiki/Normal_distribution ... shows that they use something like this: The alignment parameters are also dependent on the snippet itself. > If we could somehow fix that, MathJax-less export > could become usable in practice *and* it would also unlock full LaTeX > power, including TikZ and beyond! (It would also put Emacs ahead of the > pack in the world of LaTeX-capable editors because virtually every other > modern editor, including the proprietary ones, can just use MathJax.) For me, Emacs using MathJax as default came across as an unpleasant surprise: any person aware of the free/libre software movement knows that one should never allow Javascript to run in their browser: (ref https://www.gnu.org/philosophy/javascript-trap.html ). MathJax is not even compatible with LibreJS and loads script from a bunch of 3rd-party servers like Cloudflare. This enables those 3rd parties to track visitors to your website. Also, by loading external scripts, author of an website essentially puts the website and its visitors under the mercy of the script: the script, if malicious, can just sabotage the entire website. Sadly it seems that there aren't enough people using Orgmode with SVG: this CSS bug is at least present since 2020, according to git logs. Rendering SVG images is also painfully slow: I can export the document as PDF much faster than as HTML+SVG. Then there is the alignment issue. > @me.com Unrelated but I think its best to not use Apple dis-services: it has a record of kowtowing to government requests such as moving email account to surveillance-friendly regimes: https://en.wikipedia.org/wiki/ICloud#China Not to mention its utter contempt of Software Freedom such as forbidding GNU GPL on their program distribution platform. -- Yuchen Guo
Re: Faulty SVG width in default HTML export style
Yuchen Guo writes: > In my experiment removing this line fixed the issue. Thank you for reporting this! I now wonder if anyone knows how to fix the misaligned baselines of inline LaTeX fragments (as shown in the second screenshot). If we could somehow fix that, MathJax-less export could become usable in practice *and* it would also unlock full LaTeX power, including TikZ and beyond! (It would also put Emacs ahead of the pack in the world of LaTeX-capable editors because virtually every other modern editor, including the proprietary ones, can just use MathJax.) Rudy -- "Mathematics takes us still further from what is human into the region of absolute necessity, to which not only the actual world, but every possible world, must conform." -- Bertrand Russell, 1902 Rudolf Adamkovič [he/him] Studenohorská 25 84103 Bratislava Slovakia
Re: Faulty SVG width in default HTML export style
Hi, Yuchen Guo writes: > Currently the style specified for SVG images > in `org-html-style-default' variable is the following: > > .org-svg { width: 90%; } > > This causes a single image (math formula) to occupy almost the width of > the entire page, rendering the page unreadable. > > In my experiment removing this line fixed the issue. Indeed, thanks for spotting and reporting this, fixed in the bugfix branch. -- Bastien
Faulty SVG width in default HTML export style
Currently the style specified for SVG images in `org-html-style-default' variable is the following: .org-svg { width: 90%; } This causes a single image (math formula) to occupy almost the width of the entire page, rendering the page unreadable. In my experiment removing this line fixed the issue. Two PNG screenshots demostrating the issue is available under the following links: https://w.wiki/4uQd https://w.wiki/4uQe -- Yuchen Guo