HI again, All this discussion has led me to rename org-latex-babel-fontspec to org-latex-babel-font-config to align with the rest. This variable stores a font configuration and using fontspec sort of may have been confusing since we have the fontspec package floating around.
An example of a directory local configuration that I would use for any of the three new font configuration strategies is: ``` ((org-mode . ((org-latex-fontspec-config ;;. nil) . (("main" :font "CMU Serif") ("mono" :font "DejaVu Sans Mono" :features "Scale=MatchLowercase"))) (org-latex-fontspec-default-features . (("Ligatures" . "TeX"))) (org-latex-polyglossia-font-config . (("el" :font "Noto Serif" :props "Script=Greek"))) (org-latex-babel-font-config . (("el-polyton" :fonts (("rm" . "Noto Serif"))) (nil :fonts (("rm" . "Noto Serif") ("sf" . "Noto Sans") ("tt" . "Noto Sans Mono")))))))) ``` Best, /PA On Mon, 28 Jul 2025 at 07:50, Pedro Andres Aranda Gutierrez <paag...@gmail.com> wrote: > > On Sun, 27 Jul 2025 at 15:02, Ihor Radchenko <yanta...@posteo.net> wrote: > > > > Pedro Andres Aranda Gutierrez <paag...@gmail.com> writes: > > > > > 1. Docs should be in sync with your last comments. > > > > Thanks! > > Some more comments: > > > > > + The language codes supported by Org is stored in the variable > > > + ~org-latex-language-alist~. > > > > *are stored > > Fixed > > > > > > + By default, it is ~nil~ and multi-language documents are controlled > > > + by importing the package with the ~#+LATEX_HEADER~ keyword. Use > > > + =AUTO= in the package options to include language information. > > > > This is confusing. We should refer to later sections for more > > information. Otherwise, it is not clear which "package options" the > > paragraph is referring to. > > Added an example and clarified in text. > > > Also, I think that we should emphasize more that users are responsible > > for configuring multi-language setup by themselves for ~nil~. > > Done > > > > +The LaTeX export backend can handle documents for non-English > > > +audiences and documents with multiple languages with the LaTeX > > > +packages =babel= or =polyglossia=. > > > > with ... with ... sounds weird to me. > > using the LaTeX packages > > > > + ... It will use the =LANGUAGE= keyword, > > > +if present in the document or the value of > > > > *, if present in the document, (you missed comma) > > Fixed, thanks > > > > +~org-export-default-language~ to determine the languages used in a > > > +document. If this value is a comma-separated list of languages, it > > > > *space-separated > > Right > > > > > +If you use =polyglossia=, you can control the fonts used for different > > > +languages in the PDF output with the variable > > > +~org-latex-polyglossia-font-config~. > > > +#+vindex: org-latex-polyglossia-font-config > > > + > > > +If you use =babel=, you can control the fonts used for different > > > +languages in the PDF output with the variable > > > +~org-latex-babel-font-config~. > > > > 1. In the code, there is only `org-latex-babel-fontspec' > > Right, comes from prior iteration > > > 2. I am wondering if we can somehow unify these two variables. > > Can they have the same value? Or will it create problems for > > polyglossia vs babel specifications? At least, the variable value > > format should be the same to avoid confusion. > > The tree variables are separated, because they may cause confusion. > > > > +When ~org-latex-multi-lang-driver~ is ~nil~, the value of > > > > I find the customization name slightly out of our general terminology. > > What about changing it to `org-latex-multi-lang-backend`? > > That will be in line with the existing `org-latex-src-block-backend'. > > Give me some time to think about this. I'd like to read through the > code again to see > why I chose driver vs backend. > > > > > > +For example: > > > + > > > +#+BEGIN_SRC org :results none :exports code > > > +,#+LANGUAGE: de > > > +,#+LATEX_COMPILER: pdflatex > > > +,#+LATEX_HEADER: \usepackage[AUTO,en-gb]{babel} > > > +#+END_SRC > > > > What will happen when user specifies multiple languages like > > #+LANGUAGE: de es > > ? > Added: AUTO is replaced with the first in the list. > (I didn't touch anything in that part of the code and it is querying > the :language property as it was before) > > > > > +in a first stage. This will then generate > > > + > > > +#+BEGIN_SRC latex :results none :exports code > > > +\usepackage[main=ngerman,british]{babel} > > > +#+END_SRC > > > > I am not sure if we need this level of details. We immediately said > > "de"->"ngerman" in the original version of the manual. > > I have commented this part out. Just in case we want to recover it. > > > > > +~pdflatex~ uses packages to import the fonts that will be used in the > > > +PDF output. Refer to [[https://tug.org/FontCatalogue/][the LaTeX font > > > +catalogue]] to find the LaTeX package or packages you need for your > > > +document and include them with the ~#+LATEX_HEADER:~ keyword. > > > > Maybe "pdflatex uses separate packages to import non-standard fonts..."? > > Rather not, because, IMV, there are no 'non-standard' fonts, all come > from official > LaTeX packages. > > > > +Since the exporter handles the ~fontenc~ package, you will not need > > > +to include that. Include the other commands in your document header: > > > > Maybe "By default, LaTeX export includes the ~fontenc~ package > > automatically (see ~org-latex-default-packages-alist~), so you do > > not need to include that. Other commands need to be included manually:" > > OK > > > > +#+cindex: latex backend configuratiom > > > > *language backend maybe? > > Right > > > > +The LaTeX templates in Org mode may include the =[FONTSPEC]= keyword, > > > > We should probably directly refer to `org-latex-classes' and the > > relevant section of the manual. > > > > > +package manual]] Part II. This variable be set in your Emacs > > > > *should be set > > OK > > > > > +initialisation code, in the file local variables or in the > > > [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html][directory > > > +local variable file]] ~.dir-locals.el~[fn:49] . > > The link to online Emacs manual is redundant. You already give one in > > the footnote #49. > > OK > > > Also, the footnote is short enough to be made inline. As per > > doc/Documentation_Standards.org > > > > - Prefer inline footnote definition when a footnote consists of a > > single sentence. > > Will need to learn how to renumber the footnotes ;-) > > > > If do not want or need any specific configuration for the ~fontspec~ > > > > *If you > > Fixed > > > > > > package, make sure ~org-latex-fontspec-config~ is set to ~nil~ (this > > > > *make sure that > > OK > > > I am also wondering if we can unify this variable with > > `org-latex-polyglossia-font-config' and `org-latex-babel-font-config'. > > I'd rather keep them apart. The mechanics are different, the font options too. > A unification may have result in people using the wrong options for > the LaTeX package they intend to use. > Let's spare a couple pain-killers ;-) > > > > > -- > > Ihor Radchenko // yantar92, > > Org mode maintainer, > > 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> > > > > -- > Fragen sind nicht da, um beantwortet zu werden, > Fragen sind da um gestellt zu werden > Georg Kreisler > > Sagen's Paradeiser, write BE! > Year 1 of the New Koprocracy -- Fragen sind nicht da, um beantwortet zu werden, Fragen sind da um gestellt zu werden Georg Kreisler Sagen's Paradeiser, write BE! Year 1 of the New Koprocracy