[Top][All Lists]

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

Re: org-mode export to (latex) PDF

From: Maxim Nikulin
Subject: Re: org-mode export to (latex) PDF
Date: Fri, 16 Jul 2021 00:10:19 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

On 15/07/2021 02:05, Stefan Nobis wrote:
Maxim Nikulin writes:

There are cm-super fonts for at least of 15 years.

There are many tradeoffs in many aspects. No single font pleases
everyone. So you want to say: Your requirements are more
important/common/stylish/whatever that the requirements of other

I hope, it is possible to make Org export to PDF working out of the box for more people. Surprisingly Unicode TeX engines besides alleviating of some limitations of earlier implementation bring new burden. I see no problem to fix support of Cyrillic in PdfTeX. I have not realized if it can be done for LuaTeX or XeTeX despite original expectation that support of Unicode means that there should be no problem for any character of any script. I started to discuss Russian because it is a language for which most of problems are apparent for me. Perhaps a similar approach can be used for other scripts.

Before UTF-8 became wide spread on Linux, there were guides how to enable support of Cyrillic in e.g. Netscape Navigator. Now such problems are forgotten. Is it achievable for TeX?

In CSS it is possible to specify a list of fonts and a glyph is taken from the first font where it is present. Despite particular fonts have limited coverage, I see wide range of Unicode characters on web pages, that is why I am almost sure that system font libraries combine fonts.

Do Unicode TeX engines support such combination of fonts? Is it efficient enough to be used by default? Is it possible to write reasonably complete config for such purpose? It is preferable to have such config as a LaTeX style file, but it may be implemented in Org code as well.

There are two quite distinct cases: documents with carefully chosen fonts (e.g. a book) and everyday notes when particular font is not so important. For the former case a glyph taken from wrong font is a serious error. For the latter one, likely even low quality font is significantly better than a missed character. I think, both cases should be supported however.

Thank you for the hint. Do you think Org should use it by default?
Are there any caveats?

Yes, unicode-math should be seen as must have for lualatex and xelatex
(if math is used). As far as I know there are no downsides and it
should be part of the default packages (but only for lualatex and
xelatex, not for pdflatex).

Maybe it is possible to scan the document for presence of character from specific category, range, etc., to avoid overhead when the package is not necessary.

Is it possible to detect lualatex and xelatex in runtime?

Yes, that is possible. The LaTeX package iftex provides macros to
execute commands based on the running engine (see

I mean detection if LuaLaTeX or XeLaTeX is usable from Org code. The intention is to minimize customization required before successful export. Ideally Org should guess reasonable configuration form content of the document and available external tools (and maybe freeze it by adding properties to the document to make next compilations faster). Certainly user should have a way to force fixed values by disabling autoconfiguration as a whole or only for particular settings.

Is it possible to provide reasonable defaults for fonts?

I do not think so. You want Cyrillic. But what about Japanese,
Chinese, Devanagari, Tamil, Arabic etc? I doubt that there exists a
single font that supports all these scripts satisfactorily.

I hope, single font is not necessary since other applications can show all scripts simultaneously. Of course, my example was not complete, feel free to extend it, e.g.

Randomly chosen examples: "日本", "多喝水", "📞".

reply via email to

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