%\iffalse
% bibleref.dtx generated using makedtx version 0.94b (c) Nicola Talbot
% Command line args:
%   -macrocode "bibleref.perl"
%   -setambles ".*\.perl=>\nopreamble\nopostamble"
%   -comment "bibleref.perl"
%   -comment ".+\.tex"
%   -src "(.+)\.(sty)=>\1.\2"
%   -src "(.+)\.(tex)=>\1.\2"
%   -src "bibleref.perl\Z=>bibleref.perl"
%   -doc "bibleref-manual.tex"
%   -author "Nicola Talbot"
%   bibleref
% Created on 2010/5/11 18:06
%\fi
%\iffalse
%<*package>
%% \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         \~}
%</package>
%\fi
% \iffalse
% Doc-Source file to use with LaTeX2e
% Copyright (C) 2010 Nicola Talbot, all rights reserved.
% \fi
% \iffalse
%<*driver>
\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}



\CheckSum{1892}

\begin{document}
\DocInput{bibleref.dtx}
\end{document}
%</driver>
%\fi
%\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
%}
%
%
%
%\section{The Code}
%\iffalse
%    \begin{macrocode}
%<*bibleref.sty>
%    \end{macrocode}
%\fi
% Declare package
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{bibleref}[2010/05/11 1.12 (NLCT)]
%    \end{macrocode}
% Need to do some conditional stuff
%    \begin{macrocode}
\RequirePackage{ifthen}
%    \end{macrocode}
% The fmtcount package is needed for the full text
% citations
%    \begin{macrocode}
\RequirePackage{fmtcount}
%    \end{macrocode}
%\begin{macro}{\BRbooknumberstyle}
% The style of the book
% number. By default, it simply displays its argument
%followed by a space.
%    \begin{macrocode}
\newcommand*{\BRbooknumberstyle}[1]{#1 }
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\BRepistlenumberstyle}
% As above, but for epistle.
%    \begin{macrocode}
\newcommand*{\BRepistlenumberstyle}[1]{#1 }
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\BRbookof}
%The text to go before the book title.
%This by default is nothing,
% but can be changed to, e.g., \qt{The book of }
%    \begin{macrocode}
\newcommand*{\BRbookof}{}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\BRgospel}
%As above but for gospels
%    \begin{macrocode}
\newcommand*{\BRgospel}{}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\BRepistleto}
% As above but for epistles to
% someone.
%    \begin{macrocode}
\newcommand*{\BRepistleto}{}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\BRepistletothe}
% As above but for epistles to 
% people.
%    \begin{macrocode}
\newcommand*{\BRepistletothe}{}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\BRepistleof}
% As above but for \qt{epistles of }
%    \begin{macrocode}
\newcommand*{\BRepistleof}{}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\BRbooktitlestyle}
% The style of the
% book title. By default, it simply displays its argument.
%    \begin{macrocode}
\newcommand*{\BRbooktitlestyle}[1]{#1}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\BRchapterstyle}
% The style of the chapter number.
% By default it simply displays its argument.
%    \begin{macrocode}
\newcommand*{\BRchapterstyle}[1]{#1}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\BRversestyle}
%The style of the verse number.
% By default is simply displays its argument.
%    \begin{macrocode}
\newcommand*{\BRversestyle}[1]{#1}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\BRversesuffixstyle}
%The style of the verse suffix.
% By default is simply displays its argument.
%    \begin{macrocode}
\newcommand*{\BRversesuffixstyle}[1]{#1}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\BRbkchsep}
%The separator between the book title
% and the chapter number
%    \begin{macrocode}
\newcommand*{\BRbkchsep}{ }
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\BRchvsep}
% The separator between chapter
% and verse numbers. By default this is simply a colon.
%    \begin{macrocode}
\newcommand*{\BRchvsep}{:}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\BRchsep}
% The separator between multiple chapters.
% By default this is simply a semi-colon.
%    \begin{macrocode}
\newcommand*{\BRchsep}{;}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\BRvrsep}
% The separator between the beginning
% and ending of a range of verses. By default this
% is simply an en-dash.
%    \begin{macrocode}
\newcommand*{\BRvrsep}{--}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\BRvsep}
%The separator between a list of verses.
%    \begin{macrocode}
\newcommand*{\BRvsep}{,}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\BRperiod}
% This can be redefined to put a full stop after 
% book names.
%    \begin{macrocode}
\newcommand*{\BRperiod}{}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\brfullname}
% This will switch to using the full book title.
%\changes{1.08}{2008/05/12}{fixed error in spelling of \cs{br@Jeremiah}}
%    \begin{macrocode}
\newcommand*{\brfullname}{%
\def\br@Genesis{\BRbookof Genesis}%
\def\br@Exodus{\BRbookof Exodus}%
\def\br@Leviticus{\BRbookof Leviticus}%
\def\br@Numbers{\BRbookof Numbers}%
\def\br@Deuteronomy{\BRbookof Deuteronomy}%
\def\br@Joshua{\BRbookof Joshua}%
\def\br@Judges{\BRbookof Judges}%
\def\br@Ruth{\BRbookof Ruth}%
\def\br@ISamuel{\BRbooknumberstyle{1}\BRbookof Samuel}%
\def\br@IISamuel{\BRbooknumberstyle{2}\BRbookof Samuel}%
\def\br@IKings{\BRbooknumberstyle{1}\BRbookof Kings}%
\def\br@IIKings{\BRbooknumberstyle{2}\BRbookof Kings}%
\def\br@IChronicles{\BRbooknumberstyle{1}\BRbookof Chronicles}%
\def\br@IIChronicles{\BRbooknumberstyle{2}\BRbookof Chronicles}%
\def\br@Ezra{\BRbookof Ezra}%
\def\br@Nehemiah{\BRbookof Nehemiah}%
\def\br@Tobit{\BRbookof Tobit}%
\def\br@Judith{\BRbookof Judith}%
\def\br@Esther{\BRbookof Esther}%
\def\br@IMaccabees{\BRbooknumberstyle{1}\BRbookof Maccabees}%
\def\br@IIMaccabees{\BRbooknumberstyle{2}\BRbookof Maccabees}%
\def\br@Job{\BRbookof Job}%
\def\br@Psalms{\BRbookof Psalms}%
\def\br@Proverbs{\BRbookof Proverbs}%
\def\br@Ecclesiastes{\BRbookof Ecclesiastes}%
\def\br@SongofSongs{\BRbookof Song of Songs}%
\def\br@Wisdom{\BRbookof Wisdom}%
\def\br@Ecclesiasticus{\BRbookof Ecclesiasticus}%
\def\br@Isaiah{\BRbookof Isaiah}%
\def\br@Jeremiah{\BRbookof Jeremiah}%
\def\br@Lamentations{\BRbookof Lamentations}%
\def\br@Baruch{\BRbookof Baruch}%
\def\br@Ezekiel{\BRbookof Ezekiel}%
\def\br@Daniel{\BRbookof Daniel}%
\def\br@Hosea{\BRbookof Hosea}%
\def\br@Joel{\BRbookof Joel}%
\def\br@Amos{\BRbookof Amos}%
\def\br@Obadiah{\BRbookof Obadiah}%
\def\br@Jonah{\BRbookof Jonah}%
\def\br@Micah{\BRbookof Micah}%
\def\br@Nahum{\BRbookof Nahum}%
\def\br@Habakkuk{\BRbookof Habakkuk}%
\def\br@Zephaniah{\BRbookof Zephaniah}%
\def\br@Haggai{\BRbookof Haggai}%
\def\br@Zechariah{\BRbookof Zechariah}%
\def\br@Malachi{\BRbookof Malachi}%
\def\br@Matthew{\BRgospel Matthew}%
\def\br@Mark{\BRgospel Mark}%
\def\br@Luke{\BRgospel Luke}%
\def\br@John{\BRgospel John}%
\def\br@Acts{Acts}%
\def\br@Romans{\BRepistletothe Romans}%
\def\br@ICorinthians{\BRepistlenumberstyle{1}\BRepistletothe Corinthians}%
\def\br@IICorinthians{\BRepistlenumberstyle{2}\BRepistletothe Corinthians}%
\def\br@Galatians{\BRepistletothe Galatians}%
\def\br@Ephesians{\BRepistletothe Ephesians}%
\def\br@Philippians{\BRepistletothe Philippians}%
\def\br@Colossians{\BRepistletothe Colossians}%
\def\br@IThessalonians{\BRepistlenumberstyle{1}\BRepistletothe Thessalonians}%
\def\br@IIThessalonians{\BRepistlenumberstyle{2}\BRepistletothe Thessalonians}%
\def\br@ITimothy{\BRepistlenumberstyle{1}\BRepistleto Timothy}%
\def\br@IITimothy{\BRepistlenumberstyle{2}\BRepistleto Timothy}%
\def\br@Titus{\BRepistleto Titus}%
\def\br@Philemon{\BRepistleto Philemon}%
\def\br@Hebrews{\BRepistletothe Hebrews}%
\def\br@James{\BRepistleof James}%
\def\br@IPeter{\BRepistlenumberstyle{1}\BRepistleof Peter}%
\def\br@IIPeter{\BRepistlenumberstyle{2}\BRepistleof Peter}%
\def\br@IJohn{\BRepistlenumberstyle{1}\BRepistleof John}%
\def\br@IIJohn{\BRepistlenumberstyle{2}\BRepistleof John}%
\def\br@IIIJohn{\BRepistlenumberstyle{3}\BRepistleof John}%
\def\br@Jude{\BRepistleof Jude}%
\def\br@Revelation{\BRbookof Revelation}}
%    \end{macrocode}
%\end{macro}
% Set full names as the default
%    \begin{macrocode}
\brfullname
%    \end{macrocode}
%
%\begin{macro}{\brabbrvname}
% This will switch to an abbreviated form for the book titles.
%    \begin{macrocode}
\newcommand*{\brabbrvname}{%
\def\br@Genesis{Gn\BRperiod}%
\def\br@Exodus{Ex\BRperiod}%
\def\br@Leviticus{Lv\BRperiod}%
\def\br@Numbers{Nb\BRperiod}%
\def\br@Deuteronomy{Dt\BRperiod}%
\def\br@Joshua{Jos\BRperiod}%
\def\br@Judges{Jg\BRperiod}%
\def\br@Ruth{Rt\BRperiod}%
\def\br@ISamuel{\BRbooknumberstyle{1}S\BRperiod}%
\def\br@IISamuel{\BRbooknumberstyle{2}S\BRperiod}%
\def\br@IKings{\BRbooknumberstyle{1}K\BRperiod}%
\def\br@IIKings{\BRbooknumberstyle{2}K\BRperiod}%
\def\br@IChronicles{\BRbooknumberstyle{1}Ch\BRperiod}%
\def\br@IIChronicles{\BRbooknumberstyle{2}Ch\BRperiod}%
\def\br@Ezra{Ezr\BRperiod}%
\def\br@Nehemiah{Ne\BRperiod}%
\def\br@Tobit{Tb\BRperiod}%
\def\br@Judith{Jdt\BRperiod}%
\def\br@Esther{Est\BRperiod}%
\def\br@IMaccabees{\BRbooknumberstyle{1}M\BRperiod}%
\def\br@IIMaccabees{\BRbooknumberstyle{2}M\BRperiod}%
\def\br@Job{Jb\BRperiod}%
\def\br@Psalms{Ps\BRperiod}%
\def\br@Proverbs{Pr\BRperiod}%
\def\br@Ecclesiastes{Qo\BRperiod}%
\def\br@SongofSongs{Sg\BRperiod}%
\def\br@Wisdom{Ws\BRperiod}%
\def\br@Ecclesiasticus{Si\BRperiod}%
\def\br@Isaiah{Is\BRperiod}%
\def\br@Jeremiah{Jr\BRperiod}%
\def\br@Lamentations{Lm\BRperiod}%
\def\br@Baruch{Ba\BRperiod}%
\def\br@Ezekiel{Ezk\BRperiod}%
\def\br@Daniel{Dn\BRperiod}%
\def\br@Hosea{Ho\BRperiod}%
\def\br@Joel{Jl\BRperiod}%
\def\br@Amos{Am\BRperiod}%
\def\br@Obadiah{Ob\BRperiod}%
\def\br@Jonah{Jon\BRperiod}%
\def\br@Micah{Mi\BRperiod}%
\def\br@Nahum{Na\BRperiod}%
\def\br@Habakkuk{Hab\BRperiod}%
\def\br@Zephaniah{Zp\BRperiod}%
\def\br@Haggai{Hg\BRperiod}%
\def\br@Zechariah{Zc\BRperiod}%
\def\br@Malachi{Ml\BRperiod}%
\def\br@Matthew{Mt\BRperiod}%
\def\br@Mark{Mk\BRperiod}%
\def\br@Luke{Lk\BRperiod}%
\def\br@John{Jn\BRperiod}%
\def\br@Acts{Ac\BRperiod}%
\def\br@Romans{Rm\BRperiod}%
\def\br@ICorinthians{\BRepistlenumberstyle{1}Co\BRperiod}%
\def\br@IICorinthians{\BRepistlenumberstyle{2}Co\BRperiod}%
\def\br@Galatians{Ga\BRperiod}%
\def\br@Ephesians{Ep\BRperiod}%
\def\br@Philippians{Ph\BRperiod}%
\def\br@Colossians{Col\BRperiod}%
\def\br@IThessalonians{\BRepistlenumberstyle{1}Th\BRperiod}%
\def\br@IIThessalonians{\BRepistlenumberstyle{2}Th\BRperiod}%
\def\br@ITimothy{\BRepistlenumberstyle{1}Tm\BRperiod}%
\def\br@IITimothy{\BRepistlenumberstyle{2}Tm\BRperiod}%
\def\br@Titus{Tt\BRperiod}%
\def\br@Philemon{Phm\BRperiod}%
\def\br@Hebrews{Heb\BRperiod}%
\def\br@James{Jm\BRperiod}%
\def\br@IPeter{\BRepistlenumberstyle{1}P\BRperiod}%
\def\br@IIPeter{\BRepistlenumberstyle{2}P\BRperiod}%
\def\br@IJohn{\BRepistlenumberstyle{1}Jn\BRperiod}%
\def\br@IIJohn{\BRepistlenumberstyle{2}Jn\BRperiod}%
\def\br@IIIJohn{\BRepistlenumberstyle{3}Jn\BRperiod}%
\def\br@Jude{Jude}%
\def\br@Revelation{Rv\BRperiod}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\braltabbrvname}
% This switches to an alternative set of abbreviations.
%    \begin{macrocode}
\newcommand*{\braltabbrvname}{%
\def\br@Genesis{Gen\BRperiod}%
\def\br@Exodus{Exod\BRperiod}%
\def\br@Leviticus{Lev\BRperiod}%
\def\br@Numbers{Num\BRperiod}%
\def\br@Deuteronomy{Deut\BRperiod}%
\def\br@Joshua{Josh\BRperiod}%
\def\br@Judges{Judg\BRperiod}%
\def\br@Ruth{Ruth}%
\def\br@ISamuel{\BRbooknumberstyle{1}Sam\BRperiod}%
\def\br@IISamuel{\BRbooknumberstyle{2}Sam\BRperiod}%
\def\br@IKings{\BRbooknumberstyle{1}Kgs\BRperiod}%
\def\br@IIKings{\BRbooknumberstyle{2}Kgs\BRperiod}%
\def\br@IChronicles{\BRbooknumberstyle{1}Chr\BRperiod}%
\def\br@IIChronicles{\BRbooknumberstyle{2}Chr\BRperiod}%
\def\br@Ezra{Ezra}%
\def\br@Nehemiah{Neh\BRperiod}%
\def\br@Tobit{Tobit}%
\def\br@Judith{Judith}%
\def\br@Esther{Esther}%
\def\br@IMaccabees{\BRbooknumberstyle{1}M\BRperiod}%
\def\br@IIMaccabees{\BRbooknumberstyle{2}M\BRperiod}%
\def\br@Job{Job}%
\def\br@Psalms{Ps\BRperiod}%
\def\br@Proverbs{Prov\BRperiod}%
\def\br@Ecclesiastes{Eccles\BRperiod}%
\def\br@SongofSongs{S\BRperiod\ of S\BRperiod}%
\def\br@Wisdom{Wisd\BRperiod}%
\def\br@Ecclesiasticus{Ecclus\BRperiod}%
\def\br@Isaiah{Isa\BRperiod}%
\def\br@Jeremiah{Jer\BRperiod}%
\def\br@Lamentations{Lam\BRperiod}%
\def\br@Baruch{Baruch}%
\def\br@Ezekiel{Ezek\BRperiod}%
\def\br@Daniel{Dan\BRperiod}%
\def\br@Hosea{Hos\BRperiod}%
\def\br@Joel{Joel}%
\def\br@Amos{Amos}%
\def\br@Obadiah{Obad}%
\def\br@Jonah{Jonah}%
\def\br@Micah{Mic\BRperiod}%
\def\br@Nahum{Nah\BRperiod}%
\def\br@Habakkuk{Hab\BRperiod}%
\def\br@Zephaniah{Zeph\BRperiod}%
\def\br@Haggai{Hag\BRperiod}%
\def\br@Zechariah{Zech\BRperiod}%
\def\br@Malachi{Mal\BRperiod}%
\def\br@Matthew{Matt\BRperiod}%
\def\br@Mark{Mark}%
\def\br@Luke{Luke}%
\def\br@John{John}%
\def\br@Acts{Acts}%
\def\br@Romans{Rom\BRperiod}%
\def\br@ICorinthians{\BRepistlenumberstyle{1}Cor\BRperiod}%
\def\br@IICorinthians{\BRepistlenumberstyle{2}Cor\BRperiod}%
\def\br@Galatians{Gal\BRperiod}%
\def\br@Ephesians{Eph\BRperiod}%
\def\br@Philippians{Phil\BRperiod}%
\def\br@Colossians{Col\BRperiod}%
\def\br@IThessalonians{\BRepistlenumberstyle{1}Thess\BRperiod}%
\def\br@IIThessalonians{\BRepistlenumberstyle{2}Thess\BRperiod}%
\def\br@ITimothy{\BRepistlenumberstyle{1}Tim\BRperiod}%
\def\br@IITimothy{\BRepistlenumberstyle{2}Tim\BRperiod}%
\def\br@Titus{Tit\BRperiod}%
\def\br@Philemon{Philem\BRperiod}%
\def\br@Hebrews{Heb\BRperiod}%
\def\br@James{Jas\BRperiod}%
\def\br@IPeter{\BRepistlenumberstyle{1}Pet\BRperiod}%
\def\br@IIPeter{\BRepistlenumberstyle{2}Pet\BRperiod}%
\def\br@IJohn{\BRepistlenumberstyle{1}John}%
\def\br@IIJohn{\BRepistlenumberstyle{2}John}%
\def\br@IIIJohn{\BRepistlenumberstyle{3}John}%
\def\br@Jude{Jude}%
\def\br@Revelation{Rev\BRperiod}}
%    \end{macrocode}
%\end{macro}
% Provide synonymns.
%    \begin{macrocode}
\newcommand*\br@Gn{\br@Genesis}%
\newcommand*\br@Ex{\br@Exodus}%
\newcommand*\br@Lv{\br@Leviticus}%
\newcommand*\br@Nb{\br@Numbers}%
\newcommand*\br@Dt{\br@Deuteronomy}%
\newcommand*\br@Jos{\br@Joshua}%
\newcommand*\br@Jg{\br@Judges}%
\newcommand*\br@Rt{\br@Ruth}%
\newcommand*\br@IS{\br@ISamuel}%
\newcommand*\br@IIS{\br@IISamuel}%
\newcommand*\br@IK{\br@IKings}%
\newcommand*\br@IIK{\br@IIKings}%
\newcommand*\br@ICh{\br@IChronicles}%
\newcommand*\br@IICh{\br@IIChronicles}%
\newcommand*\br@Ezr{\br@Ezra}%
\newcommand*\br@Ne{\br@Nehemiah}%
\newcommand*\br@Tb{\br@Tobit}%
\newcommand*\br@Jdt{\br@Judith}%
\newcommand*\br@Est{\br@Esther}%
\newcommand*\br@IM{\br@IMaccabees}%
\newcommand*\br@IIM{\br@IIMaccabees}%
\newcommand*\br@Jb{\br@Job}%
\newcommand*\br@Ps{\br@Psalms}%
\newcommand*\br@Pr{\br@Proverbs}%
\newcommand*\br@Qo{\br@Ecclesiastes}%
\newcommand*\br@Sg{\br@SongofSongs}%
\newcommand*\br@Ws{\br@Wisdom}%
\newcommand*\br@Si{\br@Ecclesiasticus}%
\newcommand*\br@Is{\br@Isaiah}%
\newcommand*\br@Jr{\br@Jeremiah}%
\newcommand*\br@Lm{\br@Lamentations}%
\newcommand*\br@Ba{\br@Baruch}%
\newcommand*\br@Ezk{\br@Ezekiel}%
\newcommand*\br@Dn{\br@Daniel}%
\newcommand*\br@Ho{\br@Hosea}%
\newcommand*\br@Jl{\br@Joel}%
\newcommand*\br@Am{\br@Amos}%
\newcommand*\br@Ob{\br@Obadiah}%
\newcommand*\br@Jon{\br@Jonah}%
\newcommand*\br@Mi{\br@Micah}%
\newcommand*\br@Na{\br@Nahum}%
\newcommand*\br@Hab{\br@Habakkuk}%
\newcommand*\br@Zp{\br@Zephaniah}%
\newcommand*\br@Hg{\br@Haggai}%
\newcommand*\br@Zc{\br@Zechariah}%
\newcommand*\br@Ml{\br@Malachi}%
\newcommand*\br@Mt{\br@Matthew}%
\newcommand*\br@Mk{\br@Mark}%
\newcommand*\br@Lk{\br@Luke}%
\newcommand*\br@Jn{\br@John}%
\newcommand*\br@Ac{\br@Acts}%
\newcommand*\br@Rm{\br@Romans}%
\newcommand*\br@ICo{\br@ICorinthians}%
\newcommand*\br@IICo{\br@IICorinthians}%
\newcommand*\br@Ga{\br@Galatians}%
\newcommand*\br@Ep{\br@Ephesians}%
\newcommand*\br@Ph{\br@Philippians}%
\newcommand*\br@Col{\br@Colossians}%
\newcommand*\br@ITh{\br@IThessalonians}%
\newcommand*\br@IITh{\br@IIThessalonians}%
\newcommand*\br@ITm{\br@ITimothy}%
\newcommand*\br@IITm{\br@IITimothy}%
\newcommand*\br@Tt{\br@Titus}%
\newcommand*\br@Phm{\br@Philemon}%
\newcommand*\br@Heb{\br@Hebrews}%
\newcommand*\br@Jm{\br@James}%
\newcommand*\br@IP{\br@IPeter}%
\newcommand*\br@IIP{\br@IIPeter}%
\newcommand*\br@IJn{\br@IJohn}%
\newcommand*\br@IIJn{\br@IIJohn}%
\newcommand*\br@Rv{\br@Revelation}
%    \end{macrocode}
% More synonyms.
%    \begin{macrocode}
\newcommand*\br@Gen{\br@Genesis}%
\newcommand*\br@Exod{\br@Exodus}%
\newcommand*\br@Lev{\br@Leviticus}%
\newcommand*\br@Num{\br@Numbers}%
\newcommand*\br@Deut{\br@Deuteronomy}%
\newcommand*\br@Josh{\br@Joshua}%
\newcommand*\br@Judg{\br@Judges}%
\newcommand*\br@ISam{\br@ISamuel}%
\newcommand*\br@IISam{\br@IISamuel}%
\newcommand*\br@IKgs{\br@IKings}%
\newcommand*\br@IIKgs{\br@IIKings}%
\newcommand*\br@IChr{\br@IChronicles}%
\newcommand*\br@IIChr{\br@IIChronicles}%
\newcommand*\br@Neh{\br@Nehemiah}%
\newcommand*\br@Esth{\br@Esther}%
\newcommand*\br@IMacc{\br@IMaccabees}%
\newcommand*\br@IIMacc{\br@IIMaccabees}%
\newcommand*\br@Prov{\br@Proverbs}%
\newcommand*\br@Eccl{\br@Ecclesiastes}%
\newcommand*\br@SofS{\br@SongofSongs}%
\newcommand*\br@Wisd{\br@Wisdom}%
\newcommand*\br@Ecclus{\br@Ecclesiasticus}%
\newcommand*\br@Isa{\br@Isaiah}%
\newcommand*\br@Jer{\br@Jeremiah}%
\newcommand*\br@Lam{\br@Lamentations}%
\newcommand*\br@Ezek{\br@Ezekiel}%
\newcommand*\br@Dan{\br@Daniel}%
\newcommand*\br@Hos{\br@Hosea}%
\newcommand*\br@Obad{\br@Obadiah}%
\newcommand*\br@Mic{\br@Micah}%
\newcommand*\br@Nah{\br@Nahum}%
\newcommand*\br@Zeph{\br@Zephaniah}%
\newcommand*\br@Hag{\br@Haggai}%
\newcommand*\br@Zech{\br@Zechariah}%
\newcommand*\br@Mal{\br@Malachi}%
\newcommand*\br@Matt{\br@Matthew}%
\newcommand*\br@Rom{\br@Romans}%
\newcommand*\br@ICor{\br@ICorinthians}%
\newcommand*\br@IICor{\br@IICorinthians}%
\newcommand*\br@Gal{\br@Galatians}%
\newcommand*\br@Eph{\br@Ephesians}%
\newcommand*\br@Phil{\br@Philippians}%
\newcommand*\br@IThess{\br@IThessalonians}%
\newcommand*\br@IIThess{\br@IIThessalonians}%
\newcommand*\br@ITim{\br@ITimothy}%
\newcommand*\br@IITim{\br@IITimothy}%
\newcommand*\br@Tit{\br@Titus}%
\newcommand*\br@Philem{\br@Philemon}%
\newcommand*\br@Jas{\br@James}%
\newcommand*\br@IPet{\br@IPeter}%
\newcommand*\br@IIPet{\br@IIPeter}%
\newcommand*\br@Rev{\br@Revelation}
%    \end{macrocode}
%\begin{macro}{\brs@default}
% Set up assorted styles. All bible reference styles
% should start with \verb|brs@|. First the default
% style.
%    \begin{macrocode}
\newcommand*{\brs@default}{%
\brfullname
\renewcommand*{\BRbooknumberstyle}[1]{##1 }%
\renewcommand*{\BRepistlenumberstyle}[1]{##1 }%
\renewcommand*{\BRbooktitlestyle}[1]{##1}%
\renewcommand*{\BRchapterstyle}[1]{##1}%
\renewcommand*{\BRversestyle}[1]{##1}%
\renewcommand*{\BRversesuffixstyle}[1]{##1}%
\renewcommand*{\BRbookof}{}%
\renewcommand*{\BRgospel}{}%
\renewcommand*{\BRepistletothe}{}%
\renewcommand*{\BRepistleto}{}%
\renewcommand*{\BRepistleof}{}%
\renewcommand*{\BRbkchsep}{ }
\renewcommand*{\BRchvsep}{:}%
\renewcommand*{\BRchsep}{;}%
\renewcommand*{\BRvrsep}{--}%
\renewcommand*{\BRvsep}{,}%
\renewcommand*{\BRperiod}{}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\brs@jerusalem}
% The style used by the Jerusalem Bible.
%    \begin{macrocode}
\newcommand*{\brs@jerusalem}{%
\brabbrvname
\renewcommand*{\BRbooknumberstyle}[1]{##1 }%
\renewcommand*{\BRepistlenumberstyle}[1]{##1 }%
\renewcommand*{\BRbooktitlestyle}[1]{##1}%
\renewcommand*{\BRchapterstyle}[1]{##1}%
\renewcommand*{\BRversestyle}[1]{##1}%
\renewcommand*{\BRversesuffixstyle}[1]{##1}%
\renewcommand*{\BRbookof}{}%
\renewcommand*{\BRgospel}{}%
\renewcommand*{\BRepistletothe}{}%
\renewcommand*{\BRepistleto}{}%
\renewcommand*{\BRepistleof}{}%
\renewcommand*{\BRbkchsep}{ }
\renewcommand*{\BRchvsep}{:}%
\renewcommand*{\BRchsep}{; }%
\renewcommand*{\BRvrsep}{--}%
\renewcommand*{\BRvsep}{,}%
\renewcommand*{\BRperiod}{}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\brs@anglosaxon}
% Anglo-Saxon style.
%    \begin{macrocode}
\newcommand*{\brs@anglosaxon}{%
\braltabbrvname
\renewcommand*{\BRbooknumberstyle}[1]{\MakeUppercase{\romannumeral##1} }%
\renewcommand*{\BRepistlenumberstyle}[1]{\MakeUppercase{\romannumeral##1} }%
\renewcommand*{\BRbooktitlestyle}[1]{##1}%
\renewcommand*{\BRchapterstyle}[1]{\MakeUppercase{\romannumeral##1}}%
\renewcommand*{\BRversestyle}[1]{##1}%
\renewcommand*{\BRversesuffixstyle}[1]{##1}%
\renewcommand*{\BRbookof}{}%
\renewcommand*{\BRgospel}{}%
\renewcommand*{\BRepistletothe}{}%
\renewcommand*{\BRepistleto}{}%
\renewcommand*{\BRepistleof}{}%
\renewcommand*{\BRbkchsep}{ }
\renewcommand*{\BRchvsep}{.}%
\renewcommand*{\BRchsep}{; }%
\renewcommand*{\BRvrsep}{--}%
\renewcommand*{\BRvsep}{,}%
\renewcommand*{\BRperiod}{.}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\brs@JEH}
%Journal of Ecclesiastical History
%    \begin{macrocode}
\newcommand*{\brs@JEH}{%
\braltabbrvname
\renewcommand*{\BRbooknumberstyle}[1]{##1 }%
\renewcommand*{\BRepistlenumberstyle}[1]{##1 }%
\renewcommand*{\BRbooktitlestyle}[1]{##1}%
\renewcommand*{\BRchapterstyle}[1]{\romannumeral##1}%
\renewcommand*{\BRversestyle}[1]{##1}%
\renewcommand*{\BRversesuffixstyle}[1]{##1}%
\renewcommand*{\BRbookof}{}%
\renewcommand*{\BRgospel}{}%
\renewcommand*{\BRepistletothe}{}%
\renewcommand*{\BRepistleto}{}%
\renewcommand*{\BRepistleof}{}%
\renewcommand*{\BRbkchsep}{ }
\renewcommand*{\BRchvsep}{. }%
\renewcommand*{\BRchsep}{; }%
\renewcommand*{\BRvrsep}{--}%
\renewcommand*{\BRvsep}{,}%
\renewcommand*{\BRperiod}{.}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\brs@MHRA}
%Modern Humanities Research Association (MHRA)
%    \begin{macrocode}
\newcommand*{\brs@MHRA}{%
\brfullname
\renewcommand*{\BRbooknumberstyle}[1]{\textsc{\romannumeral##1} }%
\renewcommand*{\BRepistlenumberstyle}[1]{\textsc{\romannumeral##1} }%
\renewcommand*{\BRbooktitlestyle}[1]{##1}%
\renewcommand*{\BRchapterstyle}[1]{\romannumeral##1}%
\renewcommand*{\BRversestyle}[1]{##1}%
\renewcommand*{\BRversesuffixstyle}[1]{##1}%
\renewcommand*{\BRbookof}{}%
\renewcommand*{\BRgospel}{}%
\renewcommand*{\BRepistletothe}{}%
\renewcommand*{\BRepistleto}{}%
\renewcommand*{\BRepistleof}{}%
\renewcommand*{\BRbkchsep}{ }
\renewcommand*{\BRchvsep}{. }%
\renewcommand*{\BRchsep}{; }%
\renewcommand*{\BRvrsep}{--}%
\renewcommand*{\BRvsep}{,}%
\renewcommand*{\BRperiod}{}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\brs@NTG}
%Novum Testamentum Graece (Nestle-Aland)
%    \begin{macrocode}
\newcommand*{\brs@NTG}{%
\braltabbrvname
\renewcommand*{\BRbooknumberstyle}[1]{##1 }%
\renewcommand*{\BRepistlenumberstyle}[1]{##1 }%
\renewcommand*{\BRbooktitlestyle}[1]{##1}%
\renewcommand*{\BRchapterstyle}[1]{\romannumeral##1}%
\renewcommand*{\BRversestyle}[1]{##1}%
\renewcommand*{\BRversesuffixstyle}[1]{##1}%
\renewcommand*{\BRbookof}{}%
\renewcommand*{\BRgospel}{}%
\renewcommand*{\BRepistletothe}{}%
\renewcommand*{\BRepistleto}{}%
\renewcommand*{\BRepistleof}{}%
\renewcommand*{\BRbkchsep}{ }
\renewcommand*{\BRchvsep}{,}%
\renewcommand*{\BRchsep}{; }%
\renewcommand*{\BRvrsep}{--}%
\renewcommand*{\BRvsep}{,}%
\renewcommand*{\BRperiod}{}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\brs@MLA}
%MLA Style 
%    \begin{macrocode}
\newcommand*{\brs@MLA}{%
\braltabbrvname
\renewcommand*{\BRbooknumberstyle}[1]{##1 }%
\renewcommand*{\BRepistlenumberstyle}[1]{##1 }%
\renewcommand*{\BRbooktitlestyle}[1]{##1}%
\renewcommand*{\BRchapterstyle}[1]{\romannumeral##1}%
\renewcommand*{\BRversestyle}[1]{##1}%
\renewcommand*{\BRversesuffixstyle}[1]{##1}%
\renewcommand*{\BRbookof}{}%
\renewcommand*{\BRgospel}{}%
\renewcommand*{\BRepistletothe}{}%
\renewcommand*{\BRepistleto}{}%
\renewcommand*{\BRepistleof}{}%
\renewcommand*{\BRbkchsep}{\ }
\renewcommand*{\BRchvsep}{.}%
\renewcommand*{\BRchsep}{; }%
\renewcommand*{\BRvrsep}{--}%
\renewcommand*{\BRvsep}{,}%
\renewcommand*{\BRperiod}{.}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\brs@chicago}
%Chicago Style 
%    \begin{macrocode}
\newcommand*{\brs@chicago}{%
\braltabbrvname
\renewcommand*{\BRbooknumberstyle}[1]{##1 }%
\renewcommand*{\BRepistlenumberstyle}[1]{##1 }%
\renewcommand*{\BRbooktitlestyle}[1]{##1}%
\renewcommand*{\BRchapterstyle}[1]{\romannumeral##1}%
\renewcommand*{\BRversestyle}[1]{##1}%
\renewcommand*{\BRversesuffixstyle}[1]{##1}%
\renewcommand*{\BRbookof}{}%
\renewcommand*{\BRgospel}{}%
\renewcommand*{\BRepistletothe}{}%
\renewcommand*{\BRepistleto}{}%
\renewcommand*{\BRepistleof}{}%
\renewcommand*{\BRbkchsep}{\ }
\renewcommand*{\BRchvsep}{\,:\,}%
\renewcommand*{\BRchsep}{; }%
\renewcommand*{\BRvrsep}{--}%
\renewcommand*{\BRvsep}{,}%
\renewcommand*{\BRperiod}{.}%
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\brs@text}
% Full text citation
%    \begin{macrocode}
\newcommand*{\brs@text}{%
\biblerefstyle{default}%
\renewcommand{\BRbooknumberstyle}[1]{%
\Ordinalstringnum{##1}\ }%
\renewcommand{\BRepistlenumberstyle}[1]{%
\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}}%
\renewcommand{\BRbkchsep}{, }%
\renewcommand{\BRchvsep}{ verse }%
\renewcommand{\BRchsep}{, }%
\renewcommand{\BRvrsep}{ to }%
\renewcommand{\BRvsep}{, }%
\renewcommand{\BRversestyle}[1]{\numberstringnum{##1}}%
\renewcommand*{\BRversesuffixstyle}[1]{##1}%
}
%    \end{macrocode}
%\end{macro}
% Declare package options
%    \begin{macrocode}
\DeclareOption{default}{\brs@default}
\DeclareOption{jerusalem}{\brs@jerusalem}
\DeclareOption{anglosaxon}{\brs@anglosaxon}
\DeclareOption{JEH}{\brs@JEH}
\DeclareOption{MHRA}{\brs@MHRA}
\DeclareOption{NTG}{\brs@NTG}
\DeclareOption{MLA}{\brs@MLA}
\DeclareOption{chicago}{\brs@chicago}
\DeclareOption{text}{\brs@text}
%    \end{macrocode}
% Process package options
%    \begin{macrocode}
\ProcessOptions
%    \end{macrocode}
%
%\begin{macro}{\newbiblerefstyle}
%\begin{definition}
%\cs{newbiblerefstyle}\marg{style name}\marg{style cmds}
%\end{definition}
% Creates a new bible style called \meta{style name}, where
% the style is given by \meta{style cmds}.
% (It basically defines a command called
% \cs{brs@}\meta{style name} to do \meta{style cmds})
%    \begin{macrocode}
\newcommand{\newbiblerefstyle}[2]{%
\@ifundefined{brs@#1}{%
\expandafter\def\csname brs@#1\endcsname{#2}}{%
\PackageError{bibleref}{bible ref style '#1' already
defined}{}}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\setbooktitle}
%\begin{definition}
%\cs{setbooktitle}\marg{fullname}\marg{title}
%\end{definition}
% 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}%
  }%
}
%    \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}
%
%\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}
%\end{definition}
% Sets the current style.
%    \begin{macrocode}
\newcommand*{\biblerefstyle}[1]{%
\@ifundefined{brs@#1}{\PackageError{bibleref}{%
Unknown biblerefstyle '#1'}{}}{\csname brs@#1\endcsname}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@br@vrsty}
% Verses may be supplied as a range. Provide a command
% to detect whether single number or range supplied.
% Verses may have a number appended (e.g.\ 15a). This needs
% to be checked.
%\changes{1.12}{2010/05/11}{Check for letters after verse number}
%    \begin{macrocode}
\newcommand*{\@br@vrsty}[1]{\@@br@vrsty#1-\@nil\end}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@@br@vrsty}
% Pick up a range
%    \begin{macrocode}
\def\@@br@vrsty#1-#2\end{%
\@do@verses#1,\relax\end
\ifx\@nil#2\relax
\else
  \@bv@addtochidxsort{-}%
  \@bv@do{\BRvrsep}%
  \@@br@vrsty#2\end%
\fi
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@br@stripverse}
% Strip trailing letters from verse. Number is stored in 
% \cs{@br@versenum} and the suffix is stored in
% \cs{@br@versesuffix}.
%    \begin{macrocode}
\def\br@stripverse#1{%
  \def\@br@versenum{}%
  \def\@br@versesuffix{}%
  \@br@stripverse#1\relax
}
\def\@br@stripverse#1#2{%
  \@br@checkisdigit{#1}%
  \if@br@isdigit
    \expandafter\toks@\expandafter{\@br@versenum}%
    \edef\@br@versenum{\the\toks@#1}%
    \let\@br@next\@br@stripverse
  \else
    \def\@br@versesuffix{#1}%
    \let\@br@next\@@br@stripverse
  \fi
  \ifx#2\relax
    \let\@br@next\relax
  \fi
  \@br@next#2%
}
\def\@@br@stripverse#1\relax{%
   \protected@edef\@br@versesuffix{\@br@versesuffix#1}%
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@br@checkisdigit}
% Check if argument is a digit.
%    \begin{macrocode}
\newif\if@br@isdigit
\newcommand*{\@br@checkisdigit}[1]{%
  \@br@isdigittrue
  \if#10\relax
  \else
    \if#11\relax
    \else
      \if#12\relax
      \else
        \if#13\relax
        \else
          \if#14\relax
          \else
            \if#15\relax
            \else
               \if#16\relax
               \else
                 \if#17\relax
                 \else
                   \if#18\relax
                   \else
                     \if#19\relax
                     \else
                       \@br@isdigitfalse
                     \fi
                   \fi
                 \fi
               \fi
            \fi
          \fi
        \fi
      \fi
    \fi
  \fi
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@@br@vrsty}
% Pick up a list
%    \begin{macrocode}
\def\@do@verses#1,#2\end{%
\def\@br@tmp{#1}%
\ifx\@br@tmp\@empty
\else
%    \end{macrocode}
% Strip suffix, if it exists.
%    \begin{macrocode}
  \br@stripverse{#1}%
%    \end{macrocode}
% Prepend leading zeroes if required.
%    \begin{macrocode}
  \ifnum\@br@versenum<10\relax
    \@bv@addtochidxsort{00#1}%
  \else
    \ifnum\@br@versenum<100\relax
      \@bv@addtochidxsort{0#1}%
    \else
      \@bv@addtochidxsort{#1}%
    \fi
  \fi
  \edef\@br@tmp{%
     \noexpand\BRversestyle{\@br@versenum}%
     \noexpand\BRversesuffixstyle{\@br@versesuffix}}%
  \expandafter\@bv@do\expandafter{\@br@tmp}%
\fi
\ifx\relax#2\relax
\else
  \@bv@addtochidxsort{,}%
  \@bv@do{\BRvsep}%
  \@do@verses#2\end
\fi
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\bibleverse}
%\begin{definition}
%\cs{bibleverse}\marg{name}
%\end{definition}
% This looks for a command called
% \cs{br@}\meta{name} (defined earlier). 
% After the book title, it then checks
% 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{}%
    \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}
%
%\begin{macro}{\@bibleverse}
% This gets the chapter number.
%    \begin{macrocode}
\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
  \@@bibleverse
}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@bibleverser}
% This gets the second part of a range spanning chapters.
%    \begin{macrocode}
\def\@bibleverser-(#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
  \@@bibleverse
}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@@bibleverse}
% This gets the verse number (or number range), and check to see
% if it is followed by another bracket (indicating another
% chapter, verse pair).
%    \begin{macrocode}
\def\@@bibleverse#1){%
  \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}
%
%\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}}
%\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
  \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}
%\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
%    \begin{macrocode}
\newcommand{\@bv@do}[1]{#1\@bv@addtoidx{#1}}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\@bv@addtoidx}
% Append text to \verb|\@bv@idxentry|
%    \begin{macrocode}
\newtoks\@bv@tmpa
\newtoks\@bv@tmpb
\newcommand{\@bv@addtoidx}[1]{%
\if@bv@idx
  \@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@addtochidxsort}
% Append text to \verb|\@bv@chidxsort|
%    \begin{macrocode}
\newcommand{\@bv@addtochidxsort}[1]{%
\if@bv@idx
  \@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}
% Define switch to indicate whether or not to index
% bible reference.
%    \begin{macrocode}
\newif\if@bv@idx
\@bv@idxfalse
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\@bv@idxsort}
% Sort key for bible verse index. (Strip all the formatting
% bits.)
%    \begin{macrocode}
\newcommand{\@bv@idxsort}[1]{%
\if@bv@idx
{\def\BRbooknumberstyle##1##2\relax{##2##1}%
\def\BRepistlenumberstyle##1##2\relax{##2##1}%
\def\BRgospel{}\def\BRbookof{}\def\BRepistleto{}%
\def\BRepistletothe{}\def\BRepistleof{}%
\xdef\@@bv@idxsort{#1\relax}%
}%
\fi}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\ibibleverse}
% This is like \cs{bibleverse},
% but also adds an index entry. The optional argument indicates
% how to format the page number (without the preceeding backslash)
% e.g. \verb|\ibibleref[textit]{Romans}|.
%    \begin{macrocode}
\newcommand*{\ibibleverse}[1][\bvidxpgformat]{%
\def\@bv@idxpgformat{#1}%
\@bv@idxtrue\def\@bv@idxentry{}\bibleverse}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\bvidxpgformat}
% Default page number format for bible verse index entries
%    \begin{macrocode}
\newcommand*{\bvidxpgformat}{textrm}
%    \end{macrocode}
%\end{macro}
%\iffalse
%    \begin{macrocode}
%</bibleref.sty>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*bibleref-manual.tex>
%    \end{macrocode}
%\fi
%\iffalse
\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}
%\fi
%\iffalse
%    \begin{macrocode}
%</bibleref-manual.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sample-multind.tex>
%    \end{macrocode}
%\fi
%\iffalse
%\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}
%\fi
%\iffalse
%    \begin{macrocode}
%</sample-multind.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*sample.tex>
%    \end{macrocode}
%\fi
%\iffalse
%\subsection{Sample Document}
%    \begin{macrocode}
\documentclass{article}

\usepackage{bibleref}
\usepackage{makeidx}
\makeindex

% make the page numbers in the index italic for bible
% references
\renewcommand{\bvidxpgformat}{textit}

\begin{document}

\title{Sample Document}
\author{Nicola Talbot}
\maketitle

Long citation in text: 
\biblerefstyle{text}
\bibleverse{IICor}(12:15,18,21-33).
Short citation in footnote\footnote{%
\biblerefstyle{chicago}\bibleverse{IICor}(12:15,18,21-33)}.

\section{Default Style}

\biblerefstyle{default}
\noindent
\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}

\section{Jerusalem Style}
This is the style used in the Jerusalem bible.
\biblerefstyle{jerusalem}

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

\section{Anglo-Saxon Style}

\biblerefstyle{anglosaxon}
\noindent
\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}

\section{Journal of Ecclesiastical History}

\biblerefstyle{JEH}
\noindent
\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}

\section{Modern Humanities Research Association}

\biblerefstyle{MHRA}
\noindent
\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}

\section{Novum Testamentum Graece (Nestle-Aland)}

\biblerefstyle{NTG}
\noindent
\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}

\section{MLA Style}

\biblerefstyle{MLA}
\noindent
\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}

\section{Chicago Style}

\biblerefstyle{chicago}
\noindent
\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}

\section{Text Style}
This style prints the citation out in full. It's based
on `default', and uses the fmtcount package to convert
the numbers into words.

\biblerefstyle{text}
\raggedright

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

\section{New Style}

This new style is based on the `default' style, but
has verses in lower case Roman numerals, and redefines
``Revelation'' as ``Apocalypse''.

\begin{verbatim}
\newbiblerefstyle{sample}{%
\biblerefstyle{default}%
\renewcommand{\BRversestyle}[1]{\romannumeral##1}%
\setbooktitle{Revelation}{Apocalyse}%
}
\end{verbatim}
\newbiblerefstyle{sample}{%
\biblerefstyle{default}%
\renewcommand{\BRversestyle}[1]{\romannumeral##1}%
\setbooktitle{Revelation}{Apocalyse}%
}

\biblerefstyle{sample}
\noindent
\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}

\section{MHRA Style---Indexed}

\biblerefstyle{MHRA}
\noindent
\begin{tabular}{ll}
\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)\\
\verb|\ibibleverse{Ex}(15:)(17:)(20:)| & \ibibleverse{Ex}(15:)(17:)(20:)\\
\verb|\ibibleverse{Rev}(1:2,5,7-9,11)| & \ibibleverse{Rev}(1:2,5,7-9,11)\\
\verb|\ibibleverse{IChronicles}(1:3)-(2:7)| &
\ibibleverse{IChronicles}(1:3)-(2:7)\\
\verb|\ibibleverse{IIPeter}(3:8-15a)| &
\ibibleverse{IIPeter}(3:8-15a)
\end{tabular}

\printindex

\end{document}
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</sample.tex>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%<*bibleref.perl>
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
#!/usr/bin/perl
# File   : bibleref.perl
# Author : Nicola L.C. Talbot
#          http://theoval.cmp.uea.ac.uk/~nlct/
# This is a LaTeX2HTML style implementing the bibleref package, and
# is distributed as part of that package.
# Copyright 2007 Nicola L.C. 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, sample.tex, bibleref.perl.

 %bookfullname=();

$synonym{'Gn'}='Gensis';
$synonym{'Ex'}='Exodus';
$synonym{'Lv'}='Leviticus';
$synonym{'Nb'}='Numbers';
$synonym{'Dt'}='Deuteronomy';
$synonym{'Jos'}='Joshua';
$synonym{'Jg'}='Judges';
$synonym{'Rt'}='Ruth';
$synonym{'IS'}='ISamuel';
$synonym{'IIS'}='IISamuel';
$synonym{'IK'}='IKings';
$synonym{'IIK'}='IIKings';
$synonym{'ICh'}='IChronicles';
$synonym{'IICh'}='IIChronicles';
$synonym{'Ezr'}='Ezra';
$synonym{'Ne'}='Nehemiah';
$synonym{'Tb'}='Tobit';
$synonym{'Jdt'}='Judith';
$synonym{'Est'}='Esther';
$synonym{'IM'}='IMaccabees';
$synonym{'IIM'}='IIMaccabees';
$synonym{'Jb'}='Job';
$synonym{'Ps'}='Psalms';
$synonym{'Pr'}='Proverbs';
$synonym{'Qo'}='Ecclesiastes';
$synonym{'Sg'}='SongofSongs';
$synonym{'Ws'}='Wisdom';
$synonym{'Si'}='Ecclesiasticus';
$synonym{'Is'}='Isaiah';
$synonym{'Jr'}='Jeremiah';
$synonym{'Lm'}='Lamentations';
$synonym{'Ba'}='Baruch';
$synonym{'Ezk'}='Ezekiel';
$synonym{'Dn'}='Daniel';
$synonym{'Ho'}='Hosea';
$synonym{'Jl'}='Joel';
$synonym{'Am'}='Amos';
$synonym{'Ob'}='Obadiah';
$synonym{'Jon'}='Jonah';
$synonym{'Mi'}='Micah';
$synonym{'Na'}='Nahum';
$synonym{'Hab'}='Habakkuk';
$synonym{'Zp'}='Zephaniah';
$synonym{'Hg'}='Haggai';
$synonym{'Zc'}='Zechariah';
$synonym{'Ml'}='Malachi';
$synonym{'Mt'}='Matthew';
$synonym{'Mk'}='Mark';
$synonym{'Lk'}='Luke';
$synonym{'Jn'}='John';
$synonym{'Ac'}='Acts';
$synonym{'Rm'}='Romans';
$synonym{'ICo'}='ICorinthians';
$synonym{'IICo'}='IICorinthians';
$synonym{'Ga'}='Galatians';
$synonym{'Ep'}='Ephesians';
$synonym{'Ph'}='Philippians';
$synonym{'Col'}='Colossians';
$synonym{'ITh'}='IThessalonians';
$synonym{'IITh'}='IIThessalonians';
$synonym{'ITm'}='ITimothy';
$synonym{'IITm'}='IITimothy';
$synonym{'Tt'}='Titus';
$synonym{'Phm'}='Philemon';
$synonym{'Heb'}='Hebrews';
$synonym{'Jm'}='James';
$synonym{'IP'}='IPeter';
$synonym{'IIP'}='IIPeter';
$synonym{'IJn'}='IJohn';
$synonym{'IIJn'}='IIJohn';
$synonym{'IIIJn'}='IIIJohn';
$synonym{'Rv'}='Revelation';
$synonym{'Gen'}='Gensis';
$synonym{'Exod'}='Exodus';
$synonym{'Lev'}='Leviticus';
$synonym{'Num'}='Numbers';
$synonym{'Deut'}='Deuteronomy';
$synonym{'Josh'}='Joshua';
$synonym{'Judg'}='Judges';
$synonym{'ISam'}='ISamuel';
$synonym{'IISam'}='IISamuel';
$synonym{'IKgs'}='IKings';
$synonym{'IIKgs'}='IIKings';
$synonym{'IChr'}='IChronicles';
$synonym{'IIChr'}='IIChronicles';
$synonym{'Neh'}='Nehemiah';
$synonym{'IM'}='IMaccabees';
$synonym{'IIM'}='IIMaccabees';
$synonym{'Ps'}='Psalms';
$synonym{'Prov'}='Proverbs';
$synonym{'Eccles'}='Ecclesiastes';
$synonym{'SofS'}='SongofSongs';
$synonym{'Wisd'}='Wisdom';
$synonym{'Ecclus'}='Ecclesiasticus';
$synonym{'Isa'}='Isaiah';
$synonym{'Jer'}='Jeremiah';
$synonym{'Lam'}='Lamentations';
$synonym{'Ezek'}='Ezekiel';
$synonym{'Dan'}='Daniel';
$synonym{'Hos'}='Hosea';
$synonym{'Obad'}='Obadiah';
$synonym{'Mic'}='Micah';
$synonym{'Nah'}='Nahum';
$synonym{'Hab'}='Habakkuk';
$synonym{'Zeph'}='Zephaniah';
$synonym{'Hag'}='Haggai';
$synonym{'Zech'}='Zechariah';
$synonym{'Mal'}='Malachi';
$synonym{'Matt'}='Matthew';
$synonym{'Rom'}='Romans';
$synonym{'ICor'}='ICorinthians';
$synonym{'IICor'}='IICorinthians';
$synonym{'Gal'}='Galatians';
$synonym{'Eph'}='Ephesians';
$synonym{'Phil'}='Philippians';
$synonym{'Col'}='Colossians';
$synonym{'IThess'}='IThessalonians';
$synonym{'IIThess'}='IIThessalonians';
$synonym{'ITim'}='ITimothy';
$synonym{'IITim'}='IITimothy';
$synonym{'Tit'}='Titus';
$synonym{'Philem'}='Philemon';
$synonym{'Heb'}='Hebrews';
$synonym{'Jas'}='James';
$synonym{'IPet'}='IPeter';
$synonym{'IIPet'}='IIPeter';
$synonym{'IJohn'}='IJohn';
$synonym{'IIJohn'}='IIJohn';
$synonym{'IIIJohn'}='IIIJohn';
$synonym{'Rev'}='Revelation';

&do_cmd_brfullname;

sub do_cmd_BRbooknumberstyle{
   local($_) = @_;
   local($num);

   $num = &missing_braces unless
               s/$next_pair_pr_rx/$num=$2;''/eo;

   "$num " . $_;
}

sub do_cmd_BRepistlenumberstyle{
   local($_) = @_;
   local($num);

   $num = &missing_braces unless
               s/$next_pair_pr_rx/$num=$2;''/eo;

   "$num " . $_;
}

sub do_cmd_BRbooknumberstyleI{
   local($_)=@_;
   local($id)=++$global{'max_id'};

   join('', 
   &translate_commands("\\BRbooknumberstyle$OP$id${CP}1$OP$id$CP"),$_);
}

sub do_cmd_BRbooknumberstyleII{
   local($_)=@_;
   local($id)=++$global{'max_id'};

   join('', 
   &translate_commands("\\BRbooknumberstyle$OP$id${CP}2$OP$id$CP"),$_);
}

sub do_cmd_BRepistlenumberstyleI{
   local($_)=@_;
   local($id)=++$global{'max_id'};

   join('', 
   &translate_commands("\\BRepistlenumberstyle$OP$id${CP}1$OP$id$CP"),$_);
}

sub do_cmd_BRepistlenumberstyleII{
   local($_)=@_;
   local($id)=++$global{'max_id'};

   join('', 
   &translate_commands("\\BRepistlenumberstyle$OP$id${CP}2$OP$id$CP"),$_);
}

sub do_cmd_BRepistlenumberstyleIII{
   local($_)=@_;
   local($id)=++$global{'max_id'};

   join('', 
   &translate_commands("\\BRepistlenumberstyle$OP$id${CP}3$OP$id$CP"),$_);
}

sub do_cmd_BRbookof{
   local($_)=@_;

   $_;
}

sub do_cmd_BRgospel{
   local($_)=@_;

   $_;
}

sub do_cmd_BRepistleto{
   local($_)=@_;

   $_;
}

sub do_cmd_BRepistletothe{
   local($_)=@_;

   $_;
}

sub do_cmd_BRepistleof{
   local($_)=@_;

   $_;
}

sub do_cmd_BRbooktitlestyle{
   local($_)=@_;
   local($title);

   $title = &missing_braces unless
              s/$next_pair_pr_rx/$title=$2;''/eo;

   $title . $_;
}

sub do_cmd_BRchapterstyle{
   local($_)=@_;
   local($num);

   $num = &missing_braces unless
              s/$next_pair_pr_rx/$num=$2;''/eo;

   $num . $_;
}

sub do_cmd_BRversestyle{
   local($_)=@_;
   local($num);

   $num = &missing_braces unless
              s/$next_pair_pr_rx/$num=$2;''/eo;

   $num . $_;
}

sub do_cmd_BRbkchsep{
   local($_)=@_;

   " " . $_;
}

sub do_cmd_BRchvsep{
   local($_)=@_;

   ":" . $_;
}

sub do_cmd_BRchsep{
   local($_)=@_;

   ';' . $_;
}

sub do_cmd_BRvrsep{
   local($_)=@_;

   &translate_commands("--") . $_;
}

sub do_cmd_BRvsep{
   local($_)=@_;

   "," . $_;
}

sub do_cmd_BRperiod{
   local($_)=@_;
   $_;
}

sub do_cmd_brfullname{
local($_) = @_;
$bookname{'Genesis'}='\BRbookof Genesis';
$bookname{'Exodus'}='\BRbookof Exodus';
$bookname{'Leviticus'}='\BRbookof Leviticus';
$bookname{'Numbers'}='\BRbookof Numbers';
$bookname{'Deuteronomy'}='\BRbookof Deuteronomy';
$bookname{'Joshua'}='\BRbookof Joshua';
$bookname{'Judges'}='\BRbookof Judges';
$bookname{'Ruth'}='\BRbookof Ruth';
$bookname{'ISamuel'}='\BRbooknumberstyleI \BRbookof Samuel';
$bookname{'IISamuel'}='\BRbooknumberstyleII \BRbookof Samuel';
$bookname{'IKings'}='\BRbooknumberstyleI \BRbookof Kings';
$bookname{'IIKings'}='\BRbooknumberstyleII \BRbookof Kings';
$bookname{'IChronicles'}='\BRbooknumberstyleI \BRbookof Chronicles';
$bookname{'IIChronicles'}='\BRbooknumberstyleII \BRbookof Chronicles';
$bookname{'Ezra'}='\BRbookof Ezra';
$bookname{'Nehemiah'}='\BRbookof Nehemiah';
$bookname{'Tobit'}='\BRbookof Tobit';
$bookname{'Judith'}='\BRbookof Judith';
$bookname{'Esther'}='\BRbookof Esther';
$bookname{'IMaccabees'}='\BRbooknumberstyleI \BRbookof Maccabees';
$bookname{'IIMaccabees'}='\BRbooknumberstyleII \BRbookof Maccabees';
$bookname{'Job'}='\BRbookof Job';
$bookname{'Psalms'}='\BRbookof Psalms';
$bookname{'Proverbs'}='\BRbookof Proverbs';
$bookname{'Ecclesiastes'}='\BRbookof Ecclesiastes';
$bookname{'SongofSongs'}='\BRbookof Song of Songs';
$bookname{'Wisdom'}='\BRbookof Wisdom';
$bookname{'Ecclesiasticus'}='\BRbookof Ecclesiasticus';
$bookname{'Isaiah'}='\BRbookof Isaiah';
$bookname{'Jeremiah'}='\BRbookof Jeremiah';
$bookname{'Lamentations'}='\BRbookof Lamentations';
$bookname{'Baruch'}='\BRbookof Baruch';
$bookname{'Ezekiel'}='\BRbookof Ezekiel';
$bookname{'Daniel'}='\BRbookof Daniel';
$bookname{'Hosea'}='\BRbookof Hosea';
$bookname{'Joel'}='\BRbookof Joel';
$bookname{'Amos'}='\BRbookof Amos';
$bookname{'Obadiah'}='\BRbookof Obadiah';
$bookname{'Jonah'}='\BRbookof Jonah';
$bookname{'Micah'}='\BRbookof Micah';
$bookname{'Nahum'}='\BRbookof Nahum';
$bookname{'Habakkuk'}='\BRbookof Habakkuk';
$bookname{'Zephaniah'}='\BRbookof Zephaniah';
$bookname{'Haggai'}='\BRbookof Haggai';
$bookname{'Zechariah'}='\BRbookof Zechariah';
$bookname{'Malachi'}='\BRbookof Malachi';
$bookname{'Matthew'}='\BRgospel Matthew';
$bookname{'Mark'}='\BRgospel Mark';
$bookname{'Luke'}='\BRgospel Luke';
$bookname{'John'}='\BRgospel John';
$bookname{'Acts'}='Acts';
$bookname{'Romans'}='\BRepistletothe Romans';
$bookname{'ICorinthians'}='\BRepistlenumberstyleI \BRepistletothe Corinthians';
$bookname{'IICorinthians'}='\BRepistlenumberstyleII \BRepistletothe Corinthians';
$bookname{'Galatians'}='\BRepistletothe Galatians';
$bookname{'Ephesians'}='\BRepistletothe Ephesians';
$bookname{'Philippians'}='\BRepistletothe Philippians';
$bookname{'Colossians'}='\BRepistletothe Colossians';
$bookname{'IThessalonians'}='\BRepistlenumberstyleI \BRepistletothe Thessalonians';
$bookname{'IIThessalonians'}='\BRepistlenumberstyleII \BRepistletothe Thessalonians';
$bookname{'ITimothy'}='\BRepistlenumberstyleI \BRepistleto Timothy';
$bookname{'IITimothy'}='\BRepistlenumberstyleII \BRepistletoTimothy';
$bookname{'Titus'}='\BRepistleto Titus';
$bookname{'Philemon'}='\BRepistleto Philemon';
$bookname{'Hebrews'}='\BRepistletothe Hebrews';
$bookname{'James'}='\BRepistleof James';
$bookname{'IPeter'}='\BRepistlenumberstyleI \BRepistleof Peter';
$bookname{'IIPeter'}='\BRepistlenumberstyleII \BRepistleof Peter';
$bookname{'IJohn'}='\BRepistlenumberstyleI \BRepistleof John';
$bookname{'IIJohn'}='\BRepistlenumberstyleII \BRepistleof John';
$bookname{'IIIJohn'}='\BRepistlenumberstyleIII \BRepistleof John';
$bookname{'Jude'}='\BRepistleof Jude';
$bookname{'Revelation'}='\BRbookof Revelation';
$_;
}

sub do_cmd_brabbrvname{
local($_)=@_;
$bookname{'Gensis'}='Gn\BRperiod ';
$bookname{'Exodus'}='Ex\BRperiod ';
$bookname{'Leviticus'}='Lv\BRperiod ';
$bookname{'Numbers'}='Nb\BRperiod ';
$bookname{'Deuteronomy'}='Dt\BRperiod ';
$bookname{'Joshua'}='Jos\BRperiod ';
$bookname{'Judges'}='Jg\BRperiod ';
$bookname{'Ruth'}='Rt\BRperiod ';
$bookname{'ISamuel'}='\BRbooknumberstyleI S\BRperiod ';
$bookname{'IISamuel'}='\BRbooknumberstyleII S\BRperiod ';
$bookname{'IKings'}='\BRbooknumberstyleI K\BRperiod ';
$bookname{'IIKings'}='\BRbooknumberstyleII K\BRperiod ';
$bookname{'IChronicles'}='\BRbooknumberstyleI Ch\BRperiod ';
$bookname{'IIChronicles'}='\BRbooknumberstyleII Ch\BRperiod ';
$bookname{'Ezra'}='Ezr\BRperiod ';
$bookname{'Nehemiah'}='Ne\BRperiod ';
$bookname{'Tobit'}='Tb\BRperiod ';
$bookname{'Judith'}='Jdt\BRperiod ';
$bookname{'Esther'}='Est\BRperiod ';
$bookname{'IMaccabees'}='\BRbooknumberstyleI M\BRperiod ';
$bookname{'IIMaccabees'}='\BRbooknumberstyleII M\BRperiod ';
$bookname{'Job'}='Jb\BRperiod ';
$bookname{'Psalms'}='Ps\BRperiod ';
$bookname{'Proverbs'}='Pr\BRperiod ';
$bookname{'Ecclesiastes'}='Qo\BRperiod ';
$bookname{'SongofSongs'}='Sg\BRperiod ';
$bookname{'Wisdom'}='Ws\BRperiod ';
$bookname{'Ecclesiasticus'}='Si\BRperiod ';
$bookname{'Isaiah'}='Is\BRperiod ';
$bookname{'Jeremiah'}='Jr\BRperiod ';
$bookname{'Lamentations'}='Lm\BRperiod ';
$bookname{'Baruch'}='Ba\BRperiod ';
$bookname{'Ezekiel'}='Ezk\BRperiod ';
$bookname{'Daniel'}='Dn\BRperiod ';
$bookname{'Hosea'}='Ho\BRperiod ';
$bookname{'Joel'}='Jl\BRperiod ';
$bookname{'Amos'}='Am\BRperiod ';
$bookname{'Obadiah'}='Ob\BRperiod ';
$bookname{'Jonah'}='Jon\BRperiod ';
$bookname{'Micah'}='Mi\BRperiod ';
$bookname{'Nahum'}='Na\BRperiod ';
$bookname{'Habakkuk'}='Hab\BRperiod ';
$bookname{'Zephaniah'}='Zp\BRperiod ';
$bookname{'Haggai'}='Hg\BRperiod ';
$bookname{'Zechariah'}='Zc\BRperiod ';
$bookname{'Malachi'}='Ml\BRperiod ';
$bookname{'Matthew'}='Mt\BRperiod ';
$bookname{'Mark'}='Mk\BRperiod ';
$bookname{'Luke'}='Lk\BRperiod ';
$bookname{'John'}='Jn\BRperiod ';
$bookname{'Acts'}='Ac\BRperiod ';
$bookname{'Romans'}='Rm\BRperiod ';
$bookname{'ICorinthians'}='\BRepistlenumberstyleI Co\BRperiod ';
$bookname{'IICorinthians'}='\BRepistlenumberstyleII Co\BRperiod ';
$bookname{'Galatians'}='Ga\BRperiod ';
$bookname{'Ephesians'}='Ep\BRperiod ';
$bookname{'Philippians'}='Ph\BRperiod ';
$bookname{'Colossians'}='Col\BRperiod ';
$bookname{'IThessalonians'}='\BRepistlenumberstyleI Th\BRperiod ';
$bookname{'IIThessalonians'}='\BRepistlenumberstyleII Th\BRperiod ';
$bookname{'ITimothy'}='\BRepistlenumberstyleI Tm\BRperiod ';
$bookname{'IITimothy'}='\BRepistlenumberstyleII Tm\BRperiod ';
$bookname{'Titus'}='Tt\BRperiod ';
$bookname{'Philemon'}='Phm\BRperiod ';
$bookname{'Hebrews'}='Heb\BRperiod ';
$bookname{'James'}='Jm\BRperiod ';
$bookname{'IPeter'}='\BRepistlenumberstyleI P\BRperiod ';
$bookname{'IIPeter'}='\BRepistlenumberstyleII P\BRperiod ';
$bookname{'IJohn'}='\BRepistlenumberstyleI Jn\BRperiod ';
$bookname{'IIJohn'}='\BRepistlenumberstyleII Jn\BRperiod ';
$bookname{'IIIJohn'}='\BRepistlenumberstyleIII Jn\BRperiod ';
$bookname{'Jude'}='Jude';
$bookname{'Revelation'}='Rv\BRperiod ';
$_;
}

sub do_cmd_braltabbrvname{
local($_)=@_;
$bookname{'Gensis'}='Gen\BRperiod ';
$bookname{'Exodus'}='Exod\BRperiod ';
$bookname{'Leviticus'}='Lev\BRperiod ';
$bookname{'Numbers'}='Num\BRperiod ';
$bookname{'Deuteronomy'}='Deut\BRperiod ';
$bookname{'Joshua'}='Josh\BRperiod ';
$bookname{'Judges'}='Judg\BRperiod ';
$bookname{'Ruth'}='Ruth';
$bookname{'ISamuel'}='\BRbooknumberstyleI Sam\BRperiod ';
$bookname{'IISamuel'}='\BRbooknumberstyleII Sam\BRperiod ';
$bookname{'IKings'}='\BRbooknumberstyleI Kgs\BRperiod ';
$bookname{'IIKings'}='\BRbooknumberstyleII Kgs\BRperiod ';
$bookname{'IChronicles'}='\BRbooknumberstyleI Chr\BRperiod ';
$bookname{'IIChronicles'}='\BRbooknumberstyleII Chr\BRperiod ';
$bookname{'Ezra'}='Ezra';
$bookname{'Nehemiah'}='Neh\BRperiod ';
$bookname{'Tobit'}='Tobit';
$bookname{'Judith'}='Judith';
$bookname{'Esther'}='Esther';
$bookname{'IMaccabees'}='\BRbooknumberstyleI M\BRperiod ';
$bookname{'IIMaccabees'}='\BRbooknumberstyleII M\BRperiod ';
$bookname{'Job'}='Job';
$bookname{'Psalms'}='Ps\BRperiod ';
$bookname{'Proverbs'}='Prov\BRperiod ';
$bookname{'Ecclesiastes'}='Eccles\BRperiod ';
$bookname{'SongofSongs'}='S\BRperiod \ of S\BRperiod ';
$bookname{'Wisdom'}='Wisd\BRperiod ';
$bookname{'Ecclesiasticus'}='Ecclus\BRperiod ';
$bookname{'Isaiah'}='Isa\BRperiod ';
$bookname{'Jeremiah'}='Jer\BRperiod ';
$bookname{'Lamentations'}='Lam\BRperiod ';
$bookname{'Baruch'}='Baruch';
$bookname{'Ezekiel'}='Ezek\BRperiod ';
$bookname{'Daniel'}='Dan\BRperiod ';
$bookname{'Hosea'}='Hos\BRperiod ';
$bookname{'Joel'}='Joel';
$bookname{'Amos'}='Amos';
$bookname{'Obadiah'}='Obad';
$bookname{'Jonah'}='Jonah';
$bookname{'Micah'}='Mic\BRperiod ';
$bookname{'Nahum'}='Nah\BRperiod ';
$bookname{'Habakkuk'}='Hab\BRperiod ';
$bookname{'Zephaniah'}='Zeph\BRperiod ';
$bookname{'Haggai'}='Hag\BRperiod ';
$bookname{'Zechariah'}='Zech\BRperiod ';
$bookname{'Malachi'}='Mal\BRperiod ';
$bookname{'Matthew'}='Matt\BRperiod ';
$bookname{'Mark'}='Mark';
$bookname{'Luke'}='Luke';
$bookname{'John'}='John';
$bookname{'Acts'}='Acts';
$bookname{'Romans'}='Rom\BRperiod ';
$bookname{'ICorinthians'}='\BRepistlenumberstyleI Cor\BRperiod ';
$bookname{'IICorinthians'}='\BRepistlenumberstyleII Cor\BRperiod ';
$bookname{'Galatians'}='Gal\BRperiod ';
$bookname{'Ephesians'}='Eph\BRperiod ';
$bookname{'Philippians'}='Phil\BRperiod ';
$bookname{'Colossians'}='Col\BRperiod ';
$bookname{'IThessalonians'}='\BRepistlenumberstyleI Thess\BRperiod ';
$bookname{'IIThessalonians'}='\BRepistlenumberstyleII Thess\BRperiod ';
$bookname{'ITimothy'}='\BRepistlenumberstyleI Tim\BRperiod ';
$bookname{'IITimothy'}='\BRepistlenumberstyleII Tim\BRperiod ';
$bookname{'Titus'}='Tit\BRperiod ';
$bookname{'Philemon'}='Philem\BRperiod ';
$bookname{'Hebrews'}='Heb\BRperiod ';
$bookname{'James'}='Jas\BRperiod ';
$bookname{'IPeter'}='\BRepistlenumberstyleI Pet\BRperiod ';
$bookname{'IIPeter'}='\BRepistlenumberstyleII Pet\BRperiod ';
$bookname{'IJohn'}='\BRepistlenumberstyleI John';
$bookname{'IIJohn'}='\BRepistlenumberstyleII John';
$bookname{'IIIJohn'}='\BRepistlenumberstyleIII John';
$bookname{'Jude'}='Jude';
$bookname{'Revelation'}='Rev\BRperiod ';
$_;
}

sub brs_default{
   local($tmp)='';
   &do_cmd_brfullname;

   $tmp .= 'sub do_cmd_BRbooknumberstyle{';
   $tmp .= '   local($_) = @_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '               s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   "$num " . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistlenumberstyle{';
   $tmp .= '   local($_) = @_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '               s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   "$num " . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbookof{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRgospel{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistleto{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistletothe{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistleof{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbooktitlestyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($title);';
   $tmp .= '   $title = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$title=$2;\'\'/eo;';
   $tmp .= '   $title . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchapterstyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   $num . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRversestyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   $num . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbkchsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   " " . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchvsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   ":" . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   \';\' . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRvrsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   &translate_commands("--") . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRvsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   "," . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRperiod{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
}

sub brs_jerusalem{
   local($tmp)='';
   &do_cmd_brabbrvname;

   $tmp .= 'sub do_cmd_BRbooknumberstyle{';
   $tmp .= '   local($_) = @_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '               s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   "$num " . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistlenumberstyle{';
   $tmp .= '   local($_) = @_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '               s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   "$num " . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbookof{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRgospel{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistleto{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistletothe{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistleof{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbooktitlestyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($title);';
   $tmp .= '   $title = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$title=$2;\'\'/eo;';
   $tmp .= '   $title . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchapterstyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   $num . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRversestyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   $num . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbkchsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   " " . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchvsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   ":" . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   \'; \' . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRvrsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   &translate_commands("--") . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRvsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   "," . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRperiod{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
}

sub brs_anglosaxon{
   local($tmp)='';
   &do_cmd_braltabbrvname;

   $tmp .= 'sub do_cmd_BRbooknumberstyle{';
   $tmp .= '   local($_) = @_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '               s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   join(" ", &fRoman($num), $_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistlenumberstyle{';
   $tmp .= '   local($_) = @_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '               s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   join(" ", &fRoman($num), $_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbookof{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRgospel{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistleto{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistletothe{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistleof{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbooktitlestyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($title);';
   $tmp .= '   $title = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$title=$2;\'\'/eo;';
   $tmp .= '   $title . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchapterstyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   $num . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRversestyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   $num . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbkchsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   " " . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchvsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   "." . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   \'; \' . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRvrsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   &translate_commands("--") . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRvsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   "," . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRperiod{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   ".$_";';
   $tmp .= '}';
}

sub brs_JEH{
   local($tmp)='';
   &do_cmd_braltabbrvname;

   $tmp .= 'sub do_cmd_BRbooknumberstyle{';
   $tmp .= '   local($_) = @_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '               s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   join(" ", $num, $_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistlenumberstyle{';
   $tmp .= '   local($_) = @_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '               s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   join(" ", $num, $_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbookof{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRgospel{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistleto{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistletothe{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistleof{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbooktitlestyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($title);';
   $tmp .= '   $title = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$title=$2;\'\'/eo;';
   $tmp .= '   $title . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchapterstyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   &froman($num) . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRversestyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   $num . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbkchsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   " " . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchvsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   join(" ", ".", $_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   \'; \' . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRvrsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   &translate_commands("--") . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRvsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   "," . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRperiod{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   ".$_";';
   $tmp .= '}';
}

sub brs_MHRA{
   local($tmp)='';
   &do_cmd_brfullname;

   $tmp .= 'sub do_cmd_BRbooknumberstyle{';
   $tmp .= '   local($_) = @_;';
   $tmp .= '   local($num,$id);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '               s/$next_pair_pr_rx/$num=$2;$id=$1;\'\'/eo;';
   $tmp .= '   $num = &froman($num);';
   $tmp .= '   $num = &translate_commands("\\\\textsc${OP}$id${CP}$num${OP}$id${CP}");';
   $tmp .= '   join(" ", $num, $_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistlenumberstyle{';
   $tmp .= '   local($_) = @_;';
   $tmp .= '   local($num,$id);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '               s/$next_pair_pr_rx/$num=$2;$id=$1;\'\'/eo;';
   $tmp .= '   $num = &froman($num);';
   $tmp .= '   $num = &translate_commands("\\\\textsc${OP}$id${CP}$num${OP}$id${CP}");';
   $tmp .= '   join(" ", $num, $_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbookof{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRgospel{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistleto{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistletothe{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistleof{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbooktitlestyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($title);';
   $tmp .= '   $title = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$title=$2;\'\'/eo;';
   $tmp .= '   $title . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchapterstyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   &froman($num) . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRversestyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   $num . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbkchsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   " " . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchvsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   join(" ", ".", $_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   "; " . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRvrsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   &translate_commands("--") . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRvsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   "," . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRperiod{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
}

sub brs_NTG{
   local($tmp)='';
   &do_cmd_braltabbrvname;

   $tmp .= 'sub do_cmd_BRbooknumberstyle{';
   $tmp .= '   local($_) = @_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '               s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   join(" ", $num, $_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistlenumberstyle{';
   $tmp .= '   local($_) = @_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '               s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   join(" ", $num, $_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbookof{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRgospel{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistleto{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistletothe{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistleof{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbooktitlestyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($title);';
   $tmp .= '   $title = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$title=$2;\'\'/eo;';
   $tmp .= '   $title . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchapterstyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   &froman($num) . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRversestyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   $num . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbkchsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   " " . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchvsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   join("", ",", $_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   "; " . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRvrsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   &translate_commands("--") . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRvsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   "," . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRperiod{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
}

sub brs_MLA{
   local($tmp)='';
   &do_cmd_braltabbrvname;

   $tmp .= 'sub do_cmd_BRbooknumberstyle{';
   $tmp .= '   local($_) = @_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '               s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   join(" ", $num, $_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistlenumberstyle{';
   $tmp .= '   local($_) = @_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '               s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   join(" ", $num, $_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbookof{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRgospel{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistleto{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistletothe{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistleof{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbooktitlestyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($title);';
   $tmp .= '   $title = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$title=$2;\'\'/eo;';
   $tmp .= '   $title . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchapterstyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   &froman($num) . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRversestyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   $num . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbkchsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   " " . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchvsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   join("", ".", $_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   "; " . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRvrsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   &translate_commands("--") . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRvsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   "," . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRperiod{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   ".$_";';
   $tmp .= '}';
}

sub brs_chicago{
   local($tmp)='';
   &do_cmd_braltabbrvname;

   $tmp .= 'sub do_cmd_BRbooknumberstyle{';
   $tmp .= '   local($_) = @_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '               s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   join(" ", $num, $_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistlenumberstyle{';
   $tmp .= '   local($_) = @_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '               s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   join(" ", $num, $_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbookof{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRgospel{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistleto{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistletothe{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistleof{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbooktitlestyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($title);';
   $tmp .= '   $title = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$title=$2;\'\'/eo;';
   $tmp .= '   $title . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchapterstyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   &froman($num) . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRversestyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($num);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$num=$2;\'\'/eo;';
   $tmp .= '   $num . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbkchsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   " " . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchvsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   join("", ":", $_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   "; " . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRvrsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   &translate_commands("--") . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRvsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   "," . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRperiod{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   ".$_";';
   $tmp .= '}';
}

sub brs_long{
   local($tmp)='';
   &do_cmd_brfullname;

   $tmp .= 'sub do_cmd_BRbooknumberstyle{';
   $tmp .= '   local($_) = @_;';
   $tmp .= '   local($num,$id);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '               s/$next_pair_pr_rx/$num=$2;$id=$1;\'\'/eo;';
   $tmp .= '   "\\Ordinalstringnum$OP$id$CP$num$OP$id$CP " . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistlenumberstyle{';
   $tmp .= '   local($_) = @_;';
   $tmp .= '   local($num,$id);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '               s/$next_pair_pr_rx/$num=$2;$id=$1;\'\'/eo;';
   $tmp .= '   "\\Ordinalstringnum$OP$id$CP$num$OP$id$CP " . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbookof{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   join(" ", "Book of",$_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRgospel{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   join(" ", "Gospel according to St",$_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistleto{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   join(" ", "Epistle to",$_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistletothe{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   join(" ", "Epistle to the", $_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRepistleof{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   join(" ", "Epistle of",$_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbooktitlestyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($title);';
   $tmp .= '   $title = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$title=$2;\'\'/eo;';
   $tmp .= '   $title . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchapterstyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($num,$id);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$num=$2;$id=$1;\'\'/eo;';
   $tmp .= '   join(" ", "chapter \\numberstring$OP$id$CP$num$OP$id$CP", $_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRversestyle{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   local($num,$id);';
   $tmp .= '   $num = &missing_braces unless';
   $tmp .= '              s/$next_pair_pr_rx/$num=$2;$id=$1;\'\'/eo;';
   $tmp .= '   join(" ", "chapter \\numberstring$OP$id$CP$num$OP$id$CP", $_);';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRbkchsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   ", " . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchvsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   " verse " . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRchsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   \', \' . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRvrsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   " to " . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRvsep{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   ", " . $_;';
   $tmp .= '}';
   eval($tmp);
   $tmp='';
   $tmp .= 'sub do_cmd_BRperiod{';
   $tmp .= '   local($_)=@_;';
   $tmp .= '   $_;';
   $tmp .= '}';
}

sub do_bibleref_default{
   &brs_default;
}

sub do_bibleref_jerusalem{
   &brs_jerusalem;
}

sub do_bibleref_anglosaxon{
   &brs_anglosaxon;
}

sub do_bibleref_JEH{
   &brs_JEH;
}

sub do_bibleref_MHRA{
   &brs_MHRA;
}

sub do_bibleref_NTG{
   &brs_NTG;
}

sub do_bibleref_MLA{
   &brs_MLA;
}

sub do_bibleref_chicago{
   &brs_chicago;
}

sub do_bibleref_text{
   &brs_chicago;
}

sub do_cmd_newbiblerefstyle{
   local($_)=@_;
   local($style,$cmds);
   $style = &missing_braces unless
              s/$next_pair_pr_rx/$style=$2;''/eo;

   &write_warnings("\n\\newbiblerefstyle not implemented");

   $_;
}

sub do_cmd_setbooktitle{
   local($_)=@_;
   local($name,$title);

   $name = &missing_braces unless 
              s/$next_pair_pr_rx/$name=$2;''/eo;
   $title = &missing_braces unless 
              s/$next_pair_pr_rx/$title=$2;''/eo;

   if (defined $bookname{$name})
   {
      $bookname{$name}=$title;
   }
   else
   {
      &write_warnings("\nUnknown book '$name'");
   }

   $_;
}

sub do_cmd_biblerefstyle{
   local($_)=@_;
   local($style);
   $style = &missing_braces unless
               s/$next_pair_pr_rx/$style=$2;''/eo;

   if (defined "&brs_$style")
   {
      eval("&brs_$style");
   }
   else
   {
      &write_warnings("\nUnknown biblerefstyle '$style'");
   }
   $_;
}

sub do_cmd_bibleverse{
   local($_)=@_;
   local($book,$id);
   local($bibleverse)='';
   $book = &missing_braces unless 
              s/$next_pair_pr_rx/$book=$2;$id=$1;''/eo;

   if (defined $bookname{$book} or defined $synonym{$book})
   {
      $book = $synonym{$book} unless defined $bookname{$book};

      $book = $bookname{$book};
      $book = "\\BRbooktitlestyle$OP$id$CP$book$OP$id$CP";
      $bibleverse .= $book;
      $first=1;

      while (s/^(-?)\(([^:]*):([^\)]*)\)//)
      {
         if ($1 eq '-')
         {
            $bibleverse .= "\\BRvrsep ";
         }
         else
         {
            $bibleverse .= ($first ? "\\BRbkchsep " : "\\BRchsep ");
         }
         $first=0;
         $id = ++$global{'max_id'};
         $bibleverse .= "\\BRchapterstyle$OP$id$CP$2$OP$id$CP" if ($2);
         $verses = $3;
         if ($verses)
         {
            $bibleverse .= "\\BRchvsep ";
            @verses = split /,/, $verses;

            for (my $i = 0; $i <=$#verses; $i++)
            {
               $verse = $verses[$i];

               $bibleverse .= "\\BRvsep " if ($i > 0);

               if ($verse=~m/(\d+)-(\d+)/)
               {
                  $id = ++$global{'max_id'};
                  $bibleverse .= "\\BRversestyle$OP$id$CP$1$OP$id$CP";
                  $bibleverse .= "\\BRvrsep ";
                  $id = ++$global{'max_id'};
                  $bibleverse .= "\\BRversestyle$OP$id$CP$2$OP$id$CP";
               }
               else
               {
                  $id = ++$global{'max_id'};
                  $bibleverse .= "\\BRversestyle$OP$id$CP$verse$OP$id$CP";
               }
            }
         }
      }

      $bibleverse = &translate_commands($bibleverse);
   }
   else
   {
      &write_warnings("\nUnknown book '$book'");
   }
   join('', $bibleverse, $_);
}

1;
%    \end{macrocode}
%\fi
%\iffalse
%    \begin{macrocode}
%</bibleref.perl>
%    \end{macrocode}
%\fi
%\Finale
\endinput
