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

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

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

> Org mode will load ~fontspec~ for ~polyglossia~ and ~babel~. When

*automatically load

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

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

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

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

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.

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

Reply via email to