Hi,
On 21/10/25 19:57, Ihor Radchenko wrote:
Let's move on to the other parts of the manual.
For "Controlling the font configuration for PDFLaTeX", I found one
promising link for language-specific font configuration:
https://en.wikibooks.org/wiki/LaTeX/Internationalization#Specific_languages
I have included a reference to this page and the PDF version of the
whole at the beginning of the font/language management discussion
The LaTeX templates in Org mode may include the =[FONTSPEC]= keyword
(see ~org-latex-classes~), which acts as a placeholder for font
specification code. By default, Org mode places the font specification
code at the beginning of the generated LaTeX output.
It is not clear what "the beginning of the generated LaTeX output"
refers to.
Reworded
When using ~lualatex~ or ~xelatex~ as your =LATEX_COMPILER=, you can
control the fonts used in the PDF using the ~fontspec~. Setting
variable ~org-latex-multi-lang~ to ~t~ enables optimised ~fontspec~
configuration.
We should probably refer to LATEX_MULTI_LANG export option (which
includes keyword + variable)
OK
Org mode will load ~fontspec~ for ~polyglossia~ and ~babel~. When
*automatically load
Reworded
using ~polyglossia~, you can combine ~fontspec~ and
~polyglossia~-specific configuration. Font configuration will use a
different mechanism [[#babel-fontconfig][when using ~babel~]].
If you do not want or need any specific configuration for the
~fontspec~ package, make sure that ~org-latex-fontspec-config~ is set
to ~nil~ (this is the default value). This is normally the case when
exporting to ~beamer~, where you most probably want to use the fonts
defined in the template.
If beamer requires special font handling, I recommend making
fontspec-config into an export option that can be overridden by derived
backends. WDYT?
Wouldn't this complicate things? You manage everything with the
[FONTSPEC] in the templates.
When this is the case, the LaTeX process will complain and Emacs will
warn you. Using the list of scripts detected in the buffer, which it
always generates during the export process in the *=*Messages*=*
buffer, you can declare the fallback fonts for missing scripts, using
~:fallback~ property for this purpose. It links to an associative
list that maps the script names as detected by Emacs with their
fallback configuration.
I am wondering if the missing scripts should be displayed in *Warnings*
No IMHO... because you will get it when the PDF is produced correctly.
You may use any font name used in the ~\set..font{}~ command by the
~fontspec~ package. For example, when using XeLaTeX, you can
compose Chinese, Japanese or Korean test using the ~xeCJK~ and
~xpinyin~ packages. These packages define the ~\\setCKJmainfont{}~,
~\\setCJKsansfont{}~ and ~\\setCJKmonofnt{}~ commands. Use the
~CJKmain~, ~CJKsans~ and ~CJK mono~ definitions in your documents to
customise them:
We should probably provide an example of loading these packages. Just to
make this part of the manual copy-pasteable for users.
Maybe, but I would rather call for contributions once the code is (at
least) in master and we see there is interest in it. I need the help of
native speakers using code (here and for other languages like Arabic and
Hebrew) to come up with effective examples.
#+BEGIN_SRC elisp :results none :exports code
(setq org-latex-babel-font-config
'(("el-polyton"
:fonts (("rm" :font "Noto Serif")))
(nil
:fonts (("rm" :font "CMU Serif")
("tt" :font "DejaVu Sans Mono"
:props"Scale=Matchlocase"))))))
#+END_SRC
The parenthesis are unbalanced.
Done
Also, what do you think about adding a paragraph describing differences
from polyglossia? In particular, that babel can do per-language *and*
per-script, while polyglossia only does per-language.
\babelprovide[onchar=ids fonts]{portuguese}
I think it is worth explaining what onchar will do.
(Hopefully) done.
/PA