Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I work in humanities, so please forgive my lack of competence and the weirdness of my computing needs. Is there a way to make this work? I need to use three (for starters) languages in the same document. Lithuanian (L7x), polish (LaTeX seems to render it fine without stating \usepackage{polski}) and russian (T2A). I get the error message below as soon as I introduce any third language-specific symbol into the document.

! TeX capacity exceeded, sorry [input stack size=5000].\L ->\L7x-cmd \L 
                 \L7x\L 
l.9 ĄąĆćĘęŁ
                  łŃńÓóŻż
!  ==> Fatal error occurred, no output PDF file produced!

Russian+lithuanian works fine, but a single "ł" triggers an error. The same with russian+polish and a "ė". A cyrillic character only causes non-fatal error (msg. below) for each symbol and cyrillic text is simply ignored in the output file.

! Package inputenc Error: Unicode char \u8:ц not set up for use with LaTeX.

Here is a MWE

\documentclass{article}
\usepackage[L7x,T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[lithuanian,russian]{babel}
\begin{document}
%lithuanian    
ĄąČčĘęĖėĮįŠšŲųŪūŽž
%russian
БбЖжЬьЯяЭэЩщШшПпЦц
%polish
ĄąĆćĘꣳŃńÓóŻż
\end{document}
share|improve this question
2  
The first error looks like a bug in L7x. The second is the standard message if a character hasn't been setup yet (and is easy to adjust). If you use various language you normally have to inform latex about language switches (\selectlanguage{XVY}) so that latex can e.g. change font encodings. Perhaps the errors disappears then. But before everyone try to debug your example: Did you consider to use xelatex? –  Ulrike Fischer Feb 3 '12 at 8:26
    
On the face of it, it sounds like you need to think about moving to Xe(La)TeX (or LuaTeX) and UTF-8 –  Brent.Longborough Feb 3 '12 at 9:40
    
Yes, actually, I did consider that, just did not quite get around to it, since I'm still probing possibilities of LaTeX. I promise to think about it when I hit a complete dead end with LaTeX (that has local lithuanian support in one of our universities). –  Naglis Feb 3 '12 at 15:57

1 Answer 1

up vote 6 down vote accepted

There is a bug in l7xenc.def that, as far as I can see, can be fixed. You should also confine the languages in the proper tags. For Polish either use the T1 encoding or, if you want to stay with L7x, add its selection when switching to Polish:

\documentclass{article}
\usepackage[L7x,T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[lithuanian,polish,russian]{babel}

%%% Fix for L7x encoding
\makeatletter
\expandafter\let\csname L7x-cmd\endcsname\@changed@cmd
\makeatother

%%% Use L7x for Polish
\addto\extraspolish{\fontencoding{L7x}\selectfont}
\addto\noextraspolish{\fontencoding{\encodingdefault}\selectfont}

\begin{document}

%lithuanian
\begin{otherlanguage*}{lithuanian}
ĄąČčĘęĖėĮįŠšŲųŪūŽž
\end{otherlanguage*}

%russian
БбЖжЬьЯяЭэЩщШшПпЦц

%polish
\begin{otherlanguage*}{polish}
ĄąĆćĘꣳŃńÓóŻż
\end{otherlanguage*}

\end{document}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.