Re: Hyphen after LaTeX fragments

2023-03-21 Thread Yuchen Guo
If it is deprecated in Org mode, maybe we can print a warning message in
echo area?

> but this question will keep coming over and
> over and over until the end of times.

Yet I tried searching Org manual, and also here the mailing list
archive, before posting my latest lame message here.  Maybe I did not
use the correct keyword, maybe something else.

> Clearly, there is a need for the dash, and given the quality and
> syntactic stability of TeX, the problem is not going anywhere
> ... ever.

Absolutely.


signature.asc
Description: PGP signature


Hyphen after LaTeX fragments

2023-03-14 Thread Yuchen Guo
Sometimes I encounter such texts:

   One of the useful features of a basis $B$ in an $n$-dimensional space

When entered as-is in Org mode and exported to LaTeX, the string
"$n$-dimensional" is exported as plain text, as

  One of the useful features of a basis \(B\) in an \$n\$-dimensional space

However, in cases such as "$n$;" and "$n$.", they are correctly exported
as "\(n\);" and "\(n\).".

Are there any option to treat hypen the same as semicolon or full stop
in LaTeX exports?

-- 
Yuchen Guo



yc_pubkey.gpg.asc
Description: application/pgp-keys


signature.asc
Description: PGP signature


Hyphen after LaTeX fragments

2023-03-14 Thread Yuchen Guo
Sometimes I encounter such texts:

   One of the useful features of a basis $B$ in an $n$-dimensional space

When entered as-is in Org mode and exported to LaTeX, the string
"$n$-dimensional" is exported as plain text, as

  One of the useful features of a basis \(B\) in an \$n\$-dimensional space

However, in cases such as "$n$;" and "$n$.", they are correctly exported
as "\(n\);" and "\(n\).".

Are there any option to treat hypen the same as semicolon or full stop
in LaTeX exports?

-- 
Yuchen Guo



Hyphen after LaTeX fragments

2023-03-14 Thread Yuchen Guo
Sometimes I encounter such texts:

   One of the useful features of a basis $B$ in an $n$-dimensional space

When entered as-is in Org mode and exported to LaTeX, the string
"$n$-dimensional" is exported as plain text, as

   One of the useful features of a basis \(B\) in an \$n\$-dimensional space

In cases such as "$n$;" and "$n$.", they are correctly exported as
"\(n\);" and "\(n\).".

So, are there any option that can be tweaked to export "$MATH$-text"
correctly?

-- 
Yuchen Guo


signature.asc
Description: PGP signature


Ethical problems with MathJax as default - Was: Faulty SVG width

2022-04-04 Thread Yuchen Guo


Ihor Radchenko  writes:

> The license is declared in the script. You can see it by following the
> script url. It is right on top.

True. My fault.  The problem is that the declaration is not
machine-readable by LibreJS.

On the other hand, I think it is more preferable and more
privacy-conscious to forbid loading from Cloudflare and use a local copy
of MathJax embedded in LibreJS instead:

- One can not trust Cloudflare.
- Even if it is trusted, Cloudflare would still (at least)
  log the IP address.

> 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.

Oh, I meant the freedom of the website visitor replacing MathJax with a
modified version on-the-fly, not of the website authors.  That is not
trivial.

Thanks for the tip!  I will certainly use a local copy of MathJax when
necessary.

-- 
Yuchen Guo



Re: Faulty SVG width in default HTML export style

2022-04-03 Thread Yuchen Guo


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

2022-03-29 Thread Yuchen Guo


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



Faulty SVG width in default HTML export style

2022-03-03 Thread Yuchen Guo


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