[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[possible patch] Basic fontspec code for LuaLaTeX and XelaTeX (was "LaTe
From: |
Juan Manuel Macías |
Subject: |
[possible patch] Basic fontspec code for LuaLaTeX and XelaTeX (was "LaTeX export: when is it more useful...") |
Date: |
Sun, 10 Jul 2022 20:23:00 +0000 |
Considering some discussions in the parent thread, I think maybe it
wouldn't hurt to ensure a minimal preamble when the output is compiled
with LuaLaTeX or XelaTeX, so that some very basic fontspec configuration
is loaded to be able to read PDFs in non-Latin scripts.
But before proposing the patch directly, I'd like to discuss its
structure. I think (IMHO) that a certain balance should be ensured
between a) users who don't want to mess with fontspec and want something
more out-of-the-box and b) users who prefer to be in control when
compiling with LuaTeX and XeTeX.
I think maybe it would be nice to let LaTeX do the work, via a
conditional from the iftex package (idea taken from pandoc).
The structure of the patch could be this:
1. There could be a defcustom, something like 'org-latex-use-fontspec'
(I would vote for nil by default).
2. There would be three variables for the default fonts: roman, sans and
mono. By default, the FreeSerif, FreeSans and FreeMono fonts could be
set as default value, since they are very ubiquitous and have a very
good coverage for non-Latin scripts.
3. A variable (something like 'org-latex-fontspec-default-configuration') would
return something like this:
(format
\\usepackage{iftex}
\\ifpdftex
\\relax
\\else
\\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)
(and this string would be added at some point to org-latex-make-preamble)
4. Conclusion: I think the good thing about letting LaTeX do the
conditional work with iftex is that it saves us less invasive code on
our end. I also think that other more complex approaches, such as
searching for the fonts present in the system and adding them according
to the document scripts, would lead us to a completely slippery slope.
Of course, a list of recommended free-licensed fonts could be included
in the documentation.
WDYT?
Best regards,
Juan Manuel
- Re: M-x org-create-worg-article command? (was: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?), (continued)
- Re: M-x org-create-worg-article command? (was: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?), Ihor Radchenko, 2022/07/10
- Re: M-x org-create-worg-article command? (was: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?), Tim Cross, 2022/07/10
- Re: M-x org-create-worg-article command? (was: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?), Ihor Radchenko, 2022/07/10
- Re: M-x org-create-worg-article command? (was: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?), Tim Cross, 2022/07/11
- Re: M-x org-create-worg-article command? (was: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?), Ihor Radchenko, 2022/07/11
- Re: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?, Juan Manuel Macías, 2022/07/10
- Re: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?, Juan Manuel Macías, 2022/07/09
- Re: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?, Max Nikulin, 2022/07/09
- Re: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?, Juan Manuel Macías, 2022/07/09
- Message not available
- Re: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?, Juan Manuel Macías, 2022/07/09
- [possible patch] Basic fontspec code for LuaLaTeX and XelaTeX (was "LaTeX export: when is it more useful..."),
Juan Manuel Macías <=
- Re: [possible patch] Basic fontspec code for LuaLaTeX and XelaTeX (was "LaTeX export: when is it more useful..."), Juan Manuel Macías, 2022/07/10
- Re: [possible patch] Basic fontspec code for LuaLaTeX and XelaTeX (was "LaTeX export: when is it more useful..."), Tim Cross, 2022/07/10
- Re: [possible patch] Basic fontspec code for LuaLaTeX and XelaTeX (was "LaTeX export: when is it more useful..."), Juan Manuel Macías, 2022/07/11
- Re: [possible patch] Basic fontspec code for LuaLaTeX and XelaTeX (was "LaTeX export: when is it more useful..."), Ihor Radchenko, 2022/07/10
- Re: [possible patch] Basic fontspec code for LuaLaTeX and XelaTeX (was "LaTeX export: when is it more useful..."), Stefan Nobis, 2022/07/11
- Re: [possible patch] Basic fontspec code for LuaLaTeX and XelaTeX (was "LaTeX export: when is it more useful..."), Timothy, 2022/07/11
- Re: [possible patch] Basic fontspec code for LuaLaTeX and XelaTeX (was "LaTeX export: when is it more useful..."), Juan Manuel Macías, 2022/07/11
- Re: fontsets (was: [possible patch] Basic fontspec code for LuaLaTeX and XelaTeX (was "LaTeX export: when is it more useful...")), Timothy, 2022/07/11
- Re: fontsets, Juan Manuel Macías, 2022/07/11
- Re: fontsets, Stefan Nobis, 2022/07/12