summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/bibleref
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-04-29 13:41:25 +0000
committerKarl Berry <karl@freefriends.org>2010-04-29 13:41:25 +0000
commit3793428328652bd18a288a1ab5bd9f5aac85d765 (patch)
tree9c322f3a1325d505efd10961ecc711479008bd2d /Master/texmf-dist/source/latex/bibleref
parent7b7497d5ec04f3a154975722b6b2725be6566271 (diff)
bibleref 1.10 (27apr10)
git-svn-id: svn://tug.org/texlive/trunk@18041 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/bibleref')
-rw-r--r--Master/texmf-dist/source/latex/bibleref/bibleref.dtx186
-rw-r--r--Master/texmf-dist/source/latex/bibleref/bibleref.ins2
2 files changed, 143 insertions, 45 deletions
diff --git a/Master/texmf-dist/source/latex/bibleref/bibleref.dtx b/Master/texmf-dist/source/latex/bibleref/bibleref.dtx
index 9d3b8c60841..19b3b6fdcfb 100644
--- a/Master/texmf-dist/source/latex/bibleref/bibleref.dtx
+++ b/Master/texmf-dist/source/latex/bibleref/bibleref.dtx
@@ -12,7 +12,7 @@
% -author "Nicola Talbot"
% -dir "source"
% bibleref
-% Created on 2010/4/26 11:18
+% Created on 2010/4/27 21:44
%\fi
%\iffalse
%<*package>
@@ -82,14 +82,14 @@
\newcommand*{\app}[1]{\texttt{#1}}
\OnlyDescription
-\CheckSum{1719}
+\CheckSum{1786}
\begin{document}
\DocInput{bibleref.dtx}
\end{document}
%</driver>
%\fi
-%\title{bibleref.sty v1.09: a \LaTeXe\ package for
+%\title{bibleref.sty v1.10: a \LaTeXe\ package for
%typesetting bible references}
%\author{Nicola Talbot\\[10pt]
%School of Computing Sciences\\
@@ -97,7 +97,7 @@
%Norwich. Norfolk. NR4 7TJ.\\
%United Kingdom\\
%\url{http://theoval.cmp.uea.ac.uk/~nlct/}}
-%\date{26th April 2010}
+%\date{27th April 2010}
%\maketitle
%\tableofcontents
%
@@ -108,7 +108,7 @@
%
%\DescribeMacro{\bibleverse}
%\begin{definition}
-%\cs{bibleverse}\marg{book title}\texttt(\marg{chapter}\texttt{:}\meta{verse(s)}\texttt)
+%\cs{bibleverse}\marg{book title}\texttt(\meta{chapter}\texttt{:}\meta{verse(s)}\texttt)
%\end{definition}
%This command can be used to cite a bible book, chapter or verse
%or range of chapters or verses.
@@ -191,6 +191,23 @@
%(\textbf{Note} that you shouldn't do
%\verb|\setbookname{Rev}{Apoc}|)
%
+%\DescribeMacro{\setindexbooktitle}
+%If you want a different title for a book depending on whether it's
+%in the main body of the document or in the index, you can set the
+%index version using:
+%\begin{definition}
+%\cs{setindexbooktitle}\marg{name}\marg{title}
+%\end{definition}
+%In this case, \meta{name} should be the name you'll use in
+%\cs{ibibleverse}. For example, if you do:
+%\begin{verbatim}
+%\setbooktitle{Psalms}{Psalm}
+%\setindexbooktitle{Psalms}{Psalms}
+%\end{verbatim}
+%Then \verb|\ibibleverse{Psalms}(2:)| will print Psalm the
+%document and Psalms in the index, but \verb|\ibibleverse{Ps}(2:)|
+%will print Psalms in both the document and the index.
+%
%\DescribeMacro{\addbiblebook}
%You can add a book using
%\begin{definition}
@@ -325,7 +342,7 @@
% Declare package
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{bibleref}[2010/04/26 1.09 (NLCT)]
+\ProvidesPackage{bibleref}[2010/04/27 1.10 (NLCT)]
% \end{macrocode}
% Need to do some conditional stuff
% \begin{macrocode}
@@ -1082,9 +1099,30 @@ defined}{}}}
% Redefines the title of book \meta{fullname}.
% \begin{macrocode}
\newcommand*{\setbooktitle}[2]{%
-\@ifundefined{br@#1}{\PackageError{bibleref}{Unknown
-book `#1'}{}}{%
-\expandafter\def\csname br@#1\endcsname{#2}}}
+ \@ifundefined{br@#1}%
+ {%
+ \PackageError{bibleref}{Unknown book `#1'}{}%
+ }%
+ {%
+ \expandafter\def\csname br@#1\endcsname{#2}%
+ }%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\setindexbooktitle}
+% Set alternative book title in the index
+%\changes{1.10}{2010/04/27}{new}
+% \begin{macrocode}
+\newcommand*{\setindexbooktitle}[2]{%
+ \@ifundefined{br@#1}%
+ {%
+ \PackageError{bibleref}{Unknown book `#1'}{}%
+ }%
+ {%
+ \expandafter\def\csname bri@#1\endcsname{#2}%
+ }%
+}
% \end{macrocode}
%\end{macro}
%
@@ -1130,20 +1168,32 @@ Unknown biblerefstyle '#1'}{}}{\csname brs@#1\endcsname}}
\@do@verses#1,\relax\end
\ifx\@nil#2\relax
\else
-\@bv@do{\BRvrsep}%
-\@@br@vrsty#2\end%
-\fi}
+ \@bv@addtochidxsort{-}%
+ \@bv@do{\BRvrsep}%
+ \@@br@vrsty#2\end%
+\fi
+}
% \end{macrocode}
%\end{macro}
%\begin{macro}{\@@br@vrsty}
% Pick up a list
% \begin{macrocode}
\def\@do@verses#1,#2\end{%
-\ifthenelse{\equal{#1}{}}{}{\@bv@do{\BRversestyle{#1}}}%
-\ifx\relax#2\@empty
+\def\@br@tmp{#1}%
+\ifx\@br@tmp\@empty
\else
-\@bv@do{\BRvsep}%
-\@do@verses#2\end
+ \ifnum\@br@tmp<10\relax
+ \@bv@addtochidxsort{0#1}%
+ \else
+ \@bv@addtochidxsort{#1}%
+ \fi
+ \@bv@do{\BRversestyle{#1}}%
+\fi
+\ifx\relax#2\relax
+\else
+ \@bv@addtochidxsort{,}%
+ \@bv@do{\BRvsep}%
+ \@do@verses#2\end
\fi
}
% \end{macrocode}
@@ -1159,11 +1209,25 @@ Unknown biblerefstyle '#1'}{}}{\csname brs@#1\endcsname}}
% to see if there is a bracket \verb|(| immediately following it.
% \begin{macrocode}
\newcommand*{\bibleverse}[1]{%
-\@ifundefined{br@#1}{\PackageError{bibleref}{Unknown book '#1'}{%
-}}{\@bv@idxsort{\csname br@#1\endcsname}%
-\def\@bv@chidxsort{}%
-\@bv@do{\BRbooktitlestyle{\csname br@#1\endcsname}}}%
-\@ifnextchar({\BRbkchsep\@bv@addtoidx{!}\@bibleverse}{\@end@@bibleverse}%
+ \@ifundefined{br@#1}%
+ {%
+ \PackageError{bibleref}{Unknown book '#1'}{}%
+ }%
+ {%
+ \@bv@idxsort{\csname br@#1\endcsname}%
+ \def\@bv@chidxsort{}%
+ \BRbooktitlestyle{\csname br@#1\endcsname}%
+ \@ifundefined{bri@#1}%
+ {%
+ \def\@bv@mainidxentry{\BRbooktitlestyle{\csname br@#1\endcsname}}%
+ }%
+ {%
+ \def\@bv@mainidxentry{\BRbooktitlestyle{\csname bri@#1\endcsname}}%
+ }%
+ }%
+ \@ifnextchar(%
+ {\BRbkchsep\@bibleverse}%
+ {\@end@@bibleverse}%
}
% \end{macrocode}
%\end{macro}
@@ -1172,20 +1236,36 @@ Unknown biblerefstyle '#1'}{}}{\csname brs@#1\endcsname}}
% This gets the chapter number.
% \begin{macrocode}
\def\@bibleverse(#1:{%
-\ifthenelse{\equal{#1}{}}{}{%
-\ifthenelse{\equal{\@bv@chidxsort}{}}{%
-\def\@bvchidxsort{#1}\@bv@addtoidx{#1@}}{}%
-\@bv@do{\BRchapterstyle{#1}}}%
-\@@bibleverse}
+ \def\@bv@tmp{#1}%
+ \ifx\@bv@tmp\@empty
+ \else
+ \ifnum\@bv@tmp<10\relax
+ \@bv@addtochidxsort{0#1:}%
+ \else
+ \@bv@addtochidxsort{#1:}%
+ \fi
+ \@bv@do{\BRchapterstyle{#1}}%
+ \fi
+ \@@bibleverse
+}
% \end{macrocode}
%\end{macro}
%\begin{macro}{\@bibleverser}
% This gets the second part of a range spanning chapters.
% \begin{macrocode}
\def\@bibleverser-(#1:{%
-\ifthenelse{\equal{#1}{}}{}{%
-\@bv@do{\BRchapterstyle{#1}}}%
-\@@bibleverse}
+ \def\@bv@tmp{#1}%
+ \ifx\@bv@tmp\@empty
+ \else
+ \ifnum\@bv@tmp<10\relax
+ \@bv@addtochidxsort{0#1:}%
+ \else
+ \@bv@addtochidxsort{#1:}%
+ \fi
+ \@bv@do{\BRchapterstyle{#1}}%
+ \fi
+ \@@bibleverse
+}
% \end{macrocode}
%\end{macro}
%
@@ -1195,9 +1275,18 @@ Unknown biblerefstyle '#1'}{}}{\csname brs@#1\endcsname}}
% chapter, verse pair).
% \begin{macrocode}
\def\@@bibleverse#1){%
-\ifthenelse{\equal{#1}{}}{}{\@bv@do{\BRchvsep}\@br@vrsty{#1}}%
-\@ifnextchar({\@bv@do{\BRchsep}\@bibleverse}%
-{\@ifnextchar-{\@bv@do{\BRvrsep}\@bibleverser}{\@end@@bibleverse}}}
+ \def\@bv@tmp{#1}%
+ \ifx\@bv@tmp\@empty
+ \else
+ \@bv@do{\BRchvsep}\@br@vrsty{#1}%
+ \fi
+ \@ifnextchar(%
+ {\@bv@do{\BRchsep}\@bibleverse}%
+ {\@ifnextchar-%
+ {\@bv@do{\BRvrsep}\@bibleverser}%
+ {\@end@@bibleverse}%
+ }%
+}
% \end{macrocode}
%\end{macro}
%
@@ -1205,12 +1294,19 @@ Unknown biblerefstyle '#1'}{}}{\csname brs@#1\endcsname}}
% This controls what to do at the end of the final
% verse.
%\changes{1.09}{2009/04/26}{replaced \cs{index} with \cs{biblerefindex}}
+%\changes{1.10}{2010/04/27}{separated child entry from parent entry to improve sorting}
% \begin{macrocode}
\newcommand*{\@end@@bibleverse}{%
\if@bv@idx
\expandafter\@do@bibleref@map\@@bv@idxsort\relax
- \biblerefindex{\@@bv@idxsort\relax @\@bv@idxentry|\@bv@idxpgformat}%
-\@bv@idxfalse
+ \ifx\@bv@idxentry\@empty
+ \def\@bv@tmp{\@bv@mainidxentry}%
+ \else
+ \def\@bv@tmp{\@bv@mainidxentry!\@bv@chidxsort @\@bv@idxentry}%
+ \fi
+ \biblerefindex
+ {\@@bv@idxsort\relax @\@bv@tmp|\@bv@idxpgformat}%
+ \@bv@idxfalse
\fi
}
% \end{macrocode}
@@ -1260,22 +1356,23 @@ Unknown biblerefstyle '#1'}{}}{\csname brs@#1\endcsname}}
\newtoks\@bv@tmpb
\newcommand{\@bv@addtoidx}[1]{%
\if@bv@idx
-\@bv@tmpa={#1}%
-\@bv@tmpb=\expandafter{\@bv@idxentry}%
-\edef\@bv@idxentry{\the\@bv@tmpb\the\@bv@tmpa}%
+ \@bv@tmpa={#1}%
+ \@bv@tmpb=\expandafter{\@bv@idxentry}%
+ \protected@edef\@bv@idxentry{\the\@bv@tmpb\the\@bv@tmpa}%
\fi}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\@bv@addtoidxsort}
-% Append text to \verb|\@@bv@idxsort|
+%\begin{macro}{\@bv@addtochidxsort}
+% Append text to \verb|\@bv@chidxsort|
% \begin{macrocode}
-\newcommand{\@bv@addtoidxsort}[1]{%
+\newcommand{\@bv@addtochidxsort}[1]{%
\if@bv@idx
-\@bv@tmpa={#1}%
-\@bv@tmpb=\expandafter{\@@bv@idxsort}%
-\edef\@@bv@idxsort{\the\@bv@tmpb\the\@bv@tmpa}%
-\fi}
+ \@bv@tmpa={#1}%
+ \@bv@tmpb=\expandafter{\@bv@chidxsort}%
+ \edef\@bv@chidxsort{\the\@bv@tmpb\the\@bv@tmpa}%
+\fi
+}
% \end{macrocode}
%\end{macro}
%\begin{macro}{\if@bv@idx}
@@ -1608,6 +1705,7 @@ has verses in lower case Roman numerals, and redefines
\verb|\ibibleverse{Ex}| & \ibibleverse{Ex}\\
\verb|\ibibleverse{Exodus}(9:)| & \ibibleverse{Exodus}(9:)\\
\verb|\ibibleverse{Exod}(20:17)| & \ibibleverse{Exod}(20:17)\\
+\verb|\ibibleverse{Exod}(20:)| & \ibibleverse{Exod}(20:)\\
\verb|\ibibleverse{IICo}(12:21)| & \ibibleverse{IICo}(12:21)\\
\verb|\ibibleverse{IICor}(12:21-32)| & \ibibleverse{IICor}(12:21-32)\\
\verb|\ibibleverse{Ex}(20:17)(21:3)| & \ibibleverse{Ex}(20:17)(21:3)\\
diff --git a/Master/texmf-dist/source/latex/bibleref/bibleref.ins b/Master/texmf-dist/source/latex/bibleref/bibleref.ins
index 4f423c625e7..2277885da0b 100644
--- a/Master/texmf-dist/source/latex/bibleref/bibleref.ins
+++ b/Master/texmf-dist/source/latex/bibleref/bibleref.ins
@@ -1,4 +1,4 @@
-% bibleref.ins generated using makedtx version 0.94b 2010/4/26 11:18
+% bibleref.ins generated using makedtx version 0.94b 2010/4/27 21:44
\input docstrip
\preamble