emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [possible patch] Basic fontspec code for LuaLaTeX and XelaTeX (was "


From: Max Nikulin
Subject: Re: [possible patch] Basic fontspec code for LuaLaTeX and XelaTeX (was "LaTeX export: when is it more useful...")
Date: Mon, 11 Jul 2022 19:31:24 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1

On 11/07/2022 03:23, Juan Manuel Macías wrote:

3. A variable (something like 'org-latex-fontspec-default-configuration') would 
return something like this:

(format
  \\usepackage{iftex}
  \\ifpdftex

I like the idea of unified preamble suitable for pdflatex and lualatex. For pdftex \usepackage[...]{fontenc} line may be added here.

  \\relax
  \\else

Is it the case of latex as the old engine with tex->dvi->ps workflow besides new XeTeX and LuaTeX? However such engine is not used by Org.

  \\usepackage{fontspec}
  \\usepackage{unicode-math}
  \\defaultfontfeatures{Scale=MatchLowercase}
  \\defaultfontfeatures[\\rmfamily]{Ligatures=TeX}
  \\setmainfont{%s}
  \\setsansfont{%s}
  \\setmonofont{%s}
  \\fi
  org-latex-fontspec-mainfont
  org-latex-fontspec-sansfont
  org-latex-fontspec-monofont)

Too many variables to my taste. It can be single property list. If I remember correctly, changing of mainfont requires setting of a consistent font for mathematics, so more options may be required.

ox-latex has some code searching for e.g. \usepackage[...]{inputenc} in the current configuration to avoid adding of extra copy. It would be great to have something similar for fontspec commands. I guess, it is harder to detect, since per-language font configuration may be required as babel options.

Finally, default value may be language-dependent or alternative font set may be activated when non-latin characters are detected in the document.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]