Hi,
please discard the last patch and use the attached patch. I have been
able to fix the git synchronisation issues I had. Apparently savannah
shares part of the ASPATH with the football pirates and periodically
becomes a colateral damage in the fight between them and the copyright
holders from here (on top of the damage caused periodically by the LLM
scavengers).
:-(
/PA
On 31/08/2026 12:55, Pedro A. Aranda wrote:
Hi Ihor,
this could have waited. I told you that I was going to take a real break
from this starting on 01/08. So all the exchange was for you to study
the proposals and put your ideas on "frozen water".
We would retake the discussion upon my return.
Anyhow...
On 01/08/2026 11:02, Ihor Radchenko wrote:
"Pedro A. Aranda" <[email protected]> writes:
Subject: [PATCH] LaTeX export: add org-latex-fontspec-config
Applied, onto main, with changes.
I have fixed a number of typos and formatting problems.
I have also moved org-get-string-scripts to org-macs.el to avoid even
more
circular dependencies in org.el and because it is a pretty generic
function.
I removed some leftover comments from the earlier iterations that are
no longer relevant.
Finally, there was one missed uncommented (message ...). From our
previous discussion, I judged that it was unintentional omission.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=aab2bc0c9
Additionally, as a separate patch, I reworded one warning.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=de710748b
(org-latex-guess-fontspec): New funciton to insert the fontspec
configuration when the fontspec package is requested in the LaTeX
prelude.
Shouldn't "prelude" be preamble?
As mentioned before, both are used interchangeably, but anyhow...
changed
The patch did not contain this change.
I made the change myself on top of the patch.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=0197489cf
Yes, that may have been a glitch when synchronising my git. Remember I
told you that I was having difficulties accessing savannah...
Now everything is "preamble".
+ :group 'org-export-latex
+ :package-version '(Org . "10.0")
+ :type 'alist
We could use a more detailed type definition.
FFS
Please elaborate.
If you disagree with the suggested change in the patch, it would be
useful to provide more details on why.
I have improved the :type definition in
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=63f1e2e86
FFS means "for further study". I was just asking for time to reset and
to ponder possible solutions away from a screen and a keyboard. Attached
is a patch that contains my proposal. I don't want to make anyone a
second class citizen.
+ (matched (string-match "\\\
\usepackage{fontspec}\n" header))
Why trailing \n?
Also, what about \usepackage[...]{fontspec}?
Removed.
You missed my comment about
Also, what about \usepackage[...]{fontspec}?
I have updated the regexp in
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=33f6197aa
OK>> EXTRA stuff to make the patch as feature-completeas possible:
1.- I included the :languages -> :language in the INFO channel from
feature/all-tex-fonts.
I have removed this change from the applied patch.
The :languages property in the patch is unused by the actual code, so
the news entry is not very useful - you changed nothing for the users.
I think we discussed similar situations in the past - adding new code
APIs that are not used in the code (at least, partially) in anticipation
of new features is not a good practice.
Once again, I just wanted to draw _your_ attention to this and test
suggest you test it and spend some meditation time on this.
My concern right now is that :languages provides a completely different
response to #+LANGUAGE: than the current implementation.
If you look at the tests, there are some that expect to know only about
the last language defined with #+LANGUAGE: (for example in the HTML tests).
I have trouble understanding what the effect of :languages may be in the
PDF when exporting such documents and wanted _your_ opinion.
We can't use it, however, because some exporters
rely on the original #+LANGUAGE implementation overwriting the current
language.
Could you please elaborate what exactly is broken?
See above
2.- I reintroduced handling CJK fonts with fontspec+xelatex (w/ test and
documentation).
Ok.
3.- unicode-math is only included when needed, i.e. when we use
\setmonofont.
Ok. I note that you used \RequirePackage. I think \usepackage should be
used instead. Given that you asked to apply the patch quickly, I have
changed it to \usepackage without waiting for your input in a separate
followup patch.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=127788853
If you believe that \RequirePackage should be used, let's discuss it
later.
OK, \RequirePackage and \usepackage are functionally equivalent in this
context. Whatever you think. But please look at the listings export in
LaTeX and the docstrings. They referred to \RequirePackage there and I
opted for uniformity.
/PA
--
Pedro A. Aranda
ox-latex & ox-beamer maintainer
Sagen's Paradeiser! (ORF: Als Radiohören gefährlich war) => write BE!
IA: onomatopeya del rebuzno
2nd year of the New Koprocracy
From 709c222870675805eff59f55efa0fa49a40a9905 Mon Sep 17 00:00:00 2001
From: "Pedro A. Aranda" <[email protected]>
Date: Wed, 2 Sep 2026 08:50:03 +0200
Subject: [PATCH] Fix fontspec commit
* lisp/ox-latex.el (org-latex-fontspec-config): Don't make CJK second
class citizens
(org-latex--needs-xecjk): Explain better and in a grammatically
correct way.
---
lisp/ox-latex.el | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index d9898fdd5..4cdc6da50 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -1635,16 +1635,14 @@ (defcustom org-latex-fontspec-config nil
:group 'org-export-latex
:package-version '(Org . "10.0")
:type '(alist
- :key-type (choice (const "main") (const "sans")
- (const "mono") (const "math")
- (string :tag "CJKmain/CJKsans/CJKmono/etc"))
+ :key-type string :tag "LaTeX font family"
:value-type (plist :options
- ((:font (string :tag "Font name"))
+ ((:font (string :tag "System font"))
(:features (choice string (repeat string)))
(:fallback
(alist
- :key-type (string :tag "Emacs script name")
- :value-type (string "Font name"))))))
+ :key-type (string :tag "Emacs script")
+ :value-type (string "System font"))))))
:safe #'listp)
@@ -1912,7 +1910,7 @@ (defun org-latex--needs-xecjk (info)
(setq result (or result (string-prefix-p "CJK" (car fontdef))))))
(when result
(unless (equal "xelatex" compiler)
- (warn "`org-latex-fontspec-config' require xelatex, but %s is selected" compiler)))
+ (warn "`org-latex-fontspec-config' defines CJK fonts: compile with xelatex instead of %s." compiler)))
result))
;;;;
(defun org-latex--fontspec-preamble (info)
--
2.43.0