emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [PATCH] ox-latex.el: Unify in one single list Babel and Polyglossia


From: Juan Manuel Macías
Subject: Re: [PATCH] ox-latex.el: Unify in one single list Babel and Polyglossia languages alists
Date: Fri, 15 Jul 2022 14:36:07 +0000

Max Nikulin writes:

> I have tried on Ubuntu-20.04 LTS focal (Latest LTS is 22.04 jammy).
> Without explicit fontenc it may work, but emits a warning
>
> Package babel Warning: No Cyrillic font encoding has been loaded so far.
> (babel)                A font encoding should be declared before babel.
> (babel)                Default `T2A' encoding will be loaded  on input
> line 74.

Yeah, that's something I forgot to mention. The warning is from
russianb.ldf:

-------------
\ifx\cyrillicencoding\undefined
  \if@uni@ode
    %\ifdefined\XeTeXrevision
    %  \edef\cyrillicencoding{EU1}
    %\else\ifdefined\luatexversion
    %  \edef\cyrillicencoding{EU2}
    %\fi\fi
    \edef\cyrillicencoding{TU}
  \else
    \edef\cyrillicencoding{T2A}
  \fi
  \PackageWarning{babel}%
    {No Cyrillic font encoding has been loaded so far.\MessageBreak
     A font encoding should be declared before babel.\MessageBreak
     Default `\cyrillicencoding' encoding will be loaded
    }%
  \lowercase\expandafter{\expandafter\input\cyrillicencoding enc.def\relax}%
  \AtBeginDocument{\@setcyrillicencoding}
\fi
-------------

But there is no warning in the case of Greek, where the LGR fontencoding
is not explicitly indicated either. In any case, I have commented on
this issue on the Hispanic TeX mailing list, where Javier Bezos (current
Babel maintainer) participates. It would be interesting if he could
clarify this for us...

> Unfortunately in the case of
>
>     \usepackage[russian,english]{babel}
>
> \selectlanguage{russian} is required, without it compilation fails with
>
>    ! LaTeX Error: Command \cyrn unavailable in encoding OT1.

Yes, this is the case of the example that I put in my previous message
(russian as second language). If a explicit babel command is not added,
the T2A fontencoding is not loaded. Therefore, you would have to add a
selectlanguage{russian} or, at a low level,
\fontencoding{T2A}\selectfont

> With \usepackage[T2A]{fontenc} it behaves accordingly to acceptable
> for non-important documents graceful degradation. Text is readable,
> but no hyphenation applied.
>
> So I consider explicit loading of fontenc as more reliable.

Wouldn't it be easier in those cases to just load the fontenc package a
second time:

#+LaTeX_Header: \usepackage[T1,T2A]{fontenc}

According to what Egreg says in this thread
(https://tex.stackexchange.com/a/79112), "The only package that's
allowed to be loaded multiple times is fontenc".

So my logic is as follows: since Org has always loaded fontenc with the T1
option by default, I don't see much point in changing that behavior now
that pdfLaTeX is, so to speak, in retirement. And in any case, the user
can change (now) the fontencoding via the babel commands or by loading
the package a second time. For the record, I'm not opposed to redoing
the patch by adding the features you're proposing. Simply, from my point
of view, I think it's not worth the effort. But it's just my opinion,
and besides, I don't use pdfLaTeX, so I may have a bias here.

Best regards,

Juan Manuel 



reply via email to

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