Hey Pedro,

I just completed some testing on the feature branch, mostly on the
`fontconfig' side (still asking around for some polyglot documents).
It went very well; here’s what I did and found.

+ Compiled each of the [MWE] files you provided from the meetup
  (`babel' and `polyglossia') under `lualatex' and `xelatex', and
  compared all the outputs. Everything worked and the PDFs were close
  to your references with the right fonts embedded.

[MWE]
<https://lists.gnu.org/archive/html/emacs-orgmode/2025-06/msg00143.html>

+ Translated a few `unicode-math' configs into the variable
  `org-latex-fontspec-config' and compiled some math. No issues.

+ Tried out the font fallback options with `lualatex' and it worked
  well. This of course fails with `xelatex' since the fallback is
  specific to `lualatex'. To ensure the `xelatex' document can still
  be compiled in this case (albeit with missing glyphs), I think the
  fallbacks should be skipped:

#+begin_src diff
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index bfdc58d36..e716325f9 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -2105,7 +2105,8 @@ we are using neither bale nor polyglossia"
                     (fallback (plist-get config-plist :fallback)))
           (push (cons fname (concat "fallback_" fname)) fallback-alist)))
       ;; (message "fallback-alist ==> %s" fallback-alist)
-      (when fallback-alist ;; if there are fonts with fallbacks
+      (when (and (equal compiler "lualatex") ;; no glyph-based fallbacks for 
xelatex
+                 fallback-alist) ;; if there are fonts with fallbacks
         ;; create the directlua header
         (dolist (fallback fallback-alist)
           ;; (message "fallback ===> %s" fallback)
#+end_src

+ To specify the fallbacks, it might be nicer to split off the mode,
  i.e. something like:

#+begin_src emacs-lisp
:fallback (("emoji" .  "Noto Color Emoji" "harf"))
#+end_src

+ I didn’t see a variable to customize `defaultfontfeatures' or
  `unimathsetup', but they might be useful.

On 2025-06-07 01:26, Pedro Andres Aranda Gutierrez wrote:
> PS: I would like to reiterate my request for MWE's for babel on _pdflatex_.

Sorry if I’m missing context, but what kind of examples? Something
like [this]?

#+begin_src org
,#+LATEX_COMPILER: pdflatex
,#+LATEX_HEADER: \usepackage[main=english,czech]{babel}

This is some text in english.

@@latex:\foreignlanguage{czech}{@@Český jazyk neboli čeština je západoslovanský 
jazyk, nejbližší slovenštině, poté polštině a lužické srbštině.@@latex:}@@
#+end_src

[this]
<https://tex.stackexchange.com/questions/244910/how-to-use-foreign-language-in-pdflatex>

Thanks,

-- 
Jacob S. Gordon
jacob.as.gor...@gmail.com

======================

Please avoid sending me HTML emails and MS Office documents.
https://useplaintext.email/#etiquette
https://www.gnu.org/philosophy/no-word-attachments.html

Reply via email to