summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-04-11 23:18:01 +0000
committerKarl Berry <karl@freefriends.org>2011-04-11 23:18:01 +0000
commitc06f58e02f17703aacc018b8e48c4aa75f3e4a58 (patch)
tree74261f1538bb1ea445b4c5ddfe53e2eaddb30305
parent8440a3ec7fc7010d4c08fe26cca97573da388780 (diff)
bibleref-parse (11apr11)
git-svn-id: svn://tug.org/texlive/trunk@22054 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/bibleref-parse/bibleref-parse.pdfbin110530 -> 113039 bytes
-rw-r--r--Master/texmf-dist/doc/latex/bibleref-parse/bibleref-parse.tex72
-rw-r--r--Master/texmf-dist/tex/latex/bibleref-parse/bibleref-parse.sty76
3 files changed, 101 insertions, 47 deletions
diff --git a/Master/texmf-dist/doc/latex/bibleref-parse/bibleref-parse.pdf b/Master/texmf-dist/doc/latex/bibleref-parse/bibleref-parse.pdf
index c11797bb17f..c8e547feb7a 100644
--- a/Master/texmf-dist/doc/latex/bibleref-parse/bibleref-parse.pdf
+++ b/Master/texmf-dist/doc/latex/bibleref-parse/bibleref-parse.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/bibleref-parse/bibleref-parse.tex b/Master/texmf-dist/doc/latex/bibleref-parse/bibleref-parse.tex
index 76838279bfb..12de36ed287 100644
--- a/Master/texmf-dist/doc/latex/bibleref-parse/bibleref-parse.tex
+++ b/Master/texmf-dist/doc/latex/bibleref-parse/bibleref-parse.tex
@@ -92,7 +92,7 @@ which provides a variety of different formatting options.
\begin{center}
\begin{tabular}{@{}lll@{}}
\toprule
- \thead{\brp syntax}&\thead{\texttt{bibleref} syntax}&\thead{result (using defaults)}\\
+ \thead{\brp syntax example}&\thead{\texttt{bibleref} syntax example}&\thead{result (using defaults)}\\
\midrule
\texttt{\textbackslash pbibleverse\{1Cor 13:4-7\}}&
\texttt{\textbackslash bibleverse\{ICor\}(13:4-7)}&
@@ -100,6 +100,9 @@ which provides a variety of different formatting options.
\texttt{\textbackslash pbibleverse\{Matt 9:35-10:1\}}&
\texttt{\textbackslash bibleverse\{Matt\}(9:35)-(10:1)}&
\pbibleverse{Matt 9:35-10:1}\\
+ \texttt{\textbackslash pbibleverse\{Rev 21;22\}}&
+ \texttt{\textbackslash bibleverse\{Rev\}(21:)(22:)}&
+ \pbibleverse{Rev 21;22}\\
%\texttt{\textbackslash pbibleverse\{Jes53:6;Joh19:30\}}&
%\texttt{\textbackslash bibleverse\{Jes\}(53:6); \textbackslash bibleverse\{Joh\}(19:30)}\\
\bottomrule
@@ -129,6 +132,8 @@ Kuhnert\footnote{\href{mailto:mail@sebastian-kuhnert.de}{mail@sebastian-kuhnert.
selected, the book name \enquote{Pr} is taken as a shorthand for
\emph{\ger{Prediger}} (German for \emph{Ecclesiastes}). Otherwise, \enquote{Pr} is a
shorthand for \emph{Proverbs}.
+ \item If you use \texttt{bibleref-german}, you either need at least version 1.0a or
+ must load it before this package.
\item The \texttt{etoolbox} package is required. In particular, you need to use
an \eTeX{} engine, but that should be no real restriction nowadays.
\item The \texttt{scrlfile} package is used to ease the interaction with
@@ -197,7 +202,13 @@ separated with \lstinline|\BRbksep|, which you can redefine to suit your needs.
The \texttt{bibleref} manual describes how you can otherwise influence the
formatting.
-Examples:
+There are variants of \lstinline|\pbibleverse| for the variants of \lstinline|\bibleverse|:
+\begin{lstlisting}
+\pibibleverse(*\opt{[\param{options}]}\{\param{passage}*)} % uses \textbackslash ibibleverse
+\pibiblechvs(*\opt{[\param{options}]}\{\param{passage}*)} % uses \textbackslash ibiblechvs
+\pibiblevs(*\opt{[\param{options}]}\{\param{passage}*)} % uses \textbackslash ibiblevs
+\end{lstlisting}
+
\newcommand{\bverseex}[2][]{%
\ifstrequal{#1}{}{%
\texttt{\textbackslash pbibleverse\{#2\}} & \pbibleverse{#2}%
@@ -205,7 +216,7 @@ Examples:
\texttt{\textbackslash pbibleverse[#1]\{#2\}} & \pbibleverse[#1]{#2}%
}\\
}
-
+Examples:
\begin{center}
\begin{tabular}{@{}ll@{}}
\toprule
@@ -214,21 +225,19 @@ Examples:
\bverseex{Gen1:27}
\bverseex{Exo 20}
\bverseex[comma=chvsep]{Lev.5,3-4}
- \bverseex{Jos 7,3-5;12;Jdg 4,2-4}
+ \bverseex{Jos 7:3-5;12;Jdg 4:2-4}
\bverseex{Ruth 3-4:4+4:6}
\bverseex{1Sam 5:3,5;6:3-7:3;8:3,5}
+ \bverseex{Ps 1-3,5,8-9}
\bverseex{Obad 1-3,5,8-9}
\bottomrule
\end{tabular}
\end{center}
-\bigskip\noindent
-There are variants of \lstinline|\pbibleverse| for the variants of \lstinline|\bibleverse|:
-\begin{lstlisting}
-\pibibleverse(*\opt{[\param{options}]}\{\param{passage}*)} % uses \textbackslash ibibleverse
-\pibiblechvs(*\opt{[\param{options}]}\{\param{passage}*)} % uses \textbackslash ibiblechvs
-\pibiblevs(*\opt{[\param{options}]}\{\param{passage}*)} % uses \textbackslash ibiblevs
-\end{lstlisting}
+The given \param{passage} will be expanded in a special way before parsing:
+Control sequences are expanded recursively, but active characters are left
+unchanged. Also, \param{passage} should not contain braces; the behaviour is
+undefined in this case.
\subsection{Bible passage specification}
@@ -272,7 +281,8 @@ If you want more details, here they are.
specification is used.
\begin{description}
\item[Semicolon] The next item may be a book or a chapter.
- \item[Comma] The next item may be a chapter or a verse. (Format 1 only)
+ \item[Comma] The next item may be a chapter or a verse.\\
+ (For obvious reasons this is only available in format 1.)
\item[Plus] The next item may be a book, a chapter or a verse.
\item[Dot] The next item must be a verse.
\end{description}
@@ -290,17 +300,23 @@ If you want more details, here they are.
All names of canonical books given in English or German should be recognised,
including their abbreviations. The following table specifies the available names
for all books.
-\clearpage
+
+\makeatletter
\def\checkbook#1#2#3{%
- \csdef{brp@range}##1##2##3##4##5{\ifstrequal{##1}{#1}{#3 }{\textcolor{red}{#3} }}%
- \csuse{brp@parse}{#2}%
- \csuse{brp@result}%
+ \def\brp@range##1##2##3##4##5{\ifstrequal{##1}{#1}{#3 }{%
+ \PackageError{bibleref-parse}{Book name `#2' not recognised as `#1'}{}{}%
+ \textcolor{red}{#3} }}%
+ \brp@parse{#2}%
+ \brp@result%
}
\def\checkbooksilent#1#2{%
- \csdef{brp@range}##1##2##3##4##5{\ifstrequal{##1}{#1}{}{\textcolor{red}{#2} }}%
- \csuse{brp@parse}{#2}%
- \csuse{brp@result}%
+ \def\brp@range##1##2##3##4##5{\ifstrequal{##1}{#1}{}{%
+ \PackageError{bibleref-parse}{Book name `#2' not recognised as `#1'}{}{}%
+ \textcolor{red}{#2} }}%
+ \brp@parse{#2}%
+ \brp@result%
}
+\makeatother
%\addrow{OSIS-name}{English names}{German names}{silent names}
\def\addrow#1#2#3#4{%
#1&\checkbooksilent{#1}{#1}%
@@ -357,7 +373,7 @@ for all books.
\addrow{Hag}{Haggai,Hag,Hg,Hag*,Hg*}{Haggai,Hag,Hg,Hag*,Hg*}{}
\addrow{Zech}{Zechariah,Zech,Zc,Zec*,Zc*}{Sacharja,Sacharjah,Sach,Sa,Sa*}{}
\addrow{Mal}{Malachi,Mal,Ml,Mal*,Ml*}{Maleachi,Mal,Ml,Mal*,Ml*}{}
- %\midrule
+ \midrule
\addrow{Matt}{Matthew,Matt,Mt,Mat*,Mt*}{Matthäus,Matt,Mt,Mat*,Mt*}{}
\addrow{Mark}{Mark,Mk,Mar*,Mk*}{Markus,Mk,Mar*,Mk*}{}
\addrow{Luke}{Luke,Lk,Lu*,Lk*}{Lukas,Lk,Lu*,Lk*}{}
@@ -397,7 +413,6 @@ for all books.
\addrow{1Macc}{1Maccabees,1Ma*}{1Makkabäer,1Makk,1Ma*}{IMa*}
\addrow{2Macc}{2Maccabees,2Ma*}{2Makkabäer,2Makk,2Ma*}{IIMa*}
\end{longtable}
-\clearpage
\noindent Some remarks regarding the book name table:
\begin{itemize}
\item If an entry ends with a *, you can use any continuation of the given
@@ -484,10 +499,17 @@ parameters are set according to the following conventions:
empty. This affects Obadiah, Philemon, 2 John and 3 John.
\end{itemize}
-% \appendix
-% \section{Revision history}
-% \subsection*{Version 0.1, 2011-03-25}
-% Initial release.
+\appendix
+\section{Revision history}
+
+\subsection*{Version 1.1, 2011-04-10}
+Improve expansion behaviour for \param{passage} arguments. This fixes a bug with
+non-ASCII Bible passage specifications in UTF8 files using \texttt{inputenc}\\
+Remove compatibility hack for \texttt{bibleref-german}\\
+Improve documentation
+
+\subsection*{Version 1.0, 2011-03-29}
+Initial release.
\end{document}
diff --git a/Master/texmf-dist/tex/latex/bibleref-parse/bibleref-parse.sty b/Master/texmf-dist/tex/latex/bibleref-parse/bibleref-parse.sty
index ceded4813a5..fbd71127a4c 100644
--- a/Master/texmf-dist/tex/latex/bibleref-parse/bibleref-parse.sty
+++ b/Master/texmf-dist/tex/latex/bibleref-parse/bibleref-parse.sty
@@ -14,7 +14,7 @@
%
% This work consists of the files listed in README
%
-\ProvidesPackage{bibleref-parse}[2011/03/29 v1.0 Parsing of Bible references]
+\ProvidesPackage{bibleref-parse}[2011/04/10 v1.1 Parsing of Bible references]
% command definitions
\RequirePackage{etoolbox}
@@ -129,12 +129,12 @@
% bibleref-german uses \newcommand* to provides \br@ aliases
% To avoid conflicts, undefine this before it is loaded:
-\BeforePackage{bibleref-german}{%
- \csundef{br@Phlm}%
- \csundef{br@Tob}%
- \csundef{br@Sir}%
- \csundef{br@Bar}%
-}
+%\BeforePackage{bibleref-german}{%
+% \csundef{br@Phlm}%
+% \csundef{br@Tob}%
+% \csundef{br@Sir}%
+% \csundef{br@Bar}%
+%}
% these are not in bibleref.sty
\providecommand{\BRadditionsto}{Additionsto}
@@ -477,6 +477,36 @@
\ifboolexpe{ not ( test{\ifnumcomp{`#1}{<}{`0}} or test{\ifnumcomp{`#1}{>}{`9}} ) }%
}
+% \brp@ifcs{token}{true}{false}
+\newcommand*{\brp@ifcs}[1]{%
+ \expandafter\brp@@ifcs\detokenize{#1}aa\brp@endlist
+}
+\def\brp@@ifcs #1#2\brp@endlist{%
+ \ifnumcomp{`#1}{=}{92}%test for backslash
+}
+
+% \brp@expandcs{tokens}
+% Expand all control sequences, but leave active characters as is
+% The result is stored in \brp@expanded
+\newcommand*{\brp@expandcs}[1]{%
+ \let\brp@expanded\@empty
+ \brp@@expandcs #1\brp@endlist
+}
+\newcommand*{\brp@@expandcs}[1]{%
+ \ifx#1\brp@endlist
+ \let\brp@next\@empty
+ \else
+ \brp@ifcs{#1}{%
+ \def\brp@next{\expandafter\brp@@expandcs #1}%
+ }{%
+ \appto\brp@expanded{#1}%
+ \let\brp@next\brp@@expandcs
+ }%
+ \fi
+ \brp@next
+}
+
+
% The main macro:
% \brp@parse{passagedesc}
% This will set \brp@result to a sequence of
@@ -495,6 +525,8 @@
\PackageError{bibleref-parse}{unknown option '##1'}{}%
}}%
\docsvlist{#1}%
+ % expand all control sequences in #2, result in \brp@expanded
+ \brp@expandcs{#2}%
% determine what to do with a comma
\iftoggle{brp@commaauto}{%
\iftoggle{brp@commalikeBR}{%
@@ -505,7 +537,7 @@
}%
}{}%
\iftoggle{brp@commapreferchvsep}{%
- \brp@ifsubstring{:}{#2}{%
+ \brp@ifsubstring{:}{\brp@expanded}{%
\togglefalse{brp@commaischvsep}%
}{%
\toggletrue{brp@commaischvsep}%
@@ -526,7 +558,7 @@
\let\brp@result\@empty
\let\brp@data@book\@empty
% the actual parsing
- \expandafter\brp@parse@book #2\brp@endlist
+ \expandafter\brp@parse@book\brp@expanded\brp@endlist
}
% helper macro to determine if a string has a substring
@@ -551,7 +583,7 @@
\def\brp@parse@book#1{%
\ifx#1\brp@endlist
% reference to a complete book
- \brp@bookname{\brp@data@book}%
+ \expandafter\brp@bookname\expandafter{\brp@data@book}%
\eappto\brp@result{\noexpand\brp@range{\brp@bk}{}{}{}{}}%
\let\brp@nextcom=\@empty
\else
@@ -565,7 +597,7 @@
\let\brp@data@chapterstart=\@empty
\let\brp@data@versestart=\@empty
% skip to verse parsing for one-chapter books
- \brp@bookname{\brp@data@book}%
+ \expandafter\brp@bookname\expandafter{\brp@data@book}%
\def\tempa{Obad}\ifx\tempa\brp@bk
\def\brp@data@chapter{0}\def\brp@nextcom{\brp@parse@verse #1}\else
\def\tempa{Phlm}\ifx\tempa\brp@bk
@@ -581,13 +613,13 @@
}{%
\if;#1%
% reference to a complete book
- \brp@bookname{\brp@data@book}%
+ \expandafter\brp@bookname\expandafter{\brp@data@book}%
\eappto\brp@result{\noexpand\brp@range{\brp@bk}{}{}{}{}}%
\let\brp@data@book\@empty
\let\brp@nextcom\brp@parse@book
\else\if+#1%
% reference to a complete book
- \brp@bookname{\brp@data@book}%
+ \expandafter\brp@bookname\expandafter{\brp@data@book}%
\eappto\brp@result{\noexpand\brp@range{\brp@bk}{}{}{}{}}%
\let\brp@data@book\@empty
\let\brp@nextcom\brp@parse@book
@@ -1102,8 +1134,7 @@
% It should work for all English and German naming variants and their abbreviations.
\def\brp@bookname#1{%
\let\brp@book=\@empty
- \edef\brp@temp{#1}%
- \expandafter\brp@parsebook\brp@temp\brp@endlist
+ \brp@parsebook #1\brp@endlist
}
\def\brp@parsebook#1{%
@@ -1117,7 +1148,7 @@
}%
\let\brp@next\relax
\else
- \if.#1\else
+ \if.#1\relax\else
\appto\brp@book{#1}%
\ifcsdef{brp@bkp@\expandafter\detokenize\expandafter{\brp@book}}{%
\edef\brp@bk{\csuse{brp@bkp@\expandafter\detokenize\expandafter{\brp@book}}}%
@@ -1168,7 +1199,8 @@
\def\brp@convert@clearcache{%
\ifdefempty{\brp@chaplist}{%
\ifdefempty{\brp@verselist}{}{%
- \eappto\brp@brlist{(\brp@chaplist:\brp@verselist)}}%
+ % special handling of one-chapter books
+ \eappto\brp@brlist{(\brp@verselist:)}}%
}{%
\eappto\brp@brlist{(\brp@chaplist:\brp@verselist)}}%
}
@@ -1188,10 +1220,10 @@
}%
\ifstrequal{#2}{0}{%
% special handling for single-chapter books
- \def\brp@startchap{#3}%
- \def\brp@startverse{}%
- \def\brp@endchap{#5}%
- \def\brp@endverse{}%
+ \def\brp@startchap{}%
+ \def\brp@startverse{#3}%
+ \def\brp@endchap{}%
+ \def\brp@endverse{#5}%
}{%
\def\brp@startchap{#2}%
\def\brp@startverse{#3}%
@@ -1246,7 +1278,7 @@
\ifdefempty{\brp@startverse}{%
\ifdefempty{\brp@chaplist}{}{%
% \appto\brp@chaplist{,}
- % due to a bug in bibleref, we need to start a new paren
+ % bibleref syntax requires us to start a new paren
\brp@convert@clearcache
\let\brp@verselist\@empty
\let\brp@chaplist\@empty