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'm trying to make use of this solution to get list of problems.

I'm using XeTeX, and if I use non-english as a problem name -- hyperref's links to problem in "List of problems" doesn't work.

Here's a MWE:

\documentclass{book}

% =====================
%% XeTeX customization:

\usepackage{fontspec} % enagles loading of OpenType fonts
\usepackage{polyglossia} % support for languages

% fonts:
\defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text} % without this XeLaTeX won't turn "--" into dashes
\setmainfont{Arial}
\setsansfont{Arial}
\setromanfont{Arial}
\setmonofont{DejaVu Sans Mono}

% Russian/English document:
\usepackage{xecyr}
\newfontfamily\cyrillicfont{Arial}

\setmainlanguage{russian}
\setdefaultlanguage{russian}
\setotherlanguage{english}


% =======================
%% hyperref and ntheorem:

\usepackage[hyperref]{ntheorem}
\theoremlisttype{all}

\makeatletter
\newtheoremstyle{problem}
  {\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\theorem@separator]}%
  {\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\theorem@separator]}
\makeatother
\theoremstyle{problem}
\newtheorem{Задача}{Задача}[chapter]

\usepackage{hyperref}


\begin{document}

\chapter*{List of problems}
\listtheorems{Задача}

\chapter{foo}

\begin{Задача}[Short foo name]
  Foo!
\end{Задача}

\chapter{bar}

\begin{Задача}[Short bar name]
  Bar!
\end{Задача}

\end{document}

It needs to be compiled with xelatex. I want to get clickable list of problems.

I tried to add some options to hyperref:

\hypersetup{xetex,
  unicode=true,
  pdfencoding=unicode,
  bookmarks={true},
}

it doesn't work.

Edit:

Versions:

ntheorem 1.31 
hyperref 6.82q
polyglossia 1.2.1
xecyr 1.0

Complete compile log is here.

Edit 2:

Here's thm file on request of egreg:

\contentsline {Задача}{{Задача}{1.{1}}{Short foo name}}{3}{Задача.1.1}
\contentsline {Задача}{{Задача}{2.{1}}{Short bar name}}{5}{Задача.2.1}

With the solution I posted below the same file is

\contentsline {problem}{{Задача}{1.{1}}{Short foo name}}{3}{problem.1.1}
\contentsline {problem}{{Задача}{2.{1}}{Short bar name}}{5}{problem.2.1}
share|improve this question
    
I have no issue. What TeX distribution do you have? –  egreg Feb 17 '13 at 18:54
    
texlive 2012 quantal package. Are You sure You get clickable links in list of problems? –  Adobe Feb 17 '13 at 19:02
    
Yes; I get links named "1.1 Short foo name" and "1.2 Short bar name" that take to "Задача 1.1" and "Задача 1.2", respectively. –  egreg Feb 17 '13 at 19:07
    
I've posted versions of some packages. What could it be? –  Adobe Feb 17 '13 at 19:08
    
I have ntheorem 1.33, hyperref 6.83m, polyglossia 1.2.1, xecyr 1.0; in particular, version 1.32 of ntheorem did something about lists of theorems. –  egreg Feb 17 '13 at 19:18
show 5 more comments

1 Answer

Oh I solved it:

\documentclass{book}

% =====================
%% XeTeX customization:

\usepackage{fontspec} % enagles loading of OpenType fonts
\usepackage{polyglossia} % support for languages

% fonts:
\defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text} % without this XeLaTeX won't turn "--" into dashes
\setmainfont{Arial}
\setsansfont{Arial}
\setromanfont{Arial}
\setmonofont{DejaVu Sans Mono}

% Russian/English document:
\usepackage{xecyr}
\newfontfamily\cyrillicfont{Arial}

\setmainlanguage{russian}
\setdefaultlanguage{russian}
\setotherlanguage{english}


% =======================
%% hyperref and ntheorem:

\usepackage[hyperref]{ntheorem}
\theoremlisttype{all}

\makeatletter
\newtheoremstyle{problem}
  {\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\theorem@separator]}%
  {\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\theorem@separator]}
\makeatother
\theoremstyle{problem}
\newtheorem{problem}{Задача}[chapter]

\usepackage{hyperref}


\begin{document}

\chapter*{List of problems}
\listtheorems{problem}

\chapter{foo}

\begin{problem}[Short foo name]
  Foo!
\end{problem}

\chapter{bar}

\begin{problem}[Short bar name]
  Bar!
\end{problem}

\end{document}

The trick is to have problem as an internal problem name:

\newtheorem{problem}{Задача}[chapter]

and generate list of problems with:

\listtheorems{problem}

Sample problem:

\begin{problem}[Short foo name]
  Foo!
\end{problem}

Still after compilation I get Задача as a problem name.

Despite this solves the problem I'd like to mention that egreg who have a newer xelatex distriburion don't get an issue at all.

share|improve this answer
add comment

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.