XeTeXXeLaTeX + NonUTF encoding + ListOfFigures

Information and discussion about XeTeX, an alternative for pdfTeX based on e-Tex
Post Reply
fomin
Posts: 10
Joined: Thu Jun 17, 2010 10:52 am

XeLaTeX + NonUTF encoding + ListOfFigures

Post by fomin »

Hello all.

I have problem with processing with XeLaTeX files in Cyrillic "cp1251" encoding.
Let's consider attached minimal working sample (see attached file for consistency).

Code: Select all

\documentclass{book}
\usepackage{xecyr}
\XeTeXdefaultencoding "cp1251"
\XeTeXinputencoding   "cp1251"
\usepackage[english,russian]{babel}
\usepackage{xltxtra}
\setmainfont{Calibri}

\begin{document} 

\begin{figure}
Figure 1/Иллюстрация 1
\caption{Figure 1/Иллюстрация 1}
\end{figure}

\begin{figure} 
Figure 1/Иллюстрация 2
\caption{Figure 1/Иллюстрация 2}
\end{figure}

\begin{figure}
Figure 1/Иллюстрация 3
\caption{Figure 1/Иллюстрация 3}
\end{figure}

\listoffigures
\end{document}
After processing by xelatex we have 3-page PDF.

The problem appears on page 3, where \listoffigures expanded.
Captions in the List of figures expanded in wrong encoding ("UTF-8" over "cp-1251").

The xxx.lof file in "UTF-8" encoding.

The same problem with
\listofalgorithms
\listoffigures
\listoftables

What can I do?

Thanks all in advance,
Sincerely, Stas Fomin
Attachments
xelatex-encoding-problem.book.tex
Source of minimal working sample.
(515 Bytes) Downloaded 434 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

XeLaTeX + NonUTF encoding + ListOfFigures

Post by meho_r »

AFAIK, Xe(La)TeX does not work with other encodings but with utf8 only, so you really should use utf8. Also, you should use polyglossia package for multilanguage support instead of using babel. Depending on which language you've chosen to be the "main" one, your LOF will be titled as "List of figures" or "Список иллюстраций". Take a look at polyglossia documentation for more infos. E.g.:

Code: Select all

\documentclass{book}

\usepackage{xltxtra}
\setmainfont{Calibri}% I don't have this font so I tested with another one. Make sure it supports russian/cyrillic.

\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{russian}

\begin{document} 

\begin{figure}

Figure 1/Иллюстрация 1
\caption{Figure 1/Иллюстрация 1}
\end{figure}

\begin{figure} 
Figure 1/Иллюстрация 2
\caption{Figure 1/Иллюстрация 2}
\end{figure}

\begin{figure}
Figure 1/Иллюстрация 3
\caption{Figure 1/Иллюстрация 3}
\end{figure}

\listoffigures
\end{document}
fomin
Posts: 10
Joined: Thu Jun 17, 2010 10:52 am

XeLaTeX + NonUTF encoding + ListOfFigures

Post by fomin »

Thank you.
Xe(La)TeX does not work with other encodings but with utf8 only
Is it really not possible to work with xelatex and "cp1251" encoding?

We really tied to "cp1251":
  • A lot of sources with ten years history under CVS
  • Our team used TexnicCenter v1. (non-UTF).
    BTW, TexnicCenter-2 that can use UTF, but still very buggy (alpha version).
  • Also we successfully use xelatex and "cp1251"-sources for producing beamer slides.
May be some magic options or workaround exists for this?
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

XeLaTeX + NonUTF encoding + ListOfFigures

Post by meho_r »

I really don't know. If you don't get any replies here, you may try XeTeX mailing list.
Post Reply