%%
%% This is file `bibleref-manual.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% bibleref.dtx  (with options: `bibleref-manual.tex,package')
%% 
%%  bibleref.dtx
%%  Copyright 2010 Nicola Talbot
%% 
%%  This work may be distributed and/or modified under the
%%  conditions of the LaTeX Project Public License, either version 1.3
%%  of this license of (at your option) any later version.
%%  The latest version of this license is in
%%    http://www.latex-project.org/lppl.txt
%%  and version 1.3 or later is part of all distributions of LaTeX
%%  version 2005/12/01 or later.
%% 
%%  This work has the LPPL maintenance status `maintained'.
%% 
%%  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.
%% 
%% \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
%%   Lower-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
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
\documentclass{nlctdoc}

\usepackage{bibleref}
\usepackage[colorlinks,bookmarks,pdfauthor={Nicola L.C. Talbot},
            hyperindex=false,
            pdftitle={bibleref.sty: a LaTeX package for
            typesetting bible references}]{hyperref}

\usepackage{creatdtx}

\CheckSum{1892}

\begin{document}
\title{bibleref.sty v1.12: a \LaTeXe\ package for
typesetting bible references}
\author{Nicola Talbot\\[10pt]
School of Computing Sciences\\
University of East Anglia\\
Norwich. Norfolk. NR4 7TJ.\\
United Kingdom\\
\url{http://theoval.cmp.uea.ac.uk/~nlct/}}
\date{11th May 2010}

\maketitle
\tableofcontents

\section{Introduction}

The \sty{bibleref} package was designed to provide consistent formatting for referencing
parts of the bible.

\begin{definition}[\DescribeMacro{\bibleverse}]
\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.

The book title, \meta{book title}, may be given either as the
full title (e.g.\ \texttt{Matthew}) or as an abbreviation (e.g.\
\texttt{Mt} or \texttt{Matt}), most standard abbreviations are
recognised.  Books with multiple parts should be preceded by the
book number in uppercase roman numerals. For example, the second
book of Kings should be entered as \verb|\bibleverse{IIKings}|

You may have any number, or zero, sets of parenthesis
\verb|(|\meta{chapter}\texttt{:}\meta{verse(s)}\verb|)|,
indicating the chapter and verse or verses. Verses can be
specified as a comma separated list of individual verses or range
of verses. A range of verses should be written with a single
hyphen, e.g.\ \verb|2-4|. In the typeset output the verses will
be separated with
\begin{definition}[\DescribeMacro{\BRvsep}]
\cs{BRvsep}
\end{definition}
(an en-dash by default.) A chapter may be referenced without a
verse, but the colon must remain, e.g.\ \verb|(12:)| simply
indicates chapter 12.

A range of verses spanning more than one chapter can
be entered as \texttt(\meta{ch}\texttt:\meta{v}\texttt{)-(}\meta
{ch}\texttt:\meta{v}\texttt)

Examples:
\begin{center}
\begin{tabular}{ll}
\verb|\bibleverse{Ex}| & \bibleverse{Ex}\\
\verb|\bibleverse{Exodus}(20:)| & \bibleverse{Exodus}(20:)\\
\verb|\bibleverse{Exod}(20:17)| & \bibleverse{Exod}(20:17)\\
\verb|\bibleverse{IICo}(12:21)| & \bibleverse{IICo}(12:21)\\
\verb|\bibleverse{IICor}(12:21-32)| & \bibleverse{IICor}(12:21-32)\\
\verb|\bibleverse{Ex}(20:17)(21:3)| & \bibleverse{Ex}(20:17)(21:3)\\
\verb|\bibleverse{Ex}(15:)(17:)(20:)| & \bibleverse{Ex}(15:)(17:)(20:)\\
\verb|\bibleverse{Rev}(1:2,5,7-9,11)| & \bibleverse{Rev}(1:2,5,7-9,11)\\
\verb|\bibleverse{IChronicles}(1:3)-(2:7)| &
\bibleverse{IChronicles}(1:3)-(2:7)
\end{tabular}
\end{center}

The style of the reference can be specified either by
package option or as the argument to the command
\begin{definition}[\DescribeMacro{\biblerefstyle}]
\cs{biblerefstyle}\marg{style}
\end{definition}
Styles are listed in Table~\ref{tab:styles}.

\begin{table}[tbh]
\caption{Bible Citation Styles (can be used as package option or in the argument to
\cs{biblerefstyle})}
\label{tab:styles}
\vspace{10pt}
\begin{center}
\begin{tabular}{lp{0.5\textwidth}}
\bfseries Style & \bfseries Example\\
default & \biblerefstyle{default}\bibleverse{IICor}(12:1-5)\\
jerusalem & \biblerefstyle{jerusalem}\bibleverse{IICor}(12:1-5)\\
anglosaxon & \biblerefstyle{anglosaxon}\bibleverse{IICor}(12:1-5)\\
JEH & \biblerefstyle{JEH}\bibleverse{IICor}(12:1-5)\\
NTG & \biblerefstyle{NTG}\bibleverse{IICor}(12:1-5)\\
MLA & \biblerefstyle{MLA}\bibleverse{IICor}(12:1-5)\\
chicago & \biblerefstyle{chicago}\bibleverse{IICor}(12:1-5)\\
text & \biblerefstyle{text}\bibleverse{IICor}(12:1-5)
\end{tabular}
\end{center}
\end{table}

You can change the name of a book using
\begin{definition}[\DescribeMacro{\setbooktitle}]
\cs{setbooktitle}\marg{name}\marg{new title}
\end{definition}
Note that \meta{name} must be the full name, not the
abbreviated name of the book. For example, to change
Revelation to Apoc, do
\verb|\setbookname{Revelation}{Apoc}|
(\textbf{Note} that you shouldn't do
\verb|\setbookname{Rev}{Apoc}|)

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}[\DescribeMacro{\setindexbooktitle}]
\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.

You can add a book using
\begin{definition}[\DescribeMacro{\addbiblebook}]
\cs{addbiblebook}\marg{name}\marg{title}
\end{definition}
For example:
\begin{verbatim}
\addbiblebook{Susanna}{Story of Susanna}
\end{verbatim}
\toTop

\section{Defining New Styles}

You can define a new style using the command
\begin{definition}[\DescribeMacro{\newbiblerefstyle}]
\cs{newbiblerefstyle}\marg{style-name}\marg{commands}
\end{definition}\noindent
where \meta{commands} are
the commands needed to modify the citation style.

Example:
This new style is based on the \qt{default} style, but
has verses in lower case Roman numerals, and redefines
\qt{Revelation} as \qt{Apocalypse}.
\begin{verbatim}
\newbiblerefstyle{sample}{%
\biblerefstyle{default}%
\renewcommand{\BRversestyle}[1]{\romannumeral##1}%
\setbooktitle{Revelation}{Apocalypse}%
}
\end{verbatim}
Note the use of \verb|##1| instead of \verb|#1|.
\toTop

\section{Indexing Bible References}

\begin{definition}[\DescribeMacro{\ibibleverse}]
\cs{ibibleverse}\marg{book title}\texttt(\marg{chapter}\texttt{:}\meta{verse(s)}\texttt)
\end{definition}
This does the same as \cs{bibleverse}
but also adds an index entry (provided you have used
\cs{makeindex} in the preamble.) The default page number
format is given by the command
\begin{definition}[\DescribeMacro{\bvidxpgformat}]
\cs{bvidxpgformat}
\end{definition}
This is \texttt{textrm} by default, but can be redefined. To
override the page number format for a particular entry you can
use the optional argument to \cs{ibibleverse}. For example:
\begin{verbatim}
\ibibleverse[textit]{Exodus}
\end{verbatim}
(Note there is no backslash.)

You may need to create your own custom \app{makeindex} style file
as the default uses a comma and space to separate the item from
the page number, which may cause confusion. For example, you
could create a file called \texttt{sample.ist} and write in the
lines:
\begin{verbatim}
delim_0 "\\dotfill "
delim_1 "\\dotfill "
delim_2 "\\dotfill "
\end{verbatim}
See the \app{makeindex} documentation for further details.
\toTop

\subsection{Separate Scripture Index}

If you want a separate index for bible verses, in addition to
a general index, you can redefine
\begin{definition}[\DescribeMacro{\biblerefindex}]
\cs{biblerefindex}
\end{definition}
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.
\toTop

\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.

\begin{definition}[\DescribeMacro{\biblerefmap}]
\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}
\toTop

\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
\toTop
}

\end{document}
\endinput
%%
%% End of file `bibleref-manual.tex'.
