summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/bibleref
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-07-01 21:32:47 +0000
committerKarl Berry <karl@freefriends.org>2017-07-01 21:32:47 +0000
commit0792b667fdad9b1d93a69e48afb2b4ac475c3df0 (patch)
treeb51b596b9e120f6d63cd9aeccf41d0e762a98553 /Master/texmf-dist/source/latex/bibleref
parent3a68b1e93b8c444a9dd1307be0fbc648b9e8c572 (diff)
bibleref (1jul17)
git-svn-id: svn://tug.org/texlive/trunk@44737 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/bibleref')
-rw-r--r--Master/texmf-dist/source/latex/bibleref/bibleref.dtx116
1 files changed, 98 insertions, 18 deletions
diff --git a/Master/texmf-dist/source/latex/bibleref/bibleref.dtx b/Master/texmf-dist/source/latex/bibleref/bibleref.dtx
index b7bc3c58a54..72c587eb072 100644
--- a/Master/texmf-dist/source/latex/bibleref/bibleref.dtx
+++ b/Master/texmf-dist/source/latex/bibleref/bibleref.dtx
@@ -105,7 +105,7 @@
% You \textbf{must not} use this syntax:\\
% \texttt{(}\meta{ch}\texttt{:)-(}\meta{ch}\texttt{:)}
%
-% Despite this syntax make a good typesetting, it make a problematic index: the chapter are typeset after the verse contained inside.
+% Despite this syntax make a good typesetting, it make a problematic index: the chapter are typeset after the verses contained inside.
% \end{important}
%
% For the book without chapter (\bibleverse{Ob}; \bibleverse{IJn}; \bibleverse{IIJn}; \bibleverse{Phm}; \bibleverse{Jude}), you must add an empty chapter:
@@ -116,6 +116,24 @@
% \texttt{(}\meta{v}\texttt{-}\meta{v}\texttt{:)}
% With this syntax, the verses would be formatted as if they were chapters.
% \end{important}
+%
+% For the book of Psalms, there is a double numbering: one following the Massoretic Texts, the other one following the Septuagint.
+% Depending on your field, you may use one numbering or the other one.
+% However, you can also provide both numbers.
+% In this case, use the slash (\slash) to separate the two numbers :\\
+% \verb|\bibleverse{Ps}(23/22:)|
+%
+% The alternative number will be, by default, typeset between parenthesis.
+% However, you can redefine the \cs{BRotherchapterstyle} macro to modify the way this number is inserted.
+% For example, to print it in superscript:\\
+%
+% \begin{verbatim}
+% \renewcommand{\BRotherchapterstyle}[1]{\textsuperscript{#1}}
+% \end{verbatim}
+% or to delete it:
+% \begin{verbatim}
+% \renewcommand{\BRotherchapterstyle}[1]{}
+% \end{verbatim}
%\subsection{Examples}
%\begin{center}
%\begin{tabular}{ll}
@@ -123,6 +141,7 @@
%\verb|\bibleverse{Exodus}(20:)| & \bibleverse{Exodus}(20:)\\
%\verb|\bibleverse{Exod}(20:17)| & \bibleverse{Exod}(20:17)\\
%\verb|\bibleverse{Exod}(20-21:)| & \bibleverse{Exod}(20-21:)\\
+%\verb|\bibleverse{Ps}(23/22:)| & \bibleverse{Ps}(23/22:)\\
%\verb|\bibleverse{IICo}(12:21)| & \bibleverse{IICo}(12:21)\\
%\verb|\bibleverse{Ex}(20:17)(21:3)| & \bibleverse{Ex}(20:17)(21:3)\\
%\verb|\bibleverse{Ex}(15:)(17:)(20:)| & \bibleverse{Ex}(15:)(17:)(20:)\\
@@ -531,7 +550,13 @@
\def\@bibleverse(#1:{%
\def\@bv@chidxsort{}%
\def\@bv@chidxentry{}%
- \@br@chsty{#1}%
+ \bv@dbl@ch#1/\@nil%
+ \@br@chsty{\bv@dbl@ch@one}%
+ \ifx\bv@dbl@ch@two\@empty\else%
+ \@bv@dbl@ch@twotrue%
+ \BRotherchapterstyle{\@br@chsty{\bv@dbl@ch@two}}%
+ \@bv@dbl@ch@twofalse%
+ \fi%
\@@bibleverse
}
% \end{macrocode}
@@ -542,7 +567,13 @@
\def\@bibleverser-(#1:{%
\def\@bv@chidxsort{}%
\def\@bv@chidxentry{}%
- \@br@chsty{#1}%
+ \bv@dbl@ch#1/\@nil%
+ \@br@chsty{\bv@dbl@ch@one}%
+ \ifx\bv@dbl@ch@two\@empty\else%
+ \@bv@dbl@ch@twotrue%
+ \BRotherchapterstyle{\@br@chsty{\bv@dbl@ch@two}}%
+ \@bv@dbl@ch@twofalse%
+ \fi%
\@@bibleverse
}
% \end{macrocode}
@@ -942,7 +973,7 @@
% Declare package
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{bibleref}[2016/09/27 1.16 (NLCT and MR)]
+\ProvidesPackage{bibleref}[2017/06/30 1.17 (NLCT and MR)]
% \end{macrocode}
% Need to do some conditional stuff
% \begin{macrocode}
@@ -1016,12 +1047,21 @@
% \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}
+%\changes{1.17}{2017/06/30}{Add syntaxis to use double numbering of the Psalms}
+% \begin{macro}{\BRchapterstyle}
+% The way the alternate chapter number is shown.
+% By default, in parenthesis.
+% \begin{macrocode}
+\newcommand*{\BRotherchapterstyle}[1]{(#1)}%
+% \end{macrocode}
+% \end{macro}
%\begin{macro}{\BRversestyle}
%The style of the verse number.
% By default is simply displays its argument.
@@ -2109,31 +2149,63 @@ defined}{}}}
\ifx\@bv@tmp\@empty
\def\@bv@bvmacro{\@@bibleversenosep}%
\else
- \@br@chsty{#1}%
+ \bv@dbl@ch#1/\@nil%
+ \expandafter\@br@chsty\expandafter{\bv@dbl@ch@one}%
+ \ifx\bv@dbl@ch@two\@empty\else%
+ \@bv@dbl@ch@twotrue%
+ \BRotherchapterstyle{\@br@chsty{\bv@dbl@ch@two}}%
+ \@bv@dbl@ch@twofalse%
+ \fi%
\def\@bv@bvmacro{\@@bibleverse}%
\fi
\@bv@bvmacro
}
% \end{macrocode}
%\end{macro}
+% \begin{macro}{\bv@dbl@ch}
+% This gets the two chapter numbers if there is alternative number (for example \verb+\bibleverse{Ps}(22/23:)+).
+% \begin{macrocode}
+\def\bv@dbl@ch#1/#2\@nil{%
+ \gdef\bv@dbl@ch@one{#1}%
+ \gdef\bv@dbl@ch@two{#2}%
+ \def\bv@dbl@ch@get@two##1/\@nil{%
+ \gdef\bv@dbl@ch@two{##1}%
+ }%
+ \ifx\bv@dbl@ch@two\@empty\else%
+ \expandafter\bv@dbl@ch@get@two\bv@dbl@ch@two\@nil%
+ \fi%
+}%
+% \end{macrocode}
+% \end{macro}
%
+% \begin{macro}{\if@bv@dbl@ch@two}
+% This is set to TRUE before typesetting the alternative number.
+% \begin{macrocode}
+\newif\if@bv@dbl@ch@two%
+% \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
+ \bv@dbl@ch#1/\@nil%
+ \ifx\bv@dbl@ch@one\@empty
\else
- \ifnum\@bv@tmp<10\relax
- \@bv@addtochidxsort{00#1:}%
+ \ifnum\bv@dbl@ch@one<10\relax
+ \@bv@addtochidxsort{00\bv@dbl@ch@one:}%
\else
- \ifnum\@bv@tmp<100\relax
- \@bv@addtochidxsort{0#1:}%
+ \ifnum\bv@dbl@ch@one<100\relax
+ \@bv@addtochidxsort{0\bv@dbl@ch@one:}%
\else
- \@bv@addtochidxsort{#1:}%
+ \@bv@addtochidxsort{\bv@dbl@ch@one:}%
\fi
\fi
- \@bv@do{\protect\BRchapterstyle{#1}}%
+ \@bv@do{\protect\BRchapterstyle{\bv@dbl@ch@one}}%
+ \ifx\bv@dbl@ch@two\@empty\else%
+ \@bv@dbl@ch@twotrue%
+ \BRotherchapterstyle{\@br@chsty{\bv@dbl@ch@two}}%
+ \@bv@dbl@ch@twofalse%
+ \fi%
\fi
\@@bibleverse
}
@@ -2273,7 +2345,11 @@ defined}{}}}
\newtoks\@bv@tmpb
\newcommand*{\@bv@addtoidx}[1]{%
\if@bv@idx
- \@bv@tmpa={#1}%
+ \if@bv@dbl@ch@two%
+ \@bv@tmpa={\protect\BRotherchapterstyle{#1}}%
+ \else%
+ \@bv@tmpa={#1}%
+ \fi%
\@bv@tmpb=\expandafter{\@bv@idxentry}%
\protected@edef\@bv@idxentry{\the\@bv@tmpb\the\@bv@tmpa}%
\fi}
@@ -2287,7 +2363,11 @@ defined}{}}}
\if@bv@idx
\@bv@tmpa={#1}%
\@bv@tmpb=\expandafter{\@bv@chidxsort}%
- \edef\@bv@chidxsort{\the\@bv@tmpb\the\@bv@tmpa}%
+ \if@bv@dbl@ch@two%
+ \edef\@bv@chidxsort{\the\@bv@tmpb}%
+ \else%
+ \edef\@bv@chidxsort{\the\@bv@tmpb\the\@bv@tmpa}%
+ \fi%
\fi
}
% \end{macrocode}
@@ -2823,9 +2903,9 @@ Display chapter range with no verses (no index): \bibleverse{John}(1,3,4-6,8:).
%\fi
%\iffalse
% \begin{macrocode}
-delim_0 "\\dotfill "
-delim_1 "\\dotfill "
-delim_2 "\\dotfill "
+delim_0 "\\dotfill "
+delim_1 "\\dotfill "
+delim_2 "\\dotfill "
% \end{macrocode}
%\fi
%\iffalse