Debian Codegraph @

texmf-dist/doc/latex/bibleref-parse/bibleref-parse.tex

raw
1 %% bibleref-parse.tex
2 %% Copyright (c) 2011 Sebastian Kuhnert
3 %
4 % This work may be distributed and/or modified under the conditions
5 % of the LaTeX Project Public License, either version 1.3c of this
6 % license or (at your option) any later version. The latest version
7 % of this license is at http://www.latex-project.org/lppl.txt
8 % and version 1.3c or later is part of all distributions of LaTeX
9 % version 2008/05/04 or later.
10 %
11 % This work has the LPPL maintenance status `maintained'.
12 %
13 % The Current Maintainer of this work is Sebastian Kuhnert.
14 %
15 % This work consists of the files listed in README
16 %
17 \documentclass[DIV12,BCOR0mm]{scrartcl}
18
19 \frenchspacing
20
21 \usepackage[T1]{fontenc}
22 \usepackage{bera}
23 \usepackage[bitstream-charter]{mathdesign}
24
25 \usepackage[utf8]{inputenc}
26 \usepackage[ngerman,british]{babel}
27
28 \addtokomafont{disposition}{\rmfamily}
29 \addtokomafont{descriptionlabel}{\rmfamily}
30
31 \usepackage{csquotes}
32 \usepackage{xspace}
33 \usepackage{xcolor}
34 \usepackage{calc}
35 \usepackage{listings}
36 \lstloadlanguages{TeX}
37 \lstset{%
38 language=[LaTeX]TeX,
39 basicstyle=\ttfamily\color{blue!50!black},
40 keywordstyle=,%\bfseries,
41 morekeywords={subject},
42 identifierstyle=,
43 texcl,
44 commentstyle=\itshape,
45 showstringspaces=false,
46 breaklines,
47 breakatwhitespace,
48 %columns=flexible,
49 escapeinside={(*}{*)},
50 mathescape,
51 }
52 \usepackage[raggedrightboxes]{ragged2e}
53 \usepackage{booktabs}
54 \newcommand{\thead}[1]{\textbf{\small #1}}
55 % \usepackage{xtab}
56 \usepackage{longtable}
57 \usepackage{pgffor}
58
59 \usepackage[pdfusetitle]{hyperref}
60
61 \newcommand{\ger}[1]{\foreignlanguage{ngerman}{#1}}
62
63 \newcommand{\brp}{\texttt{bibleref-parse}\xspace}
64
65 \newcommand{\param}[1]{$\langle${\normalfont\itshape #1\/}$\rangle$}
66 \newcommand{\opt}[1]{\textcolor{green!50!black}{#1}}
67 \newcommand{\option}[1]{{\normalfont\texttt{\color{blue!50!black}#1}}}
68
69 \usepackage{bibleref-parse}
70 \usepackage[english]{isodate}
71
72 \def\bbtGetInfo#1 v#2 #3\relax#4\relax{%
73 \def\bbtdate{#1}%
74 \def\bbtversion{#2}}
75 \letcs\bbtver{[email protected]}
76 \expandafter\bbtGetInfo\bbtver\relax? ? \relax\relax
77
78 \title{The \brp Package}
79 \author{Sebastian Kuhnert}
80 \date{Documentation for version \bbtversion{} (\printdateTeX{\bbtdate})}
81
82 \begin{document}
83 \maketitle
84
85 \section{Introduction}
86
87 The \brp package parses Bible passages that are given in human readable format.
88 It accepts a wide variety of formats. This allows for a simpler and more
89 convenient interface to the functionality of the \texttt{bibleref} package,
90 which provides a variety of different formatting options.
91
92 \begin{center}
93 \begin{tabular}{@{}lll@{}}
94 \toprule
95 \thead{\brp syntax example}&\thead{\texttt{bibleref} syntax example}&\thead{result (using defaults)}\\
96 \midrule
97 \texttt{\textbackslash pbibleverse\{1Cor 13:4-7\}}&
98 \texttt{\textbackslash bibleverse\{ICor\}(13:4-7)}&
99 \pbibleverse{1Cor 13:4-7}\\
100 \texttt{\textbackslash pbibleverse\{Matt 9:35-10:1\}}&
101 \texttt{\textbackslash bibleverse\{Matt\}(9:35)-(10:1)}&
102 \pbibleverse{Matt 9:35-10:1}\\
103 \texttt{\textbackslash pbibleverse\{Rev 21;22\}}&
104 \texttt{\textbackslash bibleverse\{Rev\}(21:)(22:)}&
105 \pbibleverse{Rev 21;22}\\
106 %\texttt{\textbackslash pbibleverse\{Jes53:6;Joh19:30\}}&
107 %\texttt{\textbackslash bibleverse\{Jes\}(53:6); \textbackslash bibleverse\{Joh\}(19:30)}\\
108 \bottomrule
109 \end{tabular}
110 \end{center}
111
112 \noindent
113 Additionally, this package provides an interface for other packages.
114
115
116
117 \subsection{Licence}
118 Copyright \textcopyright{} 2011 Sebastian Kuhnert. Permission is granted to
119 copy, distribute and/or modify this software under the terms of the \LaTeX{}
120 Project Public Licence, version 1.3c or later. This package is maintained, the
121 Current Maintainer is Sebastian
122 Kuhnert\footnote{\href{mailto:[email protected]}{[email protected]}}.
123
124 %\subsection{Contributions}
125
126 \subsection{Dependencies and interaction with other packages}
127
128 \begin{itemize}
129 \item This package enhances and requires the \texttt{bibleref} package.
130 \item If the \texttt{babel} package is loaded and one of the languages
131 \texttt{ngerman}, \texttt{german}, \texttt{naustrian}, or \texttt{austrian} is
132 selected, the book name \enquote{Pr} is taken as a shorthand for
133 \emph{\ger{Prediger}} (German for \emph{Ecclesiastes}). Otherwise, \enquote{Pr} is a
134 shorthand for \emph{Proverbs}.
135 \item If you use \texttt{bibleref-german}, you either need at least version 1.0a or
136 must load it before this package.
137 \item The \texttt{etoolbox} package is required. In particular, you need to use
138 an \eTeX{} engine, but that should be no real restriction nowadays.
139 \item The \texttt{scrlfile} package is used to ease the interaction with
140 \texttt{babel} and \texttt{bibleref-german}.
141 \end{itemize}
142
143 \subsection{Contributions}
144 Currently only English and German book names are supported. I would welcome
145 contributions of book name prefixes for other languages.
146
147
148 \section{User commands}
149
150 \begin{lstlisting}
151 \usepackage(*\opt{[\param{options}]}*){bibleref-parse}
152 \end{lstlisting}
153 This loads the \brp package. Currently the only option is
154 \option{comma=\param{value}}. It controls how commas in a Bible passage
155 specification are handled:
156 \bigskip
157 \begin{center}
158 \begin{tabular}{@{}p{.18\linewidth}p{.78\linewidth}@{}}
159 \toprule
160 \thead{\param{\bfseries value}}&\thead{meaning of \option{\bfseries
161 comma=\param{\bfseries value}}}\\
162 \midrule
163 \option{list}&The comma is used as a list separator. Behind each
164 comma,
165 a number specifying a chapter or a verse is expected.
166 \hfill\emph{Example:~Mt~5,6,7}
167 \\\addlinespace
168 \option{chvsep}&The comma is used to separate a chapter number from a
169 verse number. This is common in German.
170 \hfill\emph{Example:~Jh~3,16}\\\addlinespace
171 \option{likeBR}&This takes the current setup of the \texttt{bibleref}
172 package into account. If \lstinline|\BRchvsep| contains a comma, this
173 option behaves like \option{chvsep}, otherwise it behaves like
174 \option{list}.\\\addlinespace
175 \option{preferchvsep}&This behaves like \option{chvsep} unless the
176 specified passage contains a colon. In that case, it behaves like
177 \option{list}.\\\addlinespace
178 \option{preferlikeBR}\linebreak\emph{(the default)}&If
179 \lstinline|\BRchvsep| contains a comma, this behaves like
180 \option{preferchvsep}. Otherwise this behaves like
181 \option{list}.\\
182 \bottomrule
183 \end{tabular}
184 \end{center}
185
186 \begin{lstlisting}
187 \biblerefparseset{(*\param{options}*)}
188 \end{lstlisting}
189 This sets the \param{options}, affecting all following passage specifications in
190 the current group.
191
192 \begin{lstlisting}
193 \pbibleverse(*\opt{[\param{options}]}\{\param{passage}*)}
194 \end{lstlisting}
195 This parses the given \param{passage} and passes the result to the
196 \lstinline|\bibleverse| macro, formatting it according to the rules of the of
197 the \texttt{bibleref} package. If any \param{options} are specified, they affect
198 this single \param{passage} only.
199
200 If a \param{passage} spans more than one book, the different parts are
201 separated with \lstinline|\BRbksep|, which you can redefine to suit your needs.
202 The \texttt{bibleref} manual describes how you can otherwise influence the
203 formatting.
204
205 There are variants of \lstinline|\pbibleverse| for the variants of \lstinline|\bibleverse|:
206 \begin{lstlisting}
207 \pibibleverse(*\opt{[\param{options}]}\{\param{passage}*)} % uses \textbackslash ibibleverse
208 \pibiblechvs(*\opt{[\param{options}]}\{\param{passage}*)} % uses \textbackslash ibiblechvs
209 \pibiblevs(*\opt{[\param{options}]}\{\param{passage}*)} % uses \textbackslash ibiblevs
210 \end{lstlisting}
211
212 \newcommand{\bverseex}[2][]{%
213 \ifstrequal{#1}{}{%
214 \texttt{\textbackslash pbibleverse\{#2\}} & \pbibleverse{#2}%
215 }{%
216 \texttt{\textbackslash pbibleverse[#1]\{#2\}} & \pbibleverse[#1]{#2}%
217 }\\
218 }
219 Examples:
220 \begin{center}
221 \begin{tabular}{@{}ll@{}}
222 \toprule
223 \thead{\TeX{} source}&\thead{Result}\\
224 \midrule
225 \bverseex{Gen1:27}
226 \bverseex{Exo 20}
227 \bverseex[comma=chvsep]{Lev.5,3-4}
228 \bverseex{Jos 7:3-5;12;Jdg 4:2-4}
229 \bverseex{Ruth 3-4:4+4:6}
230 \bverseex{1Sam 5:3,5;6:3-7:3;8:3,5}
231 \bverseex{Ps 1-3,5,8-9}
232 \bverseex{Obad 1-3,5,8-9}
233 \bottomrule
234 \end{tabular}
235 \end{center}
236
237 The given \param{passage} will be expanded in a special way before parsing:
238 Control sequences are expanded recursively, but active characters are left
239 unchanged. Also, \param{passage} should not contain braces; the behaviour is
240 undefined in this case.
241
242 \subsection{Bible passage specification}
243
244 The basic massage is: Just use your intuition. This is what this package was
245 created for.\\
246 If you want more details, here they are.
247 \begin{itemize}
248 \item Depending on the current setting of the \option{comma} option (see
249 above), a single verse can be specified in one of these formats:
250 \begin{lstlisting}
251 (*{\normalfont\normalcolor Format 1:} \param{book} \param{chapter}:\param{verse}*)
252 (*{\normalfont\normalcolor Format 2:} \param{book} \param{chapter},\param{verse}*)
253 \end{lstlisting}
254 You can add or remove spaces between the different parts.
255
256 The exact syntax for the book name can be looked up in
257 Section~\ref{sec:books}; but again the basic message is: Just use your
258 intuition.
259
260 Examples:\qquad\option{Mark 16:5}\qquad
261 \option{1 Samuel 13:14}\qquad
262 \option{2Tim3: 16}
263 \item You can reference a \textbf{whole chapter or book} by omitting the verse
264 (and chapter) information.
265
266 Examples:\qquad\option{1 John}\qquad
267 \option{Ps 51}
268 \item You can specify \textbf{ranges} using a single dash. This works for
269 ranges of verses as well as ranges of chapters. The start and the end verse do
270 not have to be in the same chapter. You even can have a chapter as start and a
271 verse as end (but not the other way around).
272
273 Examples:\qquad
274 \option{Mt 28:18-20}\qquad
275 \option{Matthew 5-7}\qquad
276 \option{2Cor 6:10-7:4}\qquad
277 \option{Joshua 4-5:1}
278 \item You can \textbf{list} several passages in one specification. Several
279 options are available. They offer flexibility and differ in how the passage on
280 the right side should be specified: Some allow and some require that a partial
281 specification is used.
282 \begin{description}
283 \item[Semicolon] The next item may be a book or a chapter.
284 \item[Comma] The next item may be a chapter or a verse.\\
285 (For obvious reasons this is only available in format 1.)
286 \item[Plus] The next item may be a book, a chapter or a verse.
287 \item[Dot] The next item must be a verse.
288 \end{description}
289 All of these have in common that you can use ranges on their left and on their
290 right side. Also, you can create lists of more than two single verses or range
291 specifications.
292
293 Examples:\qquad
294 \option{Col 1:15,2:9.10}\qquad
295 \option{Ps 22+23}\qquad
296 \option{Rev 22:3-4.7;Acts 1:6-8}
297 \end{itemize}
298
299 \subsection{Book name specification}\label{sec:books}
300 All names of canonical books given in English or German should be recognised,
301 including their abbreviations. The following table specifies the available names
302 for all books.
303
304 \makeatletter
305 \def\checkbook#1#2#3{%
306 \def\brp@range##1##2##3##4##5{\ifstrequal{##1}{#1}{#3 }{%
307 \PackageError{bibleref-parse}{Book name `#2' not recognised as `#1'}{}{}%
308 \textcolor{red}{#3} }}%
309 \brp@parse{#2}%
310 \brp@result%
311 }
312 \def\checkbooksilent#1#2{%
313 \def\brp@range##1##2##3##4##5{\ifstrequal{##1}{#1}{}{%
314 \PackageError{bibleref-parse}{Book name `#2' not recognised as `#1'}{}{}%
315 \textcolor{red}{#2} }}%
316 \brp@parse{#2}%
317 \brp@result%
318 }
319 \makeatother
320 %\addrow{OSIS-name}{English names}{German names}{silent names}
321 \def\addrow#1#2#3#4{%
322 #1&\checkbooksilent{#1}{#1}%
323 \foreach \name in {#4} {%
324 \checkbooksilent{#1}{\name}%
325 }%
326 \foreach \name/\n in {#2} {%
327 \checkbook{#1}{\name}{\n}%
328 }&\ger{\foreach \name/\n in {#3} {%
329 \checkbook{#1}{\name}{\n}%
330 }}\\
331 }
332 \begin{longtable}{@{}p{3.6em}p{.425\linewidth}p{.425\linewidth}@{}}
333 \toprule\thead{Book}&\thead{English names}&\thead{German names}\\\midrule
334 \endhead
335 \bottomrule
336 \endfoot
337 \addrow{Gen}{Genesis,Gen,Ge,Gn,Ge*,Gn*}{1Mose,1Mos,1Mo,Genesis,Gen,Ge,Gn,1Mo*,Ge*,Gn*}{IMose,IMos,IMo,IMo*}
338 \addrow{Exod}{Exodus,Exod,Ex,Ex*}{2Mose,2Mos,2Mo,Exodus,Ex,2Mo*,Ex*}{IIMose,IIMos,IIMo,IIMo*}
339 \addrow{Lev}{Leviticus,Lev,Lv,Le*,Lv*}{3Mose,3Mos,3Mo,Levitikus,Leviticus,Lev,Lv,3M*,Le*,Lv*}{IIIMose,IIIMos,IIIMo,IIIM*}
340 \addrow{Num}{Numbers,Num,Nb,Nu*,Nb*}{4Mose,4Mos,4Mo,Numeri,Num,4M*,Nu*}{IVMose,IVMos,IVMo,IV*}
341 \addrow{Deut}{Deuteronomy,Deut,Deu,Dt,De*,Dt*}{5Mose,5Mos,5Mo,Deuteronomium,Deut,Dtn,Deu,Dt,5M*,De*,Dt*}{VMose,VMos,VMo,V*}
342 \addrow{Josh}{Joshua,Josh,Jos,Jos*}{Josua,Jos*}{}
343 \addrow{Judg}{Judges,Judg,Jdg,Jg,Jd,Judg*,Jdg*,Jg*}{Richter,Ri,Ri*}{}
344 \addrow{Ruth}{Ruth,Rt,Ru*,Rt*}{Rut,Ruth,Rt,Ru,Ru*,Rt*}{}
345 \addrow{1Sam}{1Samuel,1Sam,1S,1S*}{1Samuel,1Sam,1S,1S*}{ISamuel,ISam,IS,IS*}
346 \addrow{2Sam}{2Samuel,2Sam,2S,2S*}{2Samuel,2Sam,2S,2S*}{IISamuel,IISam,IIS,IIS*}
347 \addrow{1Kgs}{1Kings,1K,1Kg,1Kgs,1Ki*,1Kg*}{1Könige,1Kön,1Kö,1Kö*}{IKings,IK,IKg,IKgs,IKi*,IKg*,IKönige,IKön,IKö,IKö*,IK\"onige,IK"on,IKoe,IK\"o*}
348 \addrow{2Kgs}{2Kings,2K,2Kg,2Kgs,2Ki*,2Kg*}{2Könige,2Kön,2Kö,2Kö*}{IIKings,IIK,IIKg,IIKgs,IIKi*,IIKg*,IIKönige,IIKön,IIKö,IIKö}
349 \addrow{1Chr}{1Chronicles,1Ch,1Chr,1Ch*}{1Chronik,1Chr,1Ch,1Ch*}{IChronicles,ICh,IChr,ICh*,IChronik}
350 \addrow{2Chr}{2Chronicles,2Ch,2Chr,2Ch*}{2Chronik,2Chr,2Ch,2Ch*}{IIChronicles,IICh,IIChr,IICh*,IIChronik}
351 \addrow{Ezra}{Ezra,Ezr,Ezr*}{Esra,Esr,Esr*}{}
352 \addrow{Neh}{Nehemiah,Neh,Ne,Ne*}{Nehemia,Nehemiah,Neh,Ne,Ne*}{}
353 \addrow{Esth}{Esther,Esth,Est,Est*}{Ester,Esther,Est,Est*}{}
354 \addrow{Job}{Job,Jb}{Hiob,Hi,Ijob,Hi*,Ij*}{}
355 \addrow{Ps}{Psalms,Psalm,Ps,Ps*}{Psalmen,Psalm,Psalter,Ps,Ps*}{}
356 \addrow{Prov}{Proverbs,Prov,Pro,Pr/Pr\textsuperscript{(see text)},Pro*}{Sprüche,Sprichwörter,Spr,Sp,Sp*}{}
357 \addrow{Eccl}{Ecclesiastes,Eccl,Ec,Qo,Ecl,Eccl,Eccle,Eccles,Ecclesiaste*,Q*}{Prediger,Pred,Pr/Pr\textsuperscript{(see text)},Kohelet,Koh,Pre*,Koh*}{Ecclesi,Ecclesia,Ecclesias,Ecclesiast}
358 \addrow{Song}{SongofSolomon,SongofSongs,SofS,Sg,So*,Sg*}{Hohelied,Hoheslied,HohesLied,Hld,Hhld,LiedderLieder,Lied,Hoh*,Hh*,Hl*,Li*}{}
359 \addrow{Isa}{Isaiah,Isa,Is,Is*}{Jesaja,Jesajah,Jes,Jesa*}{}
360 \addrow{Jer}{Jeremiah,Jer,Jr,Jer*,Jr*}{Jeremia,Jeremiah,Jer,Jr,Jer*,Jr*}{}
361 \addrow{Lam}{Lamentations,Lam,Lm,La*,Lm*}{Klagelieder,Klgl,Klg,Kl*}{}
362 \addrow{Ezek}{Ezekiel,Ezek,Ezk,Eze*,Ezk*}{Hesekiel,Hes,Ezechiel,Ez,Eze,Hes*,Eze*}{}
363 \addrow{Dan}{Daniel,Dan,Dn,Da*,Dn*}{Daniel,Dan,Dn,Da*,Dn*}{}
364 \addrow{Hos}{Hosea,Hos,Ho,Hos*}{Hosea,Hos,Ho,Hos*}{}
365 \addrow{Joel}{Joel,Jl,Joe*,Jl*}{Joel,Joël,Jl,Joe*,Joë*,Jl*}{Jo\"e*,Jo"e*}
366 \addrow{Amos}{Amos,Am,Am*}{Amos,Am,Am*}{}
367 \addrow{Obad}{Obadiah,Obad,Obd,Ob,Ob*}{Obadja,Obad,Obd,Ob,Ob*}{}
368 \addrow{Jonah}{Jonah,Jon,Jon*}{Jona,Jonah,Jon,Jon*}{}
369 \addrow{Mic}{Micah,Mic,Mi,Mi*}{Micha,Mic,Mi,Mi*}{}
370 \addrow{Nah}{Nahum,Nah,Na,Na*}{Nahum,Nah,Na,Na*}{}
371 \addrow{Hab}{Habakkuk,Hab,Hbk,Hak,Hab*,Hb*,Hak*}{Habakuk,Hab,Hbk,Hak,Hab*,Hb*,Hak*}{}
372 \addrow{Zeph}{Zephaniah,Zeph,Zp,Zep*,Zp*}{Zefanja,Zefanjah,Zef,Zef*}{}
373 \addrow{Hag}{Haggai,Hag,Hg,Hag*,Hg*}{Haggai,Hag,Hg,Hag*,Hg*}{}
374 \addrow{Zech}{Zechariah,Zech,Zc,Zec*,Zc*}{Sacharja,Sacharjah,Sach,Sa,Sa*}{}
375 \addrow{Mal}{Malachi,Mal,Ml,Mal*,Ml*}{Maleachi,Mal,Ml,Mal*,Ml*}{}
376 \midrule
377 \addrow{Matt}{Matthew,Matt,Mt,Mat*,Mt*}{Matthäus,Matt,Mt,Mat*,Mt*}{}
378 \addrow{Mark}{Mark,Mk,Mar*,Mk*}{Markus,Mk,Mar*,Mk*}{}
379 \addrow{Luke}{Luke,Lk,Lu*,Lk*}{Lukas,Lk,Lu*,Lk*}{}
380 \addrow{John}{John,Joh,Jn,Joh*,Jn*}{Johannes,Joh,Jh,Joh*,Jn*}{}
381 \addrow{Acts}{Acts,Ac,Ac*}{Apostelgeschichte,Apo,Apg,Apos*,Apg*}{}
382 \addrow{Rom}{Romans,Rom,Ro,Rm,Ro*,Rm*}{Römer,Röm,Rö}{Roemer,R\"omer,R"omer,Roem,R\"om,R"om,Roe,R\"o,R"o,Roe*,R\"o*,R"o*}
383 \addrow{1Cor}{1Corinthians,1Co,1Cor,1Co*}{1Korinther,1Kor,1Ko,1Kor*}{ICorinthians,ICo,ICor,ICo*,IKorinther,IKor,IKo,IKor*}
384 \addrow{2Cor}{2Corinthians,2Co,2Cor,2Co*}{2Korinther,2Kor,2Ko,2Kor*}{IICorinthians,IICo,IICor,IICo*,IIKorinther,IIKor,IIKo,IIKor*}
385 \addrow{Gal}{Galatians,Gal,Ga,Ga*}{Galater,Gal,Ga,Ga*}{}
386 \addrow{Eph}{Ephesians,Eph,Ep,Eph*}{Epheser,Eph,Eph*}{}
387 \addrow{Phil}{Philippians,Phil,Phi,Ph,Phili*}{Philipper,Phil,Phi,Ph,Phili*}{}
388 \addrow{Col}{Colossians,Col,C*}{Kolosser,Kol,Kol*}{}
389 \addrow{1Thess}{1Thessalonians,1Thess,1Th,1Th*}{1Thessalonicher,1Thessaloniker,1Thess,1Th,1Th*}{IThessalonians,IThess,ITh,ITh*,IThessalonicher,IThessaloniker}
390 \addrow{2Thess}{2Thessalonians,2Thess,2Th,2Th*}{2Thessaloniker,2Thess,2Th,2Th*}{IIThessalonians,IIThess,IITh,IITh*,IIThessaloniker}
391 \addrow{1Tim}{1Timothy,1Tim,1Tm,1Ti*,1Tm*}{1Timotheus,1Tim,1Tm,1Ti*,1Tm*}{ITimothy,ITim,ITm,ITi*,ITm*,ITimotheus}
392 \addrow{2Tim}{2Timothy,2Tim,2Tm,2Ti*,2Tm*}{2Timotheus,2Tim,2Tm,2Ti*,2Tm*}{IITimothy,IITim,IITm,IITi*,IITm*,IITimotheus}
393 \addrow{Titus}{Titus,Tit,Tt,Tit*,Tt*}{Titus,Tit,Tt,Tit*,Tt*}{}
394 \addrow{Phlm}{Philemon,Philem,Phlm,Phm,Phile*,Phl*,Phm*}{Philemon,Philem,Phlm,Phm,Phile*,Phl*,Phm*}{}
395 \addrow{Heb}{Hebrews,Hebr,Heb,He,Heb*}{Hebräer,Hebr,Heb,He,Heb*}{Hebraeer,Hebr\"aer,Hebr"aer}
396 \addrow{Jas}{James,Jas,Js,Jm,Ja*,Js*,Jm*}{Jakobus,Jak,Jk,Ja,Ja*,Jk*}{}
397 \addrow{1Pet}{1Peter,1Pet,1Pt,1P,1P*}{1Petrus,1Petr,1Pet,1Pt,1P*}{IPeter,IPet,IPt,IP,IP*}
398 \addrow{2Pet}{2Peter,2Pet,2Pt,2P,2P*}{2Petrus,2Petr,2Pet,2Pt,2P*}{IIPeter,IIPet,IIPt,IIP,IIP*}
399 \addrow{1John}{1John,1Joh,1Jo,1Jo*,1Jn*}{1Johannes,1Joh,1Jh,1Jo*,1Jh*}{IJohn,IJoh,IJo,IJo*,IJn*,IJohannes,IJh,IJh*}
400 \addrow{2John}{2John,2Joh,2Jo,2Jo*,2Jn*}{2Johannes,2Joh,2Jh,2Jo*,2Jh*}{IIJohn,IIJoh,IIJo,IIJo*,IIJn*,IIJohannes,IIJh,IIJh*}
401 \addrow{3John}{3John,3Joh,3Jo,3Jo*,3Jn*}{3Johannes,3Joh,3Jh,3Jo*,3Jh*}{IIIJohn,IIIJoh,IIIJo,IIIJo*,IIIJn*,IIIJohannes,IIIJh,IIIJh*}
402 \addrow{Jude}{Jude,Jud,Jude*}{Judas,Jud,Juda*}{}
403 \addrow{Rev}{Revelation,Rev,Rv,Rev*,Rv*}{Offenbarung,Offb,Ofb,Apokalypse,Apok,Apk,Of*,Apok*,Apk*}{}
404 \midrule
405 \addrow{Tob}{Tobit,Tob,To*}{Tobit,Tobias,Tob,To*}{}
406 \addrow{Jdt}{Judith,Jdt,Judi*,Jdt*}{Judit,Judith,Jdt,Judi*,Jdt*}{}
407 \addrow{AddEsth}{GreekEsther,GrEst,AddEst,AdditionstoE*,AdditionsE*,AddE*,GreekE*,GrE*}{StückezuEster,StückeEster,StEst,GrEst,StückezuE*,StückeE*,StE*}{StueckezuE*,StueckeE*,St\"uckezuE*,St\"uckeE*,St"uckezuE*,St"uckeE*,AdditionstoEsther}
408 \addrow{Wis}{Wisdom,WisdomofSolomon,W*}{Weisheit,WeisheitSalomos,Weish,W*}{}
409 \addrow{Sir}{Sirach,Ecclesiasticus,Si*,Ecclesiasti*,Ecclu*}{Sirach,JesusSirach,Si*,JesusS*}{}
410 \addrow{Bar}{Baruch,Ba*}{Baruch,Ba*}{}
411 \addrow{EpJer}{EpistleofJeremiah,EpistleJeremiah,EpJer,EpistleofJer*,EpistleJer*,EpJer*}{BriefdesJeremia,BriefJeremias,BrJer,BriefdesJer*,BriefJer*,BrJer*}{}
412 \addrow{AddDan}{AddDan,GreekDaniel,GrDan,AdditionstoD*,AdditionsD*,AddD*,GreekD*,GrD*}{StückezuDaniel,StückeDaniel,StDan,GrDan,StückezuD*,StückeD*,StD*}{StueckezuD*,StueckeD*,St\"uckezuD*,St\"uckeD*,St"uckezuD*,St"uckeD*,AdditionstoDaniel}
413 \addrow{1Macc}{1Maccabees,1Ma*}{1Makkabäer,1Makk,1Ma*}{IMa*}
414 \addrow{2Macc}{2Maccabees,2Ma*}{2Makkabäer,2Makk,2Ma*}{IIMa*}
415 \end{longtable}
416 \noindent Some remarks regarding the book name table:
417 \begin{itemize}
418 \item If an entry ends with a *, you can use any continuation of the given
419 prefix. However, it is recommended that you stick to standard names, as the
420 package might be extended to further languages in the future.
421 \item White space and dots are ignored.
422 \item While the book names are listed by language, they can right now be used
423 in all contexts. There is only one exception: \enquote{Pr} means
424 \emph{Proverbs} in English texts and \emph{\ger{Prediger}=Ecclesiastes}
425 in German texts (the latter requires using the \texttt{babel} package).
426 \item Some German book names include an umlaut (like \enquote{\ger{Römer}}).
427 They can be given in any of the following formats:
428 \begin{description}
429 \item[\texttt{\color{blue!50!black}Römer}] This is the most convenient, but
430 also the most fragile variant. It requires that the input encoding is
431 \texttt{utf8} or \texttt{latin1}.
432 \item[\texttt{\color{blue!50!black}Roemer}] You can use the ASCII version.
433 \item[\texttt{\color{blue!50!black}R\textbackslash"omer}] You can use \TeX{}
434 umlaut notation.
435 \item[\texttt{\color{blue!50!black}R"omer}] You can use the slightly shorter
436 notation provided by the \texttt{babel} package and its relatives for German
437 languages.
438 \item[\texttt{\color{blue!50!black}Romans}] You can switch to a different
439 language or an abbreviation that does not require an umlaut.
440 \end{description}
441 \end{itemize}
442
443 \subsection{Defining book names}
444
445 If the standard book names listed above are not enough, you can define your own
446 book names.
447 \begin{lstlisting}
448 \brpDefineBookPrefix{(*\param{new book prefix}*)}{(*\param{book name}*)}
449 \brpDefineBook{(*\param{new book name}*)}{(*\param{book name}*)}
450 \end{lstlisting}
451 Preferably, you define an entire prefix (this is slightly more efficient), and
452 use single definitions only if there are several continuations. The \param{book
453 name} should be the one given in the first column of the book name table
454 above.
455
456 Prefixes always take precedence over single book names. For this reason, you
457 might need to undefine them:
458 \begin{lstlisting}
459 \brpUndefBookPrefix{(*\param{new book prefix}*)}{(*\param{book name}*)}
460 \brpUndefBook{(*\param{new book name}*)}{(*\param{book name}*)}
461 \end{lstlisting}
462
463 If you want to provide different meanings of a book name depending on the
464 language, you can append your definitions to \texttt{babel}'s
465 \texttt{\textbackslash extras\param{lang}} and \texttt{\textbackslash
466 noextras\param{lang}} hooks. See the package source
467 \texttt{bibleref-parse.sty} for an example.
468
469 \section{Interface for package authors}
470
471 You can use the parser of book names separately.
472 \begin{lstlisting}
473 \brp@bookname{(*\param{book}*)}
474 \end{lstlisting}
475 This will set the macro \lstinline|\brp@bk| to the normalised name of the given
476 book. The normalised names are listed in the first column in the table above.
477 They were chosen according to OSIS naming conventions\footnote{See
478 \url{http://www.bibletechnologies.net/20Manual.dsp}, Section~24.}, which in
479 turn are based on the \emph{SBL handbook of style}.
480
481 To parse a passage specification, use the following macro.
482 \begin{lstlisting}
483 \brp@parse{(*\param{passage specification}*)}
484 \end{lstlisting}
485 This will set the macro \lstinline|\brp@result| to a sequence of range
486 specifications. A range specification has the following form:
487 \begin{lstlisting}
488 \brp@range{(*\param{book}*)}{(*\param{from chapter}*)}{(*\param{from verse}*)}{(*\param{to chapter}*)}{(*\param{to verse}*)}
489 \end{lstlisting}
490 Typically, you will provide a local definition of \lstinline|\brp@range| that
491 takes these five parameters when evaluating \lstinline|\brp@result|. The
492 parameters are set according to the following conventions:
493 \begin{itemize}
494 \item If a complete book is specified, the numbers are all empty.
495 \item If a complete from- or to-chapter is specified, the corresponding verse
496 is empty.
497 \item For non-ranges, the from- and to- values will be equal.
498 \item For books consisting of a single chapter, the chapter values will be
499 empty. This affects Obadiah, Philemon, 2 John and 3 John.
500 \end{itemize}
501
502 \appendix
503 \section{Revision history}
504
505 \subsection*{Version 1.1, 2011-04-10}
506 Improve expansion behaviour for \param{passage} arguments. This fixes a bug with
507 non-ASCII Bible passage specifications in UTF8 files using \texttt{inputenc}\\
508 Remove compatibility hack for \texttt{bibleref-german}\\
509 Improve documentation
510
511 \subsection*{Version 1.0, 2011-03-29}
512 Initial release.
513
514 \end{document}
515
516 %%% Local Variables:
517 %%% mode: latex
518 %%% TeX-master: t
519 %%% End:
520
521 %%% Local IspellDict: british