summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/bibleref
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-04-27 00:58:54 +0000
committerKarl Berry <karl@freefriends.org>2010-04-27 00:58:54 +0000
commitfc9af029ad8683806201fc8c5e8daced875f73ed (patch)
tree32e86feba2b89899941ca4c04a57d68fda6a2c0f /Master/texmf-dist/source/latex/bibleref
parent1b570aab05990839c9b3f6a0852d952688ed5a06 (diff)
bibleref 1.09 (26apr10)
git-svn-id: svn://tug.org/texlive/trunk@18014 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/bibleref')
-rw-r--r--Master/texmf-dist/source/latex/bibleref/bibleref.dtx201
-rw-r--r--Master/texmf-dist/source/latex/bibleref/bibleref.ins6
2 files changed, 193 insertions, 14 deletions
diff --git a/Master/texmf-dist/source/latex/bibleref/bibleref.dtx b/Master/texmf-dist/source/latex/bibleref/bibleref.dtx
index 8dc3359c8c9..9d3b8c60841 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/2/6 14:11
+% Created on 2010/4/26 11:18
%\fi
%\iffalse
%<*package>
@@ -56,7 +56,6 @@
\RecordChanges
\PageIndex
\CodelineNumbered
-\OnlyDescription
\newcommand{\sty}[1]{\textsf{#1}}
\newcommand*{\ics}[1]{\cs{#1}\SpecialMainIndex{#1}}
@@ -80,15 +79,17 @@
}
+\newcommand*{\app}[1]{\texttt{#1}}
-\CheckSum{1656}
+\OnlyDescription
+\CheckSum{1719}
\begin{document}
\DocInput{bibleref.dtx}
\end{document}
%</driver>
%\fi
-%\title{bibleref.sty v1.08: a \LaTeXe\ package for
+%\title{bibleref.sty v1.09: a \LaTeXe\ package for
%typesetting bible references}
%\author{Nicola Talbot\\[10pt]
%School of Computing Sciences\\
@@ -96,7 +97,7 @@
%Norwich. Norfolk. NR4 7TJ.\\
%United Kingdom\\
%\url{http://theoval.cmp.uea.ac.uk/~nlct/}}
-%\date{6 Feb 2010}
+%\date{26th April 2010}
%\maketitle
%\tableofcontents
%
@@ -190,6 +191,16 @@
%(\textbf{Note} that you shouldn't do
%\verb|\setbookname{Rev}{Apoc}|)
%
+%\DescribeMacro{\addbiblebook}
+%You can add a book using
+%\begin{definition}
+%\cs{addbiblebook}\marg{name}\marg{title}
+%\end{definition}
+%For example:
+%\begin{verbatim}
+%\addbiblebook{Susanna}{Story of Susanna}
+%\end{verbatim}
+%
%\section{Defining New Styles}
%
%You can define a new style using the command
@@ -232,16 +243,79 @@
%\end{verbatim}
%(Note there is no backslash.)
%
+%\subsection{Separate Scripture Index}
+%
+%If you want a separate index for bible verses, in addition to
+%a general index, you can redefine \DescribeMacro{\biblerefindex}\cs{biblerefindex}.
+%This command defaults to \cs{index}, but can be changed to
+%the appropriate indexing command. For example, suppose you
+%are using the \sty{multind} package and you want a general
+%index and a scripture index, you can do something like:
+%\begin{verbatim}
+%\documentclass{article}
+%\usepackage{bibleref}
+%\usepackage{multind}
+%
+%\makeindex{scripture}
+%\makeindex{general}
+%
+%\renewcommand{\biblerefindex}{\index{scripture}}
+%\end{verbatim}
+%In the document, you can use \cs{ibibleverse} as before, and
+%the scripture index is displayed using
+%\begin{verbatim}
+%\printindex{scripture}{Scripture Index}
+%\end{verbatim}
+%You will then need to run \app{makeindex} on the file
+%\texttt{scripture.idx}. See the \sty{multind} documentation
+%for further details.
+%
+%\subsection{Changing the Sort Order}
+%
+%The bible reference entries will be sorted alphabetically by
+%\app{makeindex}. However you may prefer the entries to be sorted
+%according to their order in the bible. This can either be done
+%using \app{xindy} instead of \app{makeindex} and creating your
+%own custom alphabet (see \app{xindy} manual for details) or you
+%can use \sty{bibleref}'s mapping command.
+%
+%\DescribeMacro{\biblerefmap}
+%\begin{definition}
+%\cs{biblerefmap}\marg{label}\marg{new sort key}
+%\end{definition}
+%For example, in the preamble:
+%\begin{verbatim}
+%\biblerefmap{Genesis}{01}
+%\biblerefmap{Exodus}{02}
+%\biblerefmap{Leviticus}{03}
+%\biblerefmap{Numbers}{04}
+%\biblerefmap{Deuteronomy}{05}
+%...
+%\end{verbatim}
+%When you run \app{makeindex}, the references will now be sorted
+%in numerical order.
+%
+%If you want to subdivide the index into, say, old and new
+%testament, you can add this to the mapping. For example:
+%\begin{verbatim}
+%\biblerefmap{Genesis}{1@Old Testament!01}
+%\biblerefmap{Exodus}{1@Old Testament!02}
+%\biblerefmap{Leviticus}{1@Old Testament!03}
+%\biblerefmap{Numbers}{1@Old Testament!04}
+%\biblerefmap{Deuteronomy}{1@Old Testament!05}
+%...
+%\biblerefmap{Matthew}{2@New Testament!01}
+%\biblerefmap{Mark}{2@New Testament!02}
+%...
+%\end{verbatim}
+%
%\section{Acknowledgements}
%Many thanks to all the useful comments from comp.text.tex,
%especially from Jesse~Billett, Brooks~Moses and Ulrich~M.~Schwarz.
%
-%\StopEventually{\phantomsection
-%\addcontentsline{toc}{section}{Index}\PrintIndex
-%}
-%
%
%
+%\StopEventually{}
%\section{The Code}
%\iffalse
% \begin{macrocode}
@@ -251,7 +325,7 @@
% Declare package
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{bibleref}[2010/02/06 1.08 (NLCT)]
+\ProvidesPackage{bibleref}[2010/04/26 1.09 (NLCT)]
% \end{macrocode}
% Need to do some conditional stuff
% \begin{macrocode}
@@ -1008,12 +1082,28 @@ defined}{}}}
% Redefines the title of book \meta{fullname}.
% \begin{macrocode}
\newcommand*{\setbooktitle}[2]{%
-\@ifundefined{br@#1}{\PackageError{biberef}{Unknown
+\@ifundefined{br@#1}{\PackageError{bibleref}{Unknown
book `#1'}{}}{%
\expandafter\def\csname br@#1\endcsname{#2}}}
% \end{macrocode}
%\end{macro}
%
+%\begin{macro}{\addbiblebook}
+%\changes{1.09}{2010/04/26}{new}
+% Add a book.
+% \begin{macrocode}
+\newcommand*{\addbiblebook}[2]{%
+ \@ifundefined{br@#1}%
+ {%
+ \expandafter\def\csname br@#1\endcsname{#2}%
+ }%
+ {%
+ \PackageError{bibleref}{Book `#1' already defined}{}%
+ }%
+}
+% \end{macrocode}
+%\end{macro}
+%
%\begin{macro}{\biblerefstyle}
%\begin{definition}
%\cs{biblerefstyle}\marg{style}
@@ -1114,15 +1204,47 @@ Unknown biblerefstyle '#1'}{}}{\csname brs@#1\endcsname}}
%\begin{macro}{\@end@@bibleverse}
% This controls what to do at the end of the final
% verse.
+%\changes{1.09}{2009/04/26}{replaced \cs{index} with \cs{biblerefindex}}
% \begin{macrocode}
\newcommand*{\@end@@bibleverse}{%
\if@bv@idx
-\index{\@@bv@idxsort\relax @\@bv@idxentry|\@bv@idxpgformat}%
+ \expandafter\@do@bibleref@map\@@bv@idxsort\relax
+ \biblerefindex{\@@bv@idxsort\relax @\@bv@idxentry|\@bv@idxpgformat}%
\@bv@idxfalse
\fi
}
% \end{macrocode}
%\end{macro}
+%\begin{macro}{\biblerefindex}
+% Allow user to modify index command in case multiple indices
+% are required.
+%\changes{1.09}{2009/04/26}{new}
+% \begin{macrocode}
+\newcommand*{\biblerefindex}{\index}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\biblerefmap}
+% Map the sort key to something else. Overwrites previous mapping
+% for the given key.
+%\changes{1.09}{2009/04/26}{new}
+% \begin{macrocode}
+\newcommand*{\biblerefmap}[2]{%
+ \expandafter\def\csname @bibleref@map@#1\endcsname{#2}%
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@do@bibleref@map}
+% \begin{macrocode}
+\def\@do@bibleref@map#1\relax{%
+ \@ifundefined{@bibleref@map@#1}{}{%
+ \expandafter\let\expandafter\@@bv@idxsort
+ \csname @bibleref@map@#1\endcsname
+ }%
+}
+% \end{macrocode}
+%\end{macro}
%
%\begin{macro}{\@bv@do}
% Do argument and add to idx
@@ -1204,6 +1326,61 @@ Unknown biblerefstyle '#1'}{}}{\csname brs@#1\endcsname}}
%\fi
%\iffalse
% \begin{macrocode}
+%<*sample-multind.tex>
+% \end{macrocode}
+%\fi
+%\subsection{Sample Document with Multiple Indices}
+% \begin{macrocode}
+\documentclass{article}
+
+\usepackage{bibleref}
+\usepackage{multind}
+
+\makeindex{scripture}
+\makeindex{general}
+
+\renewcommand{\biblerefindex}{\index{scripture}}
+
+\biblerefmap{Genesis}{1@Old Testament!1}
+\biblerefmap{Exodus}{1@Old Testament!2}
+\biblerefmap{Leviticus}{1@Old Testament!3}
+\biblerefmap{Numbers}{1@Old Testament!4}
+\biblerefmap{Deuteronomy}{1@Old Testament!5}
+
+\biblerefmap{Tobit}{2@Apocrypha!3}
+
+\biblerefmap{Matthew}{3@New Testament!1}
+\biblerefmap{Mark}{3@New Testament!2}
+\biblerefmap{Luke}{3@New Testament!3}
+\biblerefmap{John}{3@New Testament!4}
+\biblerefmap{Acts}{3@New Testament!5}
+\biblerefmap{Romans}{3@New Testament!6}
+\biblerefmap{Corinthians1}{3@New Testament!7}
+
+\begin{document}
+Something for the general index\index{general}{something}.
+
+An old testament reference \ibibleverse{Genesis}(1:1-10).
+A new testament reference \ibibleverse{ICor}.
+
+Something else for the general index\index{general}{another}.
+
+Another old testament reference \ibibleverse{Ex}.
+Another new testament reference \ibibleverse{Matt}.
+
+\ibibleverse{Tobit}
+
+\printindex{scripture}{Scripture Index}
+\printindex{general}{General Index}
+\end{document}
+% \end{macrocode}
+%\iffalse
+% \begin{macrocode}
+%</sample-multind.tex>
+% \end{macrocode}
+%\fi
+%\iffalse
+% \begin{macrocode}
%<*sample.tex>
% \end{macrocode}
%\fi
diff --git a/Master/texmf-dist/source/latex/bibleref/bibleref.ins b/Master/texmf-dist/source/latex/bibleref/bibleref.ins
index 82224879641..4f423c625e7 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/2/6 14:11
+% bibleref.ins generated using makedtx version 0.94b 2010/4/26 11:18
\input docstrip
\preamble
@@ -18,7 +18,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, sample.tex, bibleref.perl.
+ This work consists of the files bibleref.dtx and bibleref.ins and the derived files bibleref.sty, sample-multind.tex, sample.tex, bibleref.perl.
\endpreamble
@@ -26,6 +26,8 @@
\generate{\file{bibleref.sty}{\usepreamble\defaultpreamble
\usepostamble\defaultpostamble\from{bibleref.dtx}{bibleref.sty,package}}
+\file{sample-multind.tex}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{bibleref.dtx}{sample-multind.tex,package}}
\file{sample.tex}{\usepreamble\defaultpreamble
\usepostamble\defaultpostamble\from{bibleref.dtx}{sample.tex,package}}
\file{bibleref.perl}{\nopreamble\nopostamble\from{bibleref.dtx}{bibleref.perl}}