From 9a0bff791e3b04d7a8b0d074d55161d25651b75f Mon Sep 17 00:00:00 2001 From: milde Date: Wed, 24 Aug 2011 13:31:05 +0000 Subject: [PATCH] Self-documentation the "Cyrillic with LaTeX" functional test. git-svn-id: https://docutils.svn.sourceforge.net/svnroot/docutils/trunk@7101 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- docutils/test/functional/expected/cyrillic.tex | 24 +++++++++++++++++++++- .../test/functional/expected/xetex-cyrillic.tex | 22 ++++++++++++++++++++ docutils/test/functional/input/cyrillic.txt | 18 ++++++++++++++++ docutils/test/functional/tests/latex_cyrillic.py | 2 +- 4 files changed, 64 insertions(+), 2 deletions(-) diff --git a/docutils/test/functional/expected/cyrillic.tex b/docutils/test/functional/expected/cyrillic.tex index 74afd3ec2..d0d251b5c 100644 --- a/docutils/test/functional/expected/cyrillic.tex +++ b/docutils/test/functional/expected/cyrillic.tex @@ -18,9 +18,12 @@ %%% Fallback definitions for Docutils-specific commands +% titlereference role +\providecommand*{\DUroletitlereference}[1]{\textsl{#1}} + % hyperlinks: \ifthenelse{\isundefined{\hypersetup}}{ - \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue,unicode]{hyperref} + \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue,unicode=true]{hyperref} \urlstyle{same} % normal text font (alternatives: tt, rm, sf) }{} @@ -50,4 +53,23 @@ \otherlanguage{english}{first example: \glqq{}Hello world\grqq{}.} + +%___________________________________________________________________________ + +\section*{\phantomsection% + Notes% + \addcontentsline{toc}{section}{Notes}% + \label{notes}% +} + +This example tests rendering of Latin and Cyrillic characters by the LaTeX +and XeTeX writers. Check the compiled PDF for garbage characters in text and +bookmarks. + +To work around a problem with Cyrillic in PDF-bookmarks in \DUroletitlereference{hyperref} +versions older than v6.79g 2009/11/20, the test caller \texttt{latex\_cyrillic.py} +sets \texttt{hyperref\_options} to \texttt{'unicode=true'} while \texttt{xetex\_cyrillic.py} +sets it to \texttt{'unicode=false'}. The recommended option for current +(2011-08-24) hyperref versions is \texttt{'pdfencoding=auto'}. + \end{document} diff --git a/docutils/test/functional/expected/xetex-cyrillic.tex b/docutils/test/functional/expected/xetex-cyrillic.tex index df14c6322..af07cc3bc 100644 --- a/docutils/test/functional/expected/xetex-cyrillic.tex +++ b/docutils/test/functional/expected/xetex-cyrillic.tex @@ -18,6 +18,9 @@ %%% Fallback definitions for Docutils-specific commands +% titlereference role +\providecommand*{\DUroletitlereference}[1]{\textsl{#1}} + % hyperlinks: \ifthenelse{\isundefined{\hypersetup}}{ \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue,unicode=false]{hyperref} @@ -50,4 +53,23 @@ \otherlanguage{english}{first example: "Hello world".} + +%___________________________________________________________________________ + +\section*{\phantomsection% + Notes% + \addcontentsline{toc}{section}{Notes}% + \label{notes}% +} + +This example tests rendering of Latin and Cyrillic characters by the LaTeX +and XeTeX writers. Check the compiled PDF for garbage characters in text and +bookmarks. + +To work around a problem with Cyrillic in PDF-bookmarks in \DUroletitlereference{hyperref} +versions older than v6.79g 2009/11/20, the test caller \texttt{latex\_cyrillic.py} +sets \texttt{hyperref\_options} to \texttt{'unicode=true'} while \texttt{xetex\_cyrillic.py} +sets it to \texttt{'unicode=false'}. The recommended option for current +(2011-08-24) hyperref versions is \texttt{'pdfencoding=auto'}. + \end{document} diff --git a/docutils/test/functional/input/cyrillic.txt b/docutils/test/functional/input/cyrillic.txt index 6d97ce3e1..2696522ff 100644 --- a/docutils/test/functional/input/cyrillic.txt +++ b/docutils/test/functional/input/cyrillic.txt @@ -10,3 +10,21 @@ Title first example: "Hello world". +.. class:: language-en + +Notes +----- + +This example tests rendering of Latin and Cyrillic characters by the LaTeX +and XeTeX writers. Check the compiled PDF for garbage characters in text and +bookmarks. + +To work around a problem with Cyrillic in PDF-bookmarks in `hyperref` +versions older than v6.79g 2009/11/20, the test caller ``latex_cyrillic.py`` +sets ``hyperref_options`` to ``'unicode=true'`` while ``xetex_cyrillic.py`` +sets it to ``'unicode=false'``. The recommended option for current +(2011-08-24) hyperref versions is ``'pdfencoding=auto'``. + + + + diff --git a/docutils/test/functional/tests/latex_cyrillic.py b/docutils/test/functional/tests/latex_cyrillic.py index 2b239897b..9003f1d4f 100644 --- a/docutils/test/functional/tests/latex_cyrillic.py +++ b/docutils/test/functional/tests/latex_cyrillic.py @@ -9,7 +9,7 @@ writer_name = "latex" # Extra setting we need -settings_overrides['hyperref_options'] = 'unicode' +settings_overrides['hyperref_options'] = 'unicode=true' settings_overrides['font_encoding'] = 'T1,T2A' settings_overrides['stylesheet'] = 'cmlgc' settings_overrides['language_code'] = 'ru' -- 2.11.4.GIT