diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/lineno/vplref.sty |
Initial commit
Diffstat (limited to 'macros/latex/contrib/lineno/vplref.sty')
-rw-r--r-- | macros/latex/contrib/lineno/vplref.sty | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/macros/latex/contrib/lineno/vplref.sty b/macros/latex/contrib/lineno/vplref.sty new file mode 100644 index 0000000000..d3b0697f13 --- /dev/null +++ b/macros/latex/contrib/lineno/vplref.sty @@ -0,0 +1,74 @@ +%% `vplref.sty' +%% -- extended line number referencing with lineno.sty. + +\def\filedate{2005/04/25} \def\fileversion{0.2a} + +%% 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 \space + page-line cross-refs] %% UL 2011/02/13 + +\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. +v0.2a 2011/02/13 add. caption to \ProvidesPackage + |