summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/tools/varioref.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-08-03 22:03:35 +0000
committerKarl Berry <karl@freefriends.org>2011-08-03 22:03:35 +0000
commitbb6fd84d0f762e045075c0e6570c68b283436888 (patch)
tree815f02eedb8c70d8f3aa0c16af9dfa3707864fe1 /Master/texmf-dist/source/latex/tools/varioref.dtx
parent366ed41f67c1c443ea09a9c442655ab1a40a270b (diff)
tools (latex-tds 2jul11)
git-svn-id: svn://tug.org/texlive/trunk@23393 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/tools/varioref.dtx')
-rw-r--r--Master/texmf-dist/source/latex/tools/varioref.dtx64
1 files changed, 45 insertions, 19 deletions
diff --git a/Master/texmf-dist/source/latex/tools/varioref.dtx b/Master/texmf-dist/source/latex/tools/varioref.dtx
index 9404a96ab21..7cf7c7eed50 100644
--- a/Master/texmf-dist/source/latex/tools/varioref.dtx
+++ b/Master/texmf-dist/source/latex/tools/varioref.dtx
@@ -22,7 +22,7 @@
% \fi
% \iffalse
%% Package varioref to use with LaTeX2e
-%% Copyright (C) 1992-2009 Frank Mittelbach, all rights reserved.
+%% Copyright (C) 1992-2010 Frank Mittelbach, all rights reserved.
%%
%% For additions or updates to the language options please contact
%% the author at
@@ -34,10 +34,10 @@
%
%<package>\NeedsTeXFormat{LaTeX2e}[1995/05/16]
%<package>\ProvidesPackage{varioref}
-%<package> [2009/09/13 v1.4w package for extended references (FMi)]
+%<package> [2010/11/12 v1.4y package for extended references (FMi)]
% \fi
%
-% \CheckSum{2150}
+% \CheckSum{2170}
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
@@ -871,18 +871,25 @@
\def\reftextpagerange#1#2{on pages~\pageref{#1}--\pageref{#2}}%
\def\reftextlabelrange#1#2{\ref{#1} to~\ref{#2}}%
}}
+% \end{macrocode}
+%
+% The esperanto strings were suggested by Albert Reiner
+% (\verb=areiner@tph.tuwien.ac.at=).
+% \changes{v1.4x}{2010/08/04}{Defaults for esperanto added}
+% \begin{macrocode}
\DeclareOption{esperanto}
- {\vref@excuse{esperanto}%
- \vref@addto\extrasesperanto{%
- \def\reftextfaceafter {on the \reftextvario{facing}{next} page}%
- \def\reftextfacebefore{on the \reftextvario{facing}{preceding}
- page}%
- \def\reftextafter {on the \reftextvario{following}{next} page}%
- \def\reftextbefore {on the \reftextvario{preceding}{previous} page}%
- \def\reftextcurrent {on \reftextvario{this}{the current} page}%
- \def\reftextfaraway#1{on page~\pageref{#1}}%
- \def\reftextpagerange#1#2{on pages~\pageref{#1}--\pageref{#2}}%
- \def\reftextlabelrange#1#2{\ref{#1} to~\ref{#2}}%
+ {\vref@addto\extrasesperanto{%
+ \def\reftextfaceafter{en la
+ \reftextvario{flanka}{sekva} pa\^go}%
+ \def\reftextfacebefore{en la
+ \reftextvario{flanka}{anta\u ua} pa\^go}%
+ \def\reftextafter{en la sekva pa\^go}%
+ \def\reftextbefore{en la anta\u ua pa\^go}%
+ \def\reftextcurrent{\reftextvario{\^ci-pa\^ge}%
+ {en \^ci tiu pa\^go}}%
+ \def\reftextfaraway#1{en pa\^go~\pageref{#1}}%
+ \def\reftextpagerange#1#2{en pa\^goj~\pageref{#1} \^gis \pageref{#2}}%
+ \def\reftextlabelrange#1#2{\ref{#1} \^gis~\ref{#2}}%
}}
% \end{macrocode}
% The finnish strings were suggested by Matti Rintala
@@ -1889,11 +1896,9 @@
%
% \begin{macro}{\vref@pagenum}
% \changes{v1.2a}{1998/08/01}{Macro added}
-% \changes{v1.4w}{2009/09/13}{Use \cs{protected@edef} to avoid problems
-% in complicated setups, e.g., microtype (pr/4080)}
% This command takes a label as |#1| extracts the page number
% associated with it and saves the result in a csname which is
-% passed as |#1|. If the label isn't associates with a page number
+% passed as |#1|. If the label isn't associated with a page number
% it essentially associates it with |??| for both the label number
% and the page, thus defining the label this way. This means that
% no label warning is generated for this label in case it is
@@ -1901,7 +1906,26 @@
% \begin{macrocode}
\def\vref@pagenum#1#2{%
\@ifundefined{r@#2}{\@namedef{r@#2}{{??}{??}}}{}%
- \protected@edef#1{\expandafter\expandafter\expandafter
+% \end{macrocode}
+% Extracting and saving the page number turned out to be a soure of subtle
+% bugs. Initially it was done through an |\edef| with a bunch of
+% |\expandafter| commands inside. This posed a problem if the page number
+% itself contained code which needed protection (e.g., pr/4080) so this got
+% changed to use |\protected@edef|. However, that in turn failed with Babel
+% (pr/4093)
+% if the label contained active characters, e.g., a ``:'' in French. So now
+% we use even more |\expandafter| commands to avoid any expansion other
+% than what is absolutely required---I'm sure there is now a simpler way
+% to code this, but \ldots:
+% \changes{v1.4w}{2009/09/13}{Use \cs{protected@edef} to avoid problems
+% in complicated setups, e.g., microtype (pr/4080)}
+% \changes{v1.4y}{2010/11/12}{Avoid even \cs{protected@edef} to pacify french
+% babel (pr/4093)}
+% \begin{macrocode}
+ \expandafter\expandafter\expandafter
+ \def\expandafter\expandafter\expandafter
+ #1\expandafter\expandafter\expandafter
+ {\expandafter\expandafter\expandafter
\@cdr\csname r@#2\endcsname
\@nil}%
}
@@ -2042,6 +2066,8 @@
% \changes{v1.4a}{2002/02/24}{Macro added}
% \begin{macro}{\Vr@f}
% \changes{v1.4a}{2002/02/24}{Macro added}
+% \changes{v1.4x}{2010/08/04}{Correct spacing -- same mistake as in \cs{vref}
+% (pr/4123)}
% |\Vref| is the counterpart to |\vref| with |\ref| replaced by
% |\Ref| in its definition.
% \begin{macrocode}
@@ -2051,7 +2077,7 @@
\def\Vr@f#1{%
\leavevmode\unskip\vref@space
\Ref{#1}%
- \@vpageref[\unskip]{#1}}
+ \vpageref[\unskip]{#1}}
% \end{macrocode}
% \end{macro}
% \end{macro}