Can someone explain why does compiler throw an error
\f@encoding=macro: ->T1. l.5 \makeatletter\show\f@encoding \makeatother
! TeX capacity exceeded, sorry [input stack size=5000]. \textellipsis ->\L7x-cmd \textellipsis \L7x\textellipsis l.6 \dots
If you really absolutely need more capacity, you can ask a wizard to enlarge me.
for this?
\documentclass{article}
\usepackage[L7x,T1]{fontenc}
\usepackage[utf8]{inputenc}
\begin{document}
\makeatletter\show\f@encoding\makeatother
\dots
\fontencoding{L7x}\selectfont
\makeatletter\show\f@encoding\makeatother
\dots
\end{document}
It seems that for the first \dots
it goes into L7x
table while the current font encoding is T1
.
Is that an expected behavior or a bug?
Kind regards, Ivan
Fix Proposal
Based on the analysis @David Carlisle has provided below, after digging into other encoding definitions and fntguide
I would like to present my proposal for fixing the issue within l7xenc.def
. WYSIWYM could be easily achieved replacing all these
\bgroup
\def\default@family{lmr}%
\DeclareFontEncoding{L7x}{}{}
\egroup
\@ifundefined{L7x@default@family}{\@namedef{L7x@default@family}{lmr}}{}
\def\hooked@encoding{L7x}
\DeclareRobustCommand\selectfont
{%
\ifx\f@linespread\baselinestretch
\else
\set@fontsize\baselinestretch\f@size\f@baselineskip
\fi
\ifx\f@encoding\hooked@encoding
\expandafter\ifx\csname \f@encoding+\f@family\endcsname\relax
\edef\reserved@a{\lowercase{\noexpand\IfFileExists{\f@encoding\[email protected]}}}%
\reserved@a\relax{%
\expandafter\ifx\csname\f@encoding @default@family\endcsname\relax
\else
\@font@info{Failed loading font information for \f@encoding+\f@family.}%
\expandafter\edef\expandafter\f@family\expandafter{\csname\f@encoding @default@family\endcsname}%
\fi
}%
\fi
\fi
\xdef\font@name{\csname\curr@fontshape/\f@size\endcsname}%
\pickup@font
\font@name
\size@update
\enc@update
}
by only these three lines:
\DeclareFontEncoding{L7x}{}{}
\DeclareErrorFont{L7x}{lmr}{m}{n}{10}
\DeclareFontSubstitution{L7x}{lmr}{m}{n}
In order not to get warnings (saying cmr
is substituted by lmr
) one should explicitly use statement \usepackage{lmodern}
before calling for fontenc
, satisfying what's written in fntguide
:
The font specification for
<encoding><family><series><shape>
must have been defined by\DeclareFontShape
before the\begin{document}
is reached.
Closure
I'm glad to inform you all that the above Fix Proposal has been included in the latest version of lithuanian
bundle (version 2017-12-06) maintained by Sigitas Tolušis, along with making babel
's lithuanian
agnostic of font and font encoding. Additionally, missing translations for Proof and Glossary have been defined.
lmodern
to satisfy what's required here. Personally, I never uselmodern
.