diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/lineno/vplref.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/lineno/vplref.sty | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/lineno/vplref.sty b/Master/texmf-dist/tex/latex/lineno/vplref.sty new file mode 100644 index 00000000000..51dd815bd48 --- /dev/null +++ b/Master/texmf-dist/tex/latex/lineno/vplref.sty @@ -0,0 +1,72 @@ +%% `vplref.sty' +%% -- extended line number referencing with lineno.sty. + +\def\filedate{2005/04/25} \def\fileversion{0.2} + +%% Copyright (C) 2004, 2005 Uwe Lueck, +%% http://contact-ednotes.sty.de.vu --author-maintained +%% -- support of lineno.sty for varioref.sty. + +%% This file can be redistributed and/or modified under +%% the terms of the LaTeX Project Public License; either +%% version 1.3 of the License, or any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% We did our best to help you, but there is NO WARRANTY. + +%% USAGE: +% +% \vpagelineref{<label>} expands to +% +% a) \ref{<label>} +% -- if on same page as \linelabel{<label>} +% +% b) \LineWithPage{<label>} -- otherwise. +% +% \LineWithPage{<label>} expands -- by default -- to +% +% \pageref{<label>}.\ref{<label>} +% +% This can be customized by editing +% +% \renewcommand*{\LineWithPage}[1]{\pageref{#1}.\ref{#1}} +% +% in your document preamble, after vplref.sty has been loaded +% (which may have happened through lineno.sty with option +% `addpageno'). + +%% IMPLEMENTATION: + +\NeedsTeXFormat{LaTeX2e}[1994/12/01] %% \Declare...* +\ProvidesPackage{vplref}[\filedate\space v\fileversion] + +\AtBeginDocument{\RequirePackage{lineno,varioref}} + +%% Anderer Ansatz: GPNo (\FirstOnPage) + +\DeclareRobustCommand*\vpagelineref[1]{{% +% \def\reftextcurrent{\lineref{#1}}%% First vpageref arg. + \let\reftextfaraway\LineWithPage + \def\reftextafter{\reftextfaraway{#1}}% + \let\reftextbefore\reftextafter + \let\reftextfaceafter\reftextafter + \let\reftextfacebefore\reftextafter +%% <- Looks somewhat stupid, but varioref.sty has its merits +%% as compared with the mechanism in ednotes.sty. + \vpageref[\ref{#1}][]{#1}%% The robust alternative. +%% Here and with \LineWithPage, \lineref seems more appropriate +%% than \ref, but it produces errors when labels have not been +%% defined. This seems to be an incompatibility with lineno.sty. +}} + +%% Customizable format for different page: +\newcommand*\LineWithPage[1]{\pageref{#1}.\ref{#1}} + +\endinput + +VERSION HISTORY: +v0.1 2004/10/19 First, sent to Sergei Mariev. +v0.11 2004/10/19 Fit to recent varioref version; + sent to Sergei. +v0.2 2005/04/25 \Require... \AtBeginDocument. + |