summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/bibleref/bibleref.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-01-23 01:07:05 +0000
committerKarl Berry <karl@freefriends.org>2011-01-23 01:07:05 +0000
commit15703ccdfc4e8e60c48c88a46bd19990f7f97264 (patch)
tree4b09292258f93e8ffe3160d581d0bbe7d48fd055 /Master/texmf-dist/tex/latex/bibleref/bibleref.sty
parent0a4fa812001169eda98397ac5ec75971592111c9 (diff)
bibleref 1.14 (19jan11)
git-svn-id: svn://tug.org/texlive/trunk@21145 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/bibleref/bibleref.sty')
-rw-r--r--Master/texmf-dist/tex/latex/bibleref/bibleref.sty187
1 files changed, 146 insertions, 41 deletions
diff --git a/Master/texmf-dist/tex/latex/bibleref/bibleref.sty b/Master/texmf-dist/tex/latex/bibleref/bibleref.sty
index 725444ad9ea..9a60b44749a 100644
--- a/Master/texmf-dist/tex/latex/bibleref/bibleref.sty
+++ b/Master/texmf-dist/tex/latex/bibleref/bibleref.sty
@@ -7,7 +7,7 @@
%% bibleref.dtx (with options: `bibleref.sty,package')
%%
%% bibleref.dtx
-%% Copyright 2010 Nicola Talbot
+%% Copyright 2011 Nicola Talbot
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
@@ -21,7 +21,7 @@
%%
%% The Current Maintainer of this work is Nicola Talbot.
%%
-%% This work consists of the files bibleref.dtx and bibleref.ins and the derived files bibleref.sty, bibleref-manual.tex, sample-multind.tex, sample.tex, bibleref.perl.
+%% This work consists of the files bibleref.dtx and bibleref.ins and the derived files bibleref-xidx.sty, bibleref.sty, sample-categories.tex, sample-multind.tex, sample-xidx.tex, sample.tex, sample.ist, bibleref.perl.
%%
%% \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
@@ -39,7 +39,7 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{bibleref}[2010/07/07 1.13 (NLCT)]
+\ProvidesPackage{bibleref}[2011/01/19 1.14 (NLCT)]
\RequirePackage{ifthen}
\RequirePackage{fmtcount}
\RequirePackage{amsgen}
@@ -568,22 +568,22 @@
\newcommand*{\brs@text}{%
\biblerefstyle{default}%
\renewcommand{\BRbooknumberstyle}[1]{%
-\Ordinalstringnum{##1}\ }%
+\protect\Ordinalstringnum{##1}\ }%
\renewcommand{\BRepistlenumberstyle}[1]{%
-\Ordinalstringnum{##1}\ }%
+\protect\Ordinalstringnum{##1}\ }%
\renewcommand{\BRbookof}{Book of }%
\renewcommand{\BRgospel}{Gospel according to St }%
\renewcommand{\BRepistletothe}{Epistle to the }%
\renewcommand{\BRepistleto}{Epistle to }%
\renewcommand{\BRepistleof}{Epistle of }%
\renewcommand{\BRchapterstyle}[1]{%
-chapter \numberstringnum{##1}}%
+chapter \protect\numberstringnum{##1}}%
\renewcommand{\BRbkchsep}{, }%
\renewcommand{\BRchvsep}{ verse }%
\renewcommand{\BRchsep}{, }%
\renewcommand{\BRvrsep}{ to }%
\renewcommand{\BRvsep}{, }%
-\renewcommand{\BRversestyle}[1]{\numberstringnum{##1}}%
+\renewcommand{\BRversestyle}[1]{\protect\numberstringnum{##1}}%
\renewcommand*{\BRversesuffixstyle}[1]{##1}%
}
\DeclareOption{default}{\brs@default}
@@ -635,13 +635,55 @@ defined}{}}}
}%
{\csname brs@#1\endcsname}%
}
+\newcommand*{\@br@chsty}[1]{\@@br@chsty#1-\@nil\end}
+\def\@@br@chsty#1-#2\end{%
+\@do@chapters#1,\relax\end
+\ifx\@nil#2\relax
+\else
+ \@bv@addtochidxsort{-}%
+ \@bv@do{\protect\BRvrsep}%
+ \@@br@chsty#2\end%
+\fi
+}
+\def\@do@chapters#1,#2\end{%
+\def\@br@tmp{#1}%
+\ifx\@br@tmp\@empty
+\else
+ \@biblech{#1}%
+\fi
+\ifx\relax#2\relax
+\else
+ \@bv@addtochidxsort{,}%
+ \@bv@do{\protect\BRvsep}%
+ \@do@chapters#2\end
+\fi
+}
+\newcommand*{\@biblech}[1]{%
+ \def\@bv@tmp{#1}%
+ \ifx\@bv@tmp\@empty
+ \else
+ \@nodo@chapter{#1}%
+ \@bv@do{\protect\BRchapterstyle{#1}}%
+ \fi
+}
+\newcommand*{\@nodo@chapter}[1]{%
+ \ifnum\@bv@tmp<10\relax
+ \@bv@addtochidxsort{00#1:}%
+ \else
+ \ifnum\@bv@tmp<100\relax
+ \@bv@addtochidxsort{0#1:}%
+ \else
+ \@bv@addtochidxsort{#1:}%
+ \fi
+ \fi
+}
\newcommand*{\@br@vrsty}[1]{\@@br@vrsty#1-\@nil\end}
\def\@@br@vrsty#1-#2\end{%
\@do@verses#1,\relax\end
\ifx\@nil#2\relax
\else
\@bv@addtochidxsort{-}%
- \@bv@do{\BRvrsep}%
+ \@bv@do{\protect\BRvrsep}%
\@@br@vrsty#2\end%
\fi
}
@@ -703,10 +745,11 @@ defined}{}}}
\fi
\fi
}
-\def\@do@verses#1,#2\end{%
-\def\@br@tmp{#1}%
-\ifx\@br@tmp\@empty
-\else
+\newcommand*{\@do@verse}[1]{%
+ \@nodo@verse{#1}%
+ \expandafter\@bv@do\expandafter{\@br@tmp}%
+}
+\newcommand*{\@nodo@verse}[1]{%
\br@stripverse{#1}%
\ifnum\@br@versenum<10\relax
\@bv@addtochidxsort{00#1}%
@@ -717,19 +760,41 @@ defined}{}}}
\@bv@addtochidxsort{#1}%
\fi
\fi
- \edef\@br@tmp{%
- \noexpand\BRversestyle{\@br@versenum}%
- \noexpand\BRversesuffixstyle{\@br@versesuffix}}%
- \expandafter\@bv@do\expandafter{\@br@tmp}%
+ \ifx\@br@versesuffix\@empty
+ \protected@edef\@br@tmp{%
+ \protect\BRversestyle{\@br@versenum}%
+ }%
+ \else
+ \protected@edef\@br@tmp{%
+ \protect\BRversestyle{\@br@versenum}%
+ \protect\BRversesuffixstyle{\@br@versesuffix}%
+ }%
+ \fi
+}
+\def\@do@verses#1,#2\end{%
+\def\@br@tmp{#1}%
+\ifx\@br@tmp\@empty
+\else
+ \expandafter\@do@verse\expandafter{\@br@tmp}%
\fi
\ifx\relax#2\relax
\else
\@bv@addtochidxsort{,}%
- \@bv@do{\BRvsep}%
+ \@bv@do{\protect\BRvsep}%
\@do@verses#2\end
\fi
}
-\newcommand*{\bibleverse}[1]{%
+\newcommand*{\@bv@category}{}
+\newcommand*{\@bv@categorysort}{}
+\newcommand*{\biblerefcategory}[2][\@bv@category]{%
+ \renewcommand*{\@bv@category}{#2}%
+ \renewcommand*{\@bv@categorysort}{#1}%
+}
+\newcommand*{\bibleverse}{%
+ \let\@bv@restore\relax
+ \@bible@verse
+}
+\newcommand*{\@bible@verse}[1]{%
\@ifundefined{br@#1}%
{%
\PackageError{bibleref}{Unknown book '#1'}{}%
@@ -738,33 +803,34 @@ defined}{}}}
\@bv@idxsort{\csname br@#1\endcsname}%
\def\@bv@chidxsort{}%
\BRbooktitlestyle{\csname br@#1\endcsname}%
+ \let\@bv@org@bookof\BRbookof
+ \let\@bv@org@booknumberstyle\BRbooknumberstyle
+ \let\@bv@org@epistletothe\BRepistletothe
+ \let\@bv@org@epistlenumberstyle\BRepistlenumberstyle
+ \def\BRbookof{\string\BRbookof\space}%
+ \def\BRbooknumberstyle{\string\BRbooknumberstyle\space}%
+ \def\BRepistletothe{\string\BRepistletothe\space}%
+ \def\BRepistlenumberstyle{\string\BRepistlenumberstyle\space}%
\@ifundefined{bri@#1}%
{%
- \def\@bv@mainidxentry{\BRbooktitlestyle{\csname br@#1\endcsname}}%
+ \protected@edef\@bv@mainidxentry{%
+ \protect\BRbooktitlestyle{\csname br@#1\endcsname}}%
}%
{%
- \def\@bv@mainidxentry{\BRbooktitlestyle{\csname bri@#1\endcsname}}%
+ \protected@edef\@bv@mainidxentry{%
+ \protect\BRbooktitlestyle{\csname bri@#1\endcsname}}%
}%
+ \let\BRbookof\@bv@org@bookof
+ \let\BRbooknumberstyle\@bv@org@booknumberstyle
+ \let\BRepistletothe\@bv@org@epistletothe
+ \let\BRepistlenumberstyle\@bv@org@epistlenumberstyle
}%
\new@ifnextchar(%
{\BRbkchsep\@bibleverse}%
{\@end@@bibleverse}%
}
\def\@bibleverse(#1:{%
- \def\@bv@tmp{#1}%
- \ifx\@bv@tmp\@empty
- \else
- \ifnum\@bv@tmp<10\relax
- \@bv@addtochidxsort{00#1:}%
- \else
- \ifnum\@bv@tmp<100\relax
- \@bv@addtochidxsort{0#1:}%
- \else
- \@bv@addtochidxsort{#1:}%
- \fi
- \fi
- \@bv@do{\BRchapterstyle{#1}}%
- \fi
+ \@br@chsty{#1}%
\@@bibleverse
}
\def\@bibleverser-(#1:{%
@@ -780,7 +846,7 @@ defined}{}}}
\@bv@addtochidxsort{#1:}%
\fi
\fi
- \@bv@do{\BRchapterstyle{#1}}%
+ \@bv@do{\protect\BRchapterstyle{#1}}%
\fi
\@@bibleverse
}
@@ -788,12 +854,12 @@ defined}{}}}
\def\@bv@tmp{#1}%
\ifx\@bv@tmp\@empty
\else
- \@bv@do{\BRchvsep}\@br@vrsty{#1}%
+ \@bv@do{\protect\BRchvsep}\@br@vrsty{#1}%
\fi
\new@ifnextchar(%
- {\@bv@do{\BRchsep}\@bibleverse}%
+ {\@bv@do{\protect\BRchsep}\@bibleverse}%
{\new@ifnextchar-%
- {\@bv@do{\BRvrsep}\@bibleverser}%
+ {\@bv@do{\protect\BRvrsep}\@bibleverser}%
{\@end@@bibleverse}%
}%
}
@@ -805,10 +871,19 @@ defined}{}}}
\else
\def\@bv@tmp{\@bv@mainidxentry!\@bv@chidxsort @\@bv@idxentry}%
\fi
- \biblerefindex
- {\@@bv@idxsort\relax @\@bv@tmp|\@bv@idxpgformat}%
+ \@do@biblerefindex
+ {\@@bv@idxsort\relax @\@bv@tmp|\@bv@idxpgformat}%
\@bv@idxfalse
\fi
+\@bv@restore
+}
+\newcommand*{\@do@biblerefindex}[1]{%
+ \ifx\@bv@category\@empty
+ \biblerefindex{#1}%
+ \else
+ \biblerefindex
+ {\@bv@categorysort @\@bv@category!#1}%
+ \fi
}
\newcommand*{\biblerefindex}{\index}
\newcommand*{\biblerefmap}[2]{%
@@ -823,7 +898,7 @@ defined}{}}}
\newcommand{\@bv@do}[1]{#1\@bv@addtoidx{#1}}
\newtoks\@bv@tmpa
\newtoks\@bv@tmpb
-\newcommand{\@bv@addtoidx}[1]{%
+\newcommand*{\@bv@addtoidx}[1]{%
\if@bv@idx
\@bv@tmpa={#1}%
\@bv@tmpb=\expandafter{\@bv@idxentry}%
@@ -850,6 +925,36 @@ defined}{}}}
\newcommand*{\ibibleverse}[1][\bvidxpgformat]{%
\def\@bv@idxpgformat{#1}%
\@bv@idxtrue\def\@bv@idxentry{}\bibleverse}
+\newcommand*{\ibiblechvs}[1][\bvidxpgformat]{%
+ \let\@bv@current@bkchsep\BRbkchsep
+ \let\@bv@current@titlestyle\BRbooktitlestyle
+ \def\@bv@restore{%
+ \let\BRbkchsep\@bv@current@bkchsep
+ \let\BRbooktitlestyle\@bv@current@titlestyle
+ }%
+ \def\BRbkchsep{}%
+ \def\BRbooktitlestyle##1{}%
+ \def\@bv@idxpgformat{#1}%
+ \@bv@idxtrue\def\@bv@idxentry{}\@bible@verse
+}
+\newcommand*{\ibiblevs}[1][\bvidxpgformat]{%
+ \let\@bv@current@titlestyle\BRbooktitlestyle
+ \let\@bv@current@chapterstyle\BRchapterstyle
+ \let\@bv@current@bkchsep\BRbkchsep
+ \let\@bv@current@chvsep\BRchvsep
+ \def\@bv@restore{%
+ \let\BRbooktitlestyle\@bv@current@titlestyle
+ \let\BRchapterstyle\@bv@current@chapterstyle
+ \let\BRbkchsep\@bv@current@bkchsep
+ \let\BRchvsep\@bv@current@chvsep
+ }%
+ \def\BRbooktitlestyle##1{}%
+ \def\BRchapterstyle##1{}%
+ \def\BRbkchsep{}%
+ \def\BRchvsep{}%
+ \def\@bv@idxpgformat{#1}%
+ \@bv@idxtrue\def\@bv@idxentry{}\@bible@verse
+}
\newcommand*{\bvidxpgformat}{textrm}
\endinput
%%