bibleref.sty v1.14: a LaTeX2εpackage for typesetting bible references

bibleref.sty v1.14: a LATEX2ε package for typesetting bible references

Nicola Talbot
School of Computing Sciences
University of East Anglia
Norwich. Norfolk. NR4 7TJ.
United Kingdom
http://theoval.cmp.uea.ac.uk/~nlct/

2011-01-19

Contents

1 Introduction
2 Defining New Styles
3 Indexing Bible References
 3.1 Index Categories
 3.2 The bibleref-xidx Package
 3.3 Separate Scripture Index
 3.4 Changing the Sort Order
4 Distributing New Styles
5 Acknowledgements
Index

1 Introduction

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


\bibleverse  \bibleverse{book title}(chapter:verse(s))

This command can be used to cite a bible book, chapter or verse or range of chapters or verses.

Be careful if you use bibleref with babel as some of babel’s language options make the colon character active, which will cause a problem for \bibleverse (and \ibibleverse, described later). Check the babel documentation to find out how to make the colon non-active.

The book title, book title, may be given either as the full title (e.g. Matthew) or as an abbreviation (e.g. Mt or 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 \bibleverse{IIKings}

You may have any number, or zero, sets of parenthesis (chapter:verse(s)), 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. 2-4. In the typeset output the verses will be separated with


\BRvsep  \BRvsep

(an en-dash by default.) A chapter may be referenced without a verse, but the colon must remain, e.g. (12:) simply indicates chapter 12.

A range of verses spanning more than one chapter can be entered as (ch:v)-(ch:v)

If there is no verse, but there are multiple chapters or chapter ranges, these may be specified in the chapterpart, using a comma to separate individual chapters and a hyphen to separate ranges. Note that you still need a colon at the end of the list.

Examples:

\bibleverse{Ex} Exodus
\bibleverse{Exodus}(20:) Exodus 20
\bibleverse{Exod}(20:17) Exodus 20:17
\bibleverse{IICo}(12:21) 2 Corinthians 12:21
\bibleverse{IICor}(12:21-32) 2 Corinthians 12:21–32
\bibleverse{Ex}(20:17)(21:3) Exodus 20:17;21:3
\bibleverse{Ex}(15:)(17:)(20:) Exodus 15;17;20
\bibleverse{Rev}(1:2,5,7-9,11) Revelation 1:2,5,7–9,11
\bibleverse{IChronicles}(1:3)-(2:7)1 Chronicles 1:3–2:7
\bibleverse{Luke}(1,4-5,8:) Luke 1,4–5,8

The style of the reference can be specified either by package option or as the argument to the command


\biblerefstyle  \biblerefstyle{style}

Styles are listed in Table 1.


Table 1: Bible Citation Styles (can be used as package option or in the argument to \biblerefstyle)

Style

Example

default

2 Corinthians 12:1–5

jerusalem

2 Co 12:1–5

anglosaxon

II Cor. XII.1–5

JEH

2 Cor. xii. 1–5

NTG

2 Cor xii,1–5

MLA

2 Cor. xii.1–5

chicago

2 Cor. xii : 1–5

text

Second Epistle to the Corinthians, chapter twelve verse one to five


You can change the name of a book using


\setbooktitle  \setbooktitle{name}{new title}

Note that namemust be the full name, not the abbreviated name of the book. For example, to change Revelation to Apoc, do \setbookname{Revelation}{Apoc} (Note that you shouldn’t do \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:


\setindexbooktitle  \setindexbooktitle{name}{title}

In this case, nameshould be the name you’ll use in \ibibleverse. For example, if you do:

\setbooktitle{Psalms}{Psalm}  
\setindexbooktitle{Psalms}{Psalms}

Then \ibibleverse{Psalms}(2:) will print Psalm the document and Psalms in the index, but \ibibleverse{Ps}(2:) will print Psalms in both the document and the index.

You can add a book using


\addbiblebook  \addbiblebook{name}{title}

For example:

\addbiblebook{Susanna}{Story of Susanna}

Top

2 Defining New Styles

You can define a new style using the command


\newbiblerefstyle  \newbiblerefstyle{style-name}{commands}

where commandsare the commands needed to modify the citation style.

Example: This new style is based on the “default” style, but has verses in lower case Roman numerals, and redefines “Revelation” as “Apocalypse”.

\newbiblerefstyle{sample}{%  
\biblerefstyle{default}%  
\renewcommand{\BRversestyle}[1]{\romannumeral##1}%  
\setbooktitle{Revelation}{Apocalypse}%  
}

Note the use of ##1 instead of #1.

If you want to distribute a new style, see section 4.

Top

3 Indexing Bible References


\ibibleverse  \ibibleverse[format]{book title}({chapter}:verse(s))

This does the same as \bibleverse but also adds an index entry (provided you have used \makeindex in the preamble.) The default page number format is given by the command


\bvidxpgformat  \bvidxpgformat

This is textrm by default, but can be redefined. To override the page number format for a particular entry you can use the optional argument to \ibibleverse. For example:

\ibibleverse[textit]{Exodus}

(Note there is no backslash.)


\ibiblechvs  \ibiblechvs[format]{book title}({chapter}:verse(s))

This is similar to \ibibleverse except that it doesn’t display the book name in the text. The reference is indexed under the book title in the same way as \ibibleverse.


\ibiblevs  \ibiblevs[format]{book title}({chapter}:verse(s))

This is similar to \ibiblechvs except that it only displays the verse(s) in the text.

You may need to create your own custom 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 sample.ist and write in the lines:

delim_0 "\\dotfill "  
delim_1 "\\dotfill "  
delim_2 "\\dotfill "

See the makeindex documentation for further details.

Top

3.1 Index Categories

You may prefer to index the bible reference under a category with the book title as a sub item of that category. This can be achieved using:


\biblerefcategory  \biblerefcategory[sort key]{category title}

The optional argument is the sort key to be used by makeindex or xindy. If omitted category titleis used.

Note that \ibibleverse, \ibiblechvs and \ibiblevs use the category that is currently set. If you need to keep switching categories, you may find it easier to define a shortcut command. For example, suppose you’re discussing the differences between the King James and the New Jerusalem versions, you could define the following:

\newcommand{\kjref}{\biblerefcategory{King James}\ibibleverse}  
\newcommand{\njref}{\biblerefcategory{New Jerusalem}\ibibleverse}

You can now use \kjref and \njref in the same way that you would use \ibibleverse

You can disable the category by setting it to nothing:

\biblerefcategory{}

Top

3.2 The bibleref-xidx Package

The bibleref package comes with a supplementary package bibleref-xidx that modifies the way bible references are added to the index. With no package options, i.e., just

\usepackage{bibleref-xidx}

the verses will appear as sub-items of the chapters. Note that a verse range will be considered a single item so, for example,

\ibibleverse{Ex}(9:1)  
\ibibleverse{Ex}(9:4)  
\ibibleverse{Ex}(9:1-4)

will occur as three separate entries under Exodus chapter 9. Also note that (9-14:) and (9:)-(14:) will be treated differently.

The bibleref-xidx package can be loaded with the following options:

noverses
Don’t show the verses in the index.
verses
Show the verses (and chapters) in the index (default).
nochapters
Don’t show the chapters (and verses) in the index.
chapters
Show the chapters in the index (default).

All other package options will be passed to the bibleref package, which bibleref-xidx automatically loads.

Top

3.3 Separate Scripture Index

If you want a separate index for bible verses, in addition to a general index, you can redefine


\biblerefindex  \biblerefindex

This command defaults to \index, but can be changed to the appropriate indexing command. For example, suppose you are using the multind package and you want a general index and a scripture index, you can do something like:

\documentclass{article}  
\usepackage{bibleref}  
\usepackage{multind}  
\makeindex{scripture}  
\makeindex{general}  
\renewcommand{\biblerefindex}{\index{scripture}}

In the document, you can use \ibibleverse as before, and the scripture index is displayed using

\printindex{scripture}{Scripture Index}

You will then need to run makeindex on the file scripture.idx. See the multind documentation for further details.

Top

3.4 Changing the Sort Order

The bible reference entries will be sorted alphabetically by makeindex. However you may prefer the entries to be sorted according to their order in the bible. This can either be done using xindy instead of makeindex and creating your own custom alphabet (see xindy manual for details) or you can use bibleref’s mapping command.


\biblerefmap  \biblerefmap{label}{new sort key}

For example, in the preamble:

\biblerefmap{Genesis}{01}  
\biblerefmap{Exodus}{02}  
\biblerefmap{Leviticus}{03}  
\biblerefmap{Numbers}{04}  
\biblerefmap{Deuteronomy}{05}  
...

When you run 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:

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

Top

4 Distributing New Styles

If you want a new bible reference style (or translation) publicly available, then it’s a good idea to upload it to CTAN (www.ctan.org). If you’ve never done this before, you might find it a bit daunting, so here are a few pointers.

I suggest that you give the name of your new package the prefix bibleref- as then it will appear close to bibleref in the alphabetical list in the catalogue. Suppose your new style is called “mystyle”1, then create a file called bibleref-mystyle.sty. At the start of the file, do:

\NeedsTeXFormat{LaTeX2e}  
\ProvidesPackage{bibleref-mystyle}[2011/01/19 v1.0 Bible reference  
style conforming to something or other]

(Change the date and the brief description in the line above to something more appropriate.) Next you need to load bibleref:

\RequirePackage{bibleref}

Now do the new style stuff (or redefine styles to provide translations):

\newbiblerefstyle{mystyle}{%  
\biblerefstyle{default}%  
\renewcommand{\BRversestyle}[1]{\romannumeral##1}%  
\setbooktitle{Revelation}{Apocalypse}%  
}

(Again change the above to whatever is appropriate.) Put any new book definitions that your style may require, for example:

\addbiblebook{Susanna}{Story of Susanna}

and add any \biblerefmap commands that are required. Then set your new style as the current style, if appropriate:

\biblerefstyle{mystyle}

On the last line of the file add:

\endinput

Next you need to create a file called “README” that contains some information about your new package, including what license you want to distribute it under. (If you don’t know anything about licenses, I recommend you choose the LATEX Project Public License, LPPL.)

It’s worth adding a sample file or a little bit of documentation that illustrates how the references appear.

Put your .sty file, README file and samples or documentation into a zip archive. You’re now ready to upload it. There are several upload pages. The main one is at http://www.ctan.org/upload.html. The name of your contribution is the name of your package (“bibleref-mystyle” in this example). Remember to put your name and email in the relevant input boxes. Sometime after you’ve uploaded your zip file, you’ll get a copy of the announcement from one of the CTAN maintainers. It usually takes a day to establish itself. After that people can download and use it.

Top

5 Acknowledgements

Many thanks to all the useful comments from comp.text.tex, especially from Jesse Billett, Brooks Moses and Ulrich M. Schwarz.

Top

Index

A

\addbiblebook  1

B babel package  2
bibleref package  3, 4, 5, 6, 7, 8, 9
bibleref-xidx package  10, 11, 12, 13
\biblerefcategory  14
\biblerefindex  15
\biblerefmap  16
\biblerefstyle  17
\bibleverse  18
\BRvsep  19
\bvidxpgformat  20

I \ibiblechvs  21, 22
\ibibleverse  23, 24, 25
\ibiblevs  26, 27

M makeindex  28, 29, 30, 31, 32, 33, 34
multind package  35, 36

N \newbiblerefstyle  37

P package options:
    chapters  38
    nochapters  39
    noverses  40
    verses  41

S \setbooktitle  42
\setindexbooktitle  43

X xindy  44, 45, 46

1Choose a more descriptive name than this.