Regression while adding unnumbered chapters to ToC?
Günter Milde
milde at users.sf.net
Thu Sep 17 11:51:08 UTC 2020
On 17.09.20, Scott Kostyshak wrote:
> On Sat, Sep 05, 2020 at 05:22:00PM +0000, V K wrote:
> > On Saturday, September 5, 2020, 08:08:20 PM GMT+3, V K <sovhist at yahoo.com> wrote:
...
> > So I opened file of the book (report class) I was writing in Lyx 2.3
> > (and it compiles) in Lyx 2.4 and it won't compile with error: "!
> > LaTeX Error: Command \k unavailable in encoding OT1." I tried various
> > options to find the cause (maybe that depends on the fact that I
> > constantly need use cyrillic Russian books in bibliography and so on
> > – some of errors while changing options pointed to cyrrilic
> > footnotes, but that can be another issue). I think I narrowed cause
> > and the problem is with ERT solutions how to insert unnumbered
> > chapter to ToC. If I remove line
> > \addcontentsline{toc}{chapter}{Įvadas} document compiles. It compiles
> > even after removing unicode letter "Į" from that line:
> > \addcontentsline{toc}{chapter}{vadas} (it compiles from the second
> > try). The same thing is with longer solution to add all unnumbered
> > chapters to ToC from there:
> > https://tex.stackexchange.com/questions/185367/add-an-unnmbered-section-to-the-table-of-contents-in-lyx
> > Line \markboth{Įvadas}{Įvadas} creates problem using fancy pagestyle
> > and removing "Į" cures that. So I can't add unnumbered chapters to
> > ToC. I changed language of the document to Latvian, English and it
> > compiles fine. Maybe the cause is that there wasn't Lithuanian .lbx
> > biblatex file till now (I created such and it is incorporated in
> > biblatex 3.15, but version in my computer is 3.14). There is a lot of
> > languages without .lbx. So this is regression?
...
I believe the reason is that in 2.3, two font encodings "T1,L7x" are
auto-loaded by lyx but in 2.4 only "L7x".
LaTeX then falls back to the legacy 7-bit font encoding "OT1" for text that
is not marked up ad Lithuanian and "OT1" does not support the ogonek accent
(\k).
Adding T1 to the additional fontenc loading in the user preamble as
\usepackage[T2A,T1]{fontenc}
solves this.
Alternatively, set "Document>Settings>Fonts>LaTeX font encoding" to
[Custom] T1,T7x
> A git bisect suggests that 29265ce7 changed the behavior. Günter, can
> you take a look?
It seems the fix for the infinite loop with \textcopyright is a second
condition required to trigger the error.
We may consider adding T1 to the auto-loaded font encodings for Lithuanian
(similar to the way we do it in Azerbaijani):
diff --git a/lib/languages b/lib/languages
index bcaf88240c..5f9a7dc82f 100644
--- a/lib/languages
+++ b/lib/languages
@@ -1074,14 +1074,14 @@ Language lithuanian
XindyName lithunian
QuoteStyle german
Encoding iso8859-13
- FontEncoding L7x
+ FontEncoding L7x,T1
# L7x defines \copyright as TextSymbol which leads to an endless loop
# when it is used in other font encodings.
PostBabelPreamble
% restore \coyright definition corrupted by l7xenc.def
\DeclareRobustCommand{\copyright}{%
\ifmmode{\nfss at text{\textcopyright}}\else\textcopyright\fi}
- \addto\noextraslithuanian{\latintext}
+ \addto\noextraslithuanian{\latintext}
EndPostBabelPreamble
DateFormats "yyyy 'm.' MMMM d 'd.'|yyyy 'm.' MMMM d 'd.'|yyyy-MM-dd"
LangCode lt_LT
Günter
More information about the lyx-devel
mailing list