On 10/07/2021 23:44, Stefan Nobis wrote:
Maxim Nikulin writes:
(add-to-list 'org-latex-inputenc-alist '("utf8" . "utf8x"))
so I am unaware whether \usepackage[utf8x]{inputenc} has any drawbacks.
Do not do this. Both, utf8x and ucs, are obsolete and deprecated for
quite some time.
Maybe, I have seen such warnings. However I have tested neither utf8 nor
utf8x on real examples. That is why I am unaware what can be broken in
particular. For small examples with various symbols outside of ASCII,
utf8x may give better support.
Last time I did something serious with LaTeX, bibtex was 8bit internally
(unicode version had not reached stable Linux distributions, pybtex was
buggy), so that time I used 8bit charset.
For proper unicode support, switch from pdflatex to lualatex or
xelatex. With these newer backends (and proper adjustments for the
LaTeX preamble generated by Org) Unicode should work out of the box
(if the font supports the requested Unicode characters).
Maybe my expectation from proper unicode support was too optimistic. I
see the reason why preamble is necessary with 8bit encodings. I
appreciate possibility to easily specify particular ttf or otf font. I
do not like that it is necessary to specify *all* fonts, otherwise some
characters are missed or compilation fails with error. I do not know if
new engines allows to get list of available fonts and to choose a set of
fonts with better coverage than lmodern.
I have tried LuaLaTeX with the following file. From some examples I have
found, I expect, further tuning is required. Apparent problem is missed
unicode characters in math mode. I admit that polyglossia is unavoidable
for any real text but I do not like that \set…font commands are mandatory.
\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage{russian}
\setotherlanguage{english}
\setmainfont{CMU Serif} % breaks ∞
\setsansfont{CMU Sans Serif}
\setmonofont{CMU Typewriter Text}
\begin{document}
Test¹ of superscript and ½ fraction.
\textbf{Теорема.} \emph{Пусть} $α → ∞$ и $\beta \to \infty$.
\verb=Катет= и \textsf{гипотенуза}.
Åå. Text Greek α.
\end{document}
(setq org-latex-default-packages-alist
'(("AUTO" "inputenc" t ("pdflatex"))
("T1" "fontenc" t ("pdflatex"))
I just have realized that fontenc behavior should be similar to inputenc
and babel, e.g. something like \usepackage[T1,T2A]{fontenc} should be
used for Russian.