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
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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
Re: xetex (xelatex) problem with foreign languages
-
- Posts: 6
- Joined: Mon Dec 01, 2008 10:40 pm
Re: xetex (xelatex) problem with foreign languages
-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
LyX xetex output problem with foreign languages
Re: LyX xetex output problem with foreign languages
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?