Dear all,
LyX seems to be inserting some unnecessary codes for foreign characters. When I try to type Cyrillic, the following headers are added:
\usepackage[]{fontenc}
\usepackage[utf8]{inputenc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\DeclareRobustCommand{\cyrtext}{%
\fontencoding{T2A}\selectfont\def\encodingdefault{T2A}}
\DeclareRobustCommand{\textcyr}[1]{\leavevmode{\cyrtext #1}}
\AtBeginDocument{\DeclareFontEncoding{T2A}{}{}}
These cause XeTeX to fail with the message, "Corrupted NFSS tables" (I believe it is the last command in particular, which causes the error). I have a stylesheet (before I started using LyX) which takes care of all of this in the (I believe) more modern XeTeX way. If there's a way to disable this header generation, that would be much appreciated. I believe the more modern way to achieve this is (for Cyrillic, replacing all statements above):
\usepackage{xunicode,fontspec,xltxtra}
\usepackage[english]{polyglossia}
\setotherlanguages{russian} % set as "other" so English hyphenation active
% other package imports here
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\setromanfont{CMU Serif}
\setsansfont{CMU Sans Serif}
\setmonofont{CMU Typewriter Text}
If anyone knows a way to disable the built-in headers, that would be great! Otherwise, I will probably just postprocess it with a script.
Thanks very much,
Nicholas
LyX ⇒ LyX xetex output problem with foreign languages
-
- Posts: 6
- Joined: Mon Dec 01, 2008 10:40 pm
LyX xetex output problem with foreign languages
Last edited by gatoatigrado on Fri May 07, 2010 7:02 am, edited 1 time in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.
-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
Re: xetex (xelatex) problem with foreign languages
You shouldn't be using inputenc with XeTeX: it is natively UTF-8. Try removing that package, then see what happens.
Joseph Wright
-
- Posts: 6
- Joined: Mon Dec 01, 2008 10:40 pm
Re: xetex (xelatex) problem with foreign languages
I know, these are things LyX inserts. If one selects no input encoding, it inserts all of the LaTeX escape codes. I'll rename the title so it's more clear. Thanks anyway though.
-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
LyX xetex output problem with foreign languages
That sounds like a Lyx bug, really. With UF-8 input, XeTeX should be used "as is". Can you try compiling an example using XeLaTeX directly, rather than via Lyx, and see what happens?
Joseph Wright
Re: LyX xetex output problem with foreign languages
also has the probem with my Lyx 1.6.5
I workaround the problem by modify Lyx-> Tools-> preference
In the language settings section, uncheck box e.g. use babel etc
In the Output->Latex section,clear the "Tex encoding" field
You can view the tex source to ensure these unwelcome generated tex is removed.
Any better solution?
I workaround the problem by modify Lyx-> Tools-> preference
In the language settings section, uncheck box e.g. use babel etc
In the Output->Latex section,clear the "Tex encoding" field
You can view the tex source to ensure these unwelcome generated tex is removed.
Any better solution?