From 205f178e5bd86f9fd729a2df7d01b0562b11cffe Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 5 Feb 2010 01:24:29 +0000 Subject: pagerange update (4feb10) git-svn-id: svn://tug.org/texlive/trunk@16915 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/pagerange/README | 6 +-- .../doc/latex/pagerange/pagerange-guide.pdf | Bin 82727 -> 93677 bytes .../doc/latex/pagerange/pagerange-guide.tex | 54 +++++++++++++-------- 3 files changed, 38 insertions(+), 22 deletions(-) (limited to 'Master/texmf-dist/doc/latex/pagerange') diff --git a/Master/texmf-dist/doc/latex/pagerange/README b/Master/texmf-dist/doc/latex/pagerange/README index 878888e88d7..c3d220d17a4 100644 --- a/Master/texmf-dist/doc/latex/pagerange/README +++ b/Master/texmf-dist/doc/latex/pagerange/README @@ -1,4 +1,4 @@ -This is the README file for 'pagerange' package, version 0.3. +This is the README file for 'pagerange' package, version 0.5. When a given page range xx-yy (simple/plain characters) or \pages (command token, eg, \def\pages{xx-yy}) is submitted to the macro @@ -29,6 +29,6 @@ either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. -Copyright (c) 2009 Ahmed Musa (a.musa@rocketmail.com). +Copyright (c) 2010 Ahmed Musa (a.musa@rocketmail.com). -End of README file. \ No newline at end of file +End of README file. diff --git a/Master/texmf-dist/doc/latex/pagerange/pagerange-guide.pdf b/Master/texmf-dist/doc/latex/pagerange/pagerange-guide.pdf index c0e5e1e1767..00f3ac14c4a 100644 Binary files a/Master/texmf-dist/doc/latex/pagerange/pagerange-guide.pdf and b/Master/texmf-dist/doc/latex/pagerange/pagerange-guide.pdf differ diff --git a/Master/texmf-dist/doc/latex/pagerange/pagerange-guide.tex b/Master/texmf-dist/doc/latex/pagerange/pagerange-guide.tex index db78f40c054..6ca29217971 100644 --- a/Master/texmf-dist/doc/latex/pagerange/pagerange-guide.tex +++ b/Master/texmf-dist/doc/latex/pagerange/pagerange-guide.tex @@ -7,14 +7,14 @@ \label{page:first} \MakeShortVerb{\+} -\title{\textbf{The {\tt pagerange} Package}\\[1ex] Version 0.3} +\title{\textbf{The {\tt pagerange} Package}\\[1ex] Version 0.5} \author{Ahmed Musa\\[.5ex]University of Central Lancashire\\ Preston, United Kingdom\\[1ex]\email{a.musa@rocketmail.com} } \maketitle \section{Introduction} -This package emerged from my desire to resolve page ranges in the +draftmark+ package, but it may be useful to other \LaTeX{} enthusiasts. +This package emerged from my desire to resolve page ranges in the +draftmark+ package, but it may be useful to other \texorlatex enthusiasts and users. \section{Usage} @@ -25,19 +25,35 @@ If you specify a range consisting of a hyphen (or any tie) but with one or two e \item A range of the form ``+-34+'' is taken to mean pages +defaultfirstpage+ to 34. The default value of +defaultfirstpage+ is 1; it can be changed via +\pagerangeoptions+. \item A range of the form ``+12-+'' is taken to mean page~12 to +defaultlastpage+, where the default value of +defaultlastpage+ is the document's last page. \item A range of the form ``+-+'' (\ie, only hyphen and no pages) is taken to mean from +defaultfirstpage+ to +defaultlastpage+. -\item An empty or blank page range (\ie, containing no argument and no hyphen/tie) is taken to mean the range +defaultfirstpage+ to +defaultlastpage+, or it may prompt a fatal error, depending on whether the boolean +acceptempty+ is set true or false (respectively). +\item A blank page range (\ie, containing no argument and no hyphen/tie) is taken to mean the range +defaultfirstpage+ to +defaultlastpage+, or it may prompt a fatal error, depending on whether the boolean +acceptempty+ is set true or false (respectively). \end{compactenum} Page ranges containing more than one hyphen/tie cause fatal error. If the upper limit of the page range is smaller than the lower limit, a fatal error is flagged. -The tie between the pages in the page range can be any single non-active character; its default is the hyphen character ``+-+''. It can be changed in the call to the package (\eg, +\usepackage[tie=*]{pagerange}+) or at any moment through +\pagerangeoptions{tie=*}+. Active characters can't, unfortunately, be used as ties. The package easily terminates with a warning when an active character is passed as +tie+. It wouldn't be safe to change the catcode of an active character submitted as +tie+ through +\pagerangeoptions+, since at the time the macro +\pagerangeoptions+ is invoked, the page may already be in the process of being built. +The tie between the pages in the page range can be any single non-active character; its default is the hyphen character ``+-+''. It can be changed in the call to the package (\eg, +\usepackage[tie=*]{pagerange}+) or at any moment through +\pagerangeoptions{tie=*}+. Because of the need for the last page of the document, at least~2 runs/passes are needed to obtain the correct last page. This package has been tested with the +hyperref+ package, which redefines the label used by the +lastpage+ package. +\subsection{Using an active character as the ``tie''} + +Active characters can't, unfortunately, be used as ties. The package easily terminates with a fatal error when an active character is passed as +tie+. It wouldn't be safe to change the catcode of an active character submitted as +tie+ through +\pagerangeoptions+, since at the time the macro +\pagerangeoptions+ is invoked, the page may already be in the process of being built. + +To use an active character (say \string~) as a tie, it is necessary to first locally change its catcode, \eg, as follows: + +\begin{pverbatim} +\begingroup +\catcode`\~=11 +\pagerangeoptions{tie=~} +\pagerange{1~4} +\endgroup +\end{pverbatim} + +which gives \pgresult{Pages 1 to 4}. + \section{Package options}\label{sec:package-options} The package options are as follows: @@ -60,7 +76,7 @@ Pages~\pagestart\space to\space\pageend \end{pverbatim} \pagerange{123-456} -produces \result{Pages~\pagestart\space to\space\pageend}. +produces \pgresult{Pages~\pagestart\space to\space\pageend}. \pgexample{} @@ -71,7 +87,7 @@ The following \end{pverbatim} \pagerange{12345-67890} -produces \result{Pages~\pagestart\space to\space\pageend}. +produces \pgresult{Pages~\pagestart\space to\space\pageend}. \pgexample{} The following @@ -81,7 +97,7 @@ The following \end{pverbatim} \pagerange{123-4567} -produces \result{Pages~\pagestart\space to\space\pageend}. +produces \pgresult{Pages~\pagestart\space to\space\pageend}. \pgexample{} The following @@ -91,7 +107,7 @@ The following \end{pverbatim} \pagerange{600-601} -produces \result{Pages~\pagestart\space to\space\pageend}. +produces \pgresult{Pages~\pagestart\space to\space\pageend}. \pgexample{} The following @@ -101,7 +117,7 @@ The following \end{pverbatim} \pagerange{-34} -produces \result{Pages~\pagestart\space to\space\pageend}. +produces \pgresult{Pages~\pagestart\space to\space\pageend}. \pgexample{No page numbers given} The following @@ -112,7 +128,7 @@ The following \pagerange{-} \par\medskip\noindent -produces \result{Pages~\pagestart\space to\space\pageend}. +produces \pgresult{Pages~\pagestart\space to\space\pageend}. \pgexample{} The following logs a warning message or issues fatal error, depending on the status of +acceptempty+ option: @@ -177,7 +193,7 @@ The following works because the +\pagerange+ is fully expanded before splitting: \def\Xone{-} \def\Xtwo{\Xone} \pagerange{22\Xtwo 23} -This produces \result{Pages~\pagestart\space to\space\pageend}. +This produces \pgresult{Pages~\pagestart\space to\space\pageend}. \pgexample{} The following also works because the +\pagerange+ is fully expanded before splitting: @@ -193,7 +209,7 @@ The following also works because the +\pagerange+ is fully expanded before split \def\Y{2222} \def\Z{3333} \pagerange{\Y\X\Z} -This produces \result{Pages~\pagestart\space to\space\pageend}. +This produces \pgresult{Pages~\pagestart\space to\space\pageend}. \pgexample{} The following also works because the +\pagerange+ and +tie+ are fully expanded before splitting page range: @@ -207,7 +223,7 @@ The following also works because the +\pagerange+ and +tie+ are fully expanded b \def\X{-} \pagerangeoptions{tie=\X} \pagerange{123\X 234} -This produces \result{Pages~\pagestart\space to\space\pageend}. +This produces \pgresult{Pages~\pagestart\space to\space\pageend}. \pgexample{} The following works because infinite nesting of +tie+ and +\pagerange+ are permitted: @@ -223,7 +239,7 @@ The following works because infinite nesting of +tie+ and +\pagerange+ are permi \def\Xtwo{\Xone} \pagerangeoptions{tie=\Xtwo} \pagerange{444\Xtwo 555} -This yields \result{Pages~\pagestart\space to\space\pageend}. +This yields \pgresult{Pages~\pagestart\space to\space\pageend}. \pgexample{} The following gives incorrect (in fact, weird) result because the prevailing +tie+ is not a star: @@ -233,7 +249,7 @@ The following gives incorrect (in fact, weird) result because the prevailing +ti \end{pverbatim} %\pagerange{33*44} -%It produces \result{Pages~\pagestart\space to\space\pageend}. +%It produces \pgresult{Pages~\pagestart\space to\space\pageend}. \pgexample{} The +tie+ can be changed to a star (or any non-active character) as follows: @@ -245,7 +261,7 @@ The +tie+ can be changed to a star (or any non-active character) as follows: \pagerangeoptions{tie=*} \pagerange{2233*3344} -This correctly produces \result{Pages~\pagestart\space to\space\pageend}. +This correctly produces \pgresult{Pages~\pagestart\space to\space\pageend}. \pgexample{} In the following the +tie+ is changed to letter ``T'': @@ -257,7 +273,7 @@ In the following the +tie+ is changed to letter ``T'': \pagerangeoptions{tie=T} \pagerange{1234T1235} -It produces \result{Pages~\pagestart\space to\space\pageend}. +It produces \pgresult{Pages~\pagestart\space to\space\pageend}. \pgexample{} The following @@ -269,7 +285,7 @@ The following \pagerangeoptions{tie=X} \pagerange{2034X2135} -correctly yields \result{Pages~\pagestart\space to\space\pageend}. +correctly yields \pgresult{Pages~\pagestart\space to\space\pageend}. \section{Using page labels} @@ -285,7 +301,7 @@ From version 0.3 of the package, it has been possible to obtain page ranges from \label{page:last} \pagerangeoptions{tie=-} \pagerange{\getpagenumber{page:first}-\getpagenumber{page:last}} -which yields \result{Pages~\pagestart\space to\space\pageend}. +which yields \pgresult{Pages~\pagestart\space to\space\pageend}. The command +\getpagenumber+ is provided in the package and may, in general, be used to convert page labels into page numbers even in expansion contexts, where +\pageref+ will normally fail. If the page label or reference is undefined, the default start page number (+defaultfirstpage+) is used. The +defaultfirstpage+ is a package option (see Section~\ref{sec:package-options}). -- cgit v1.2.3