summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/scripture
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-01-08 20:59:42 +0000
committerKarl Berry <karl@freefriends.org>2023-01-08 20:59:42 +0000
commit1145a6875066d3fab5e3bed3817c2ce5213a31c4 (patch)
tree95506a67b779f249f3eb241769e95c30aabbcf64 /Master/texmf-dist/source/latex/scripture
parent820dce948805cb27519a4848c3c5bb66275ac6b9 (diff)
scripture (7jan23)
git-svn-id: svn://tug.org/texlive/trunk@65493 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/scripture')
-rw-r--r--Master/texmf-dist/source/latex/scripture/scripture.dtx667
-rw-r--r--Master/texmf-dist/source/latex/scripture/scripture.ins4
2 files changed, 555 insertions, 116 deletions
diff --git a/Master/texmf-dist/source/latex/scripture/scripture.dtx b/Master/texmf-dist/source/latex/scripture/scripture.dtx
index 7f658465e1e..c54a361a5af 100644
--- a/Master/texmf-dist/source/latex/scripture/scripture.dtx
+++ b/Master/texmf-dist/source/latex/scripture/scripture.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (c) 2022 David Purton <dcpurton@marshwiggle.net>
+% Copyright (c) 2022-2023 David Purton <dcpurton@marshwiggle.net>
%
% This work may be distributed and/or modified under the conditions of
% the LaTeX Project Public License, either version 1.3c of this license
@@ -11,6 +11,7 @@
% version 2005/12/01 or later.
%
%<*driver>
+\DocumentMetadata{}
\documentclass[a4paper]{l3doc}
\usepackage[parindent=1em]{scripture}
\usepackage[skins]{tcolorbox}
@@ -183,10 +184,11 @@
% \changes{v1.0}{2022/07/27}{First public release}
% \changes{v1.1}{2022/08/27}{Bug fixes}
% \changes{v1.2}{2022/11/02}{Bug fixes}
+% \changes{v1.3}{2023/01/08}{Bug fixes}
%
% \title{The \pkg{scripture} package}
% \author{David Purton\thanks{Email: \url{dcpurton@marshwiggle.net}}}
-% \date{2022/11/02 v1.2}
+% \date{2023/01/08 v1.3}
%
% \maketitle
%
@@ -237,6 +239,9 @@
% \env{scripture} environment.
% \end{itemize}
%
+% The \env{poetry} environment uses \cs{obeylines}. This means that it can not
+% be placed in the argument of a macro.
+%
% Some attempt is made to encourage appropriate page breaks, especially just
% before a reference is added to a quotation, but this can still sometimes
% fail and a reference will end up on the following page. Usually a little
@@ -404,6 +409,37 @@
% \end{scripture}
% \end{scriptureexample}
%
+% \changes{v1.3}{2022/11/15}{Add feature to highlight translator added words}
+% \begin{function}[added=2022-11-15]{\added}
+% \begin{syntax}
+% |\added|\marg{words}
+% \end{syntax}
+% Some Bible translations mark out words added for clarity not found in the
+% original language (e.g., in italics). This can be done using the \cs{added}
+% function. The font and format can be set using the \opt{added/font} and
+% \opt{added/format} options.
+% \end{function}
+%
+% \begin{scriptureexample}
+% \begin{verbatim}
+% \begin{scripture}[John 1:18][verse/font=\bfseries,
+% verse/format=#1, verse/sep=0.5em, version=KJV]
+% \vs{18}No man hath seen God at any time, the
+% only begotten Son, which is in the bosom of the
+% Father, he hath declared \added{him}.
+% \end{scripture}
+% \end{verbatim}
+%
+% \tcblower
+%
+% \begin{scripture}[John 1:18][verse/font=\bfseries,
+% verse/format=#1, verse/sep=0.5em, version=KJV]
+% \vs{18}No man hath seen God at any time, the
+% only begotten Son, which is in the bosom of the
+% Father, he hath declared \added{him}.
+% \end{scripture}
+% \end{scriptureexample}
+%
% \changes{v1.2}{2022/09/01}{Add divine name feature}
% \begin{function}[added=2022-09-01]{\name, \LORD, \GOD}
% \begin{syntax}
@@ -424,29 +460,40 @@
% \begin{scriptureexample}
% \begin{verbatim}
% \begin{scripture}[Genesis 15:1--2][version=ESV]
-% \ch{15}After these things the word of the
-% \name{Lord} came to Abram in a vision: “Fear not,
-% Abram, I am your shield; your reward shall be
-% very great.” \vs{2}But Abram said, “O Lord
-% \name{God}, what will you give me, for I continue
-% childless, and the heir of my house is Eliezer of
-% Damascus?”
+% \ch{15}After these things the word of the
+% \name{Lord} came to Abram in a vision: ``Fear
+% not, Abram, I am your shield; your reward shall
+% be very great.'' \vs{2}But Abram said, ``O Lord
+% \name{God}, what will you give me, for I
+% continue childless, and the heir of my house is
+% Eliezer of Damascus?''
% \end{scripture}
% \end{verbatim}
%
% \tcblower
%
% \begin{scripture}[Genesis 15:1--2][version=ESV]
-% \ch{15}After these things the word of the
-% \name{Lord} came to Abram in a vision: “Fear not,
-% Abram, I am your shield; your reward shall be
-% very great.” \vs{2}But Abram said, “O Lord
-% \name{God}, what will you give me, for I continue
-% childless, and the heir of my house is Eliezer of
-% Damascus?”
+% \ch{15}After these things the word of the
+% \name{Lord} came to Abram in a vision: ``Fear
+% not, Abram, I am your shield; your reward shall
+% be very great.'' \vs{2}But Abram said, ``O Lord
+% \name{God}, what will you give me, for I
+% continue childless, and the heir of my house is
+% Eliezer of Damascus?''
% \end{scripture}
% \end{scriptureexample}
%
+% \changes{v1.3}{2022/11/13}{Add \cs{nofirstverse} function}
+% \begin{function}[added=2022-11-13]{\nofirstverse}
+% \begin{syntax}
+% |\nofirstverse|
+% \end{syntax}
+% When \opt{verse/first} is |true|, this causes the next \cs{vs} to print
+% normally, rather than using the format specified by
+% \opt{verse/firstformat}. You might do this if your quote begins half way
+% through a paragraph and the first verse should be printed normally.
+% \end{function}
+%
% \begin{function}{\nohang}
% \begin{syntax}
% |\nohang|
@@ -514,7 +561,7 @@
% they asked him.
%
% \redletteron `Yes,' \redletteroff replied Jesus,
-% \redletteron ‘have you
+% \redletteron `have you
% never read,
% \begin{poetry}
% `\thinspace ``From the lips of children and infants
@@ -533,7 +580,7 @@
% they asked him.
%
% \redletteron `Yes,' \redletteroff replied Jesus,
-% \redletteron ‘have you
+% \redletteron `have you
% never read,
% \begin{poetry}
% `\thinspace ``From the lips of children and infants
@@ -639,6 +686,50 @@
% \end{scripture}
% \end{scriptureexample}
%
+% \changes{v1.3}{2023/01/07}{Add \cs{textscripture} function}
+% \begin{function}[added=2023-01-07]{\textscripture}
+% \begin{syntax}
+% |\textscripture|\oarg{reference}\oarg{options}\marg{quotation}
+% \end{syntax}
+% \cs{textscripture} sets an inline scripture quotation. The quotation is
+% surrounded be the values of \opt{inline/begin} and \opt{inline/end} which
+% default to |``\,| and |\,''|, respectively. This function also changes the
+% defaults of some options as follows:
+% \begin{itemize}
+% \item \opt{compact} is set
+% \item \opt{reference/align} is set to |inline|
+% \item \opt{reference/sep} is set to |0.5em|
+% \item \opt{reference/format} is set to |(#1)|
+% \item \opt{version/format} is set to |#1|
+% \end{itemize}
+%
+% This function is equivalent to using the \env{scripture} environment with
+% the \opt{inline} option.
+%
+% \textbf{Warning:} \cs{par} is redefined to \cs{relax} inside the
+% \cs{textscripture} function. If you have anything other than expected
+% macros and environments inside your \cs{textscripture} function \TeX{}
+% will likely get stuck in an infinite loop.
+% \end{function}
+%
+% \begin{scriptureexample}
+% \begin{verbatim}
+% A famous verse in the Bible is:
+% \textscripture[John 3:16][verse/hide]{\vs{16}For
+% God so loved the world that he gave his one and
+% only Son, that whoever believes in him shall not
+% perish but have eternal life.}.
+% \end{verbatim}
+%
+% \tcblower
+%
+% A famous verse in the Bible is:
+% \textscripture[John 3:16][verse/hide]{\vs{16}For
+% God so loved the world that he gave his one and
+% only Son, that whoever believes in him shall not
+% perish but have eternal life.}.
+% \end{scriptureexample}
+%
% \begin{function}{\vs}
% \begin{syntax}
% |\vs|\marg{verse number}
@@ -714,7 +805,7 @@
%
% \begin{flushright}[aboveskip = 0pt]
% For the mouth of the \name{Lord} \\
-% has spoken.’
+% has spoken.'
% \end{flushright}
% \end{scripture}
% \end{verbatim}
@@ -729,7 +820,7 @@
%
% \begin{flushright}[aboveskip = 0pt]
% For the mouth of the \name{Lord} \\
-% has spoken.’
+% has spoken.'
% \end{flushright}
% \end{scripture}
% \end{scriptureexample}
@@ -1041,6 +1132,8 @@
% \subsection{Options}
% \label{options}
%
+% \changes{v1.3}{2023/01/08}{Remove \opt{reference/delim} option}
+%
% Default formatting \meta{|options|} can be set using
% \cs{usepackage}|[|\meta{|options|}|]{scripture}| or
% \cs{scripturesetup}|{|\meta{|options|}|}|. Local formatting \meta{|options|}
@@ -1060,6 +1153,24 @@
% \meta{|skip|} inserted above the \env{scripture} environment.
% \end{option}
%
+% \changes{v1.3}{2022/11/15}{Add \opt{added/font} option}
+% \begin{option}[added=2022-11-15]{added/font}
+% \begin{syntax}
+% added/font = \meta{font} \hfill Default: \emph{Empty}
+% \end{syntax}
+% \meta{|font|} used for the \cs{added} function.
+% \end{option}
+%
+% \changes{v1.3}{2022/11/15}{Add \opt{added/format} option}
+% \begin{option}[added=2022-11-15]{added/format}
+% \begin{syntax}
+% added/format = \meta{macro} \hfill Default: \cs{emph}\{\#1\}
+% \end{syntax}
+% \meta{|macro|} used to format the words that should be highlighted as
+% added by the translators using the \cs{added} function. |#1| contains the
+% text of the argument to \cs{added}.
+% \end{option}
+%
% \begin{option}{belowskip}
% \begin{syntax}
% belowskip = \meta{skip} \hfill Default: 0pt
@@ -1188,6 +1299,34 @@
% the opposite of \opt{chapter/hide}.
% \end{option}
%
+% \changes{v1.1}{2022/11/14}{Add \opt{chapter/showverse} option}
+% \begin{option}[added=2022-11-14]{chapter/showverse}
+% \begin{syntax}
+% chapter/showverse = \meta{boolean} \hfill Default: false
+% \end{syntax}
+% Whether \cs{vs}|\{1\}| should be automatically inserted after \cs{ch}. The
+% value of \meta{|boolean|} is optional and assumed to be \val{true} if not
+% present. See also \opt{midparachap/showverse} and
+% \opt{midparachap/hideverse}. Note that \opt{chapter/showverse} take
+% precedence over \opt{midparachap/hideverse}.
+% \end{option}
+%
+% \begin{scriptureexample}
+% \begin{verbatim}
+% \begin{scripture}[John 1:1][chapter/showverse]
+% \ch{1}In the beginning was the Word, and the
+% Word was with God, and the Word was God.
+% \end{scripture}
+% \end{verbatim}
+%
+% \tcblower
+%
+% \begin{scripture}[John 1:1][chapter/showverse]
+% \ch{1}In the beginning was the Word, and the
+% Word was with God, and the Word was God.
+% \end{scripture}
+% \end{scriptureexample}
+%
% \changes{v1.2}{2022/08/31}{Add \opt{colour} option}
% \begin{option}[added=2022-08-31]{colour, color}
% \begin{syntax}
@@ -1267,6 +1406,48 @@
% \meta{|font|} used for the \env{scripture} environment.
% \end{option}
%
+% \changes{v1.3}{2023/01/07}{Add \opt{inline} option}
+% \begin{option}[added=2023-01-07]{inline}
+% \begin{syntax}
+% inline
+% \end{syntax}
+% Set the scripture quotation inline. The quotation is surrounded be the
+% values of \opt{inline/begin} and \opt{inline/end} which default to |``\,|
+% and |\,''|, respectively. This option also changes the defaults of some
+% other options as follows:
+% \begin{itemize}
+% \item \opt{compact} is set
+% \item \opt{reference/align} is set to |inline|
+% \item \opt{reference/sep} is set to |0.5em|
+% \item \opt{reference/format} is set to |(#1)|
+% \item \opt{version/format} is set to |#1|
+% \end{itemize}
+%
+% \textbf{Warning:} \cs{par} is redefined to \cs{relax} when the
+% \opt{inline} option is set. If you have anything other than expected
+% macros and environments inside your quotation \TeX{} will likely get stuck
+% in an infinite loop.
+% \end{option}
+%
+% \changes{v1.3}{2023/01/07}{Add \opt{inline/begin} option}
+% \begin{option}[added=2023-01-07]{inline/begin}
+% \begin{syntax}
+% inline/begin = \meta{text} \hfill Default: |``\,|
+% \end{syntax}
+% Text inserted at the beginning of \cs{textscripture} or a \env{scripture}
+% environment with the \opt{inline} option set.
+% \end{option}
+%
+% \changes{v1.3}{2023/01/07}{Add \opt{inline/end} option}
+% \begin{option}[added=2023-01-07]{inline/end}
+% \begin{syntax}
+% inline/end = \meta{text} \hfill Default: |\,''|
+% \end{syntax}
+% Text inserted between the end of \cs{textscripture} or a \env{scripture}
+% environment with the \opt{inline} option set and the \meta{|reference|}
+% (if specified).
+% \end{option}
+%
% \begin{option}{indent}
% \begin{syntax}
% indent = \meta{boolean} \hfill Default: true
@@ -1394,6 +1575,15 @@
% is an alias for \opt{redletter/colour}.
% \end{option}
%
+% \changes{v1.3}{2023/01/08}{Add \opt{reference/align} option}
+% \begin{option}[added=2023-01-08]{reference/align}
+% \begin{syntax}
+% reference/align = inline \textbar\ left \textbar\ right \hfill Default: right
+% \end{syntax}
+% Set the alignment of the reference. For |left| and |right| the reference
+% will not break across lines, but a line break is permitted for |inline|.
+% \end{option}
+%
% \changes{v1.2}{2022/09/07}{Add \opt{reference/colour} option}
% \begin{option}[added=2022-09-07]{reference/colour, reference/color}
% \begin{syntax}
@@ -1404,14 +1594,6 @@
% \opt{reference/color} is an alias for \opt{reference/colour}.
% \end{option}
%
-% \begin{option}{reference/delim}
-% \begin{syntax}
-% reference/delim = \meta{delim} \hfill Default: \cs{hfill}
-% \end{syntax}
-% \meta{|delim|} to use between the \env{scripture} quotation and its
-% \val{reference}.
-% \end{option}
-%
% \begin{option}{reference/font}
% \begin{syntax}
% reference/font = \meta{font} \hfill Default: \cs{bfseries}
@@ -1425,7 +1607,19 @@
% reference/format = \meta{macro} \hfill Default: \#1
% \end{syntax}
% \meta{|macro|} used to format the \val{reference} for a \env{scripture}
-% quotation. |#1| contains the text of the \val{reference}.
+% quotation. |#1| contains the text of the \val{reference} and \val{version}
+% (if specified).
+% \end{option}
+%
+% \changes{v1.3}{2023/01/08}{Add \opt{reference/newline} option}
+% \begin{option}[added=2023-01-8]{reference/newline}
+% \begin{syntax}
+% reference/newline
+% \end{syntax}
+% Always push the \val{reference} to a newline even if there is space for it
+% to fit on the last line of the quotation. The option sets
+% \opt{reference/sep} to \cs{linewidth} so there is never room for the
+% reference on the final line of the quotation.
% \end{option}
%
% \begin{option}{reference/sep}
@@ -1495,6 +1689,75 @@
% for \opt{verse/colour}.
% \end{option}
%
+% \changes{v1.3}{2022/11/13}{Add \opt{verse/first} option}
+% \begin{option}[added=2022-11-13]{verse/first}
+% \begin{syntax}
+% verse/first = \meta{boolean} \hfill Default: false
+% \end{syntax}
+% In prose sections, print the verse number in a different format if it is
+% at the start of the paragraph. The format and separation between verse and
+% text are controlled with the \opt{verse/firstformat} and
+% \opt{verse/firstsep} options. Use \cs{noversefirst} to suppress this at
+% the next verse (e.g., if your quote starts mid-way though a paragraph and
+% a normal verse should be printed). The value of \meta{|boolean|} is optional
+% and assumed to be true if not present.
+% \end{option}
+%
+% \begin{scriptureexample}
+% \begin{verbatim}
+% \begin{scripture}[Luke 18:25--28][noindent,
+% verse/first, version=NRSV]
+% \nofirstverse\vs{25}Indeed, it is easier for a
+% camel to go through the eye of a needle than for
+% someone who is rich to enter the kingdom of
+% God.''
+%
+% \vs{26}Those who heard it said, ``Then who can
+% be saved?'' \vs{27}He replied, ``What is
+% impossible for mortals is possible for God.''
+%
+% \vs{28}Then Peter said, ``Look, we have left our
+% homes and followed you.''
+% \end{scripture}
+% \end{verbatim}
+%
+% \tcblower
+%
+% \begin{scripture}[Luke 18:25--28][noindent,
+% verse/first, version=NRSV]
+% \nofirstverse\vs{25}Indeed, it is easier for a
+% camel to go through the eye of a needle than for
+% someone who is rich to enter the kingdom of
+% God.''
+%
+% \vs{26}Those who heard it said, ``Then who can
+% be saved?'' \vs{27}He replied, ``What is
+% impossible for mortals is possible for God.''
+%
+% \vs{28}Then Peter said, ``Look, we have left our
+% homes and followed you.''
+% \end{scripture}
+% \end{scriptureexample}
+%
+% \changes{v1.3}{2022/11/13}{Add \opt{verse/firstformat} option}
+% \begin{option}[added=2022-11-13]{verse/firstformat}
+% \begin{syntax}
+% verse/firstformat = \meta{macro} \hfill Default: \#1
+% \end{syntax}
+% \meta{|macro|} used to format the first \cs{vs} in a paragraph. |#1|
+% contains the argument of \cs{vs}. Only used if \opt{verse/first} is
+% |true|.
+% \end{option}
+%
+% \changes{v1.3}{2022/11/13}{Add \opt{verse/firstsep} option}
+% \begin{option}[added=2022-11-13]{verse/firstsep}
+% \begin{syntax}
+% verse/firstsep = \meta{dimen} \hfill Default: 0.5em
+% \end{syntax}
+% \meta{|dimen|} used to separate the first \cs{vs} in a paragraph from the
+% following text. Only used if \opt{verse/first} is |true|.
+% \end{option}
+%
% \begin{option}{verse/font}
% \begin{syntax}
% verse/font = \meta{font} \hfill Default: \emph{Empty}
@@ -1719,7 +1982,7 @@
% \env{poetry} environments. \cs{extraskip} begins a new paragraph in a
% \env{poetry} environment. The value of \meta{|boolean|} is optional and
% assumed to be \val{true} if not present. This option is the opposite of
-% \opt{midparachap/showverse}.
+% \opt{midparachap/showverse}. See also \opt{chapter/showverse}.
% \end{option}
%
% \begin{scriptureexample}
@@ -1773,7 +2036,7 @@
% \env{poetry} environments. \cs{extraskip} begins a new paragraph in a
% \env{poetry} environment. The value of \meta{|boolean|} is optional and
% assumed to be \val{true} if not present. This option is the opposite of
-% \opt{midparachap/hideverse}.
+% \opt{midparachap/hideverse}. See also \opt{chapter/showverse}.
% \end{option}
%
% \subsubsection{Options for the \env{narrow} environment}
@@ -1880,7 +2143,7 @@
% agreement with this, as it is written:
% \begin{poetry}
% \vs{16}`\thinspace``After this I will return
-% and rebuild David’s fallen tent.
+% and rebuild David's fallen tent.
%
% Its ruins I will rebuild,
% and I will restore it,
@@ -1902,7 +2165,7 @@
% agreement with this, as it is written:
% \begin{poetry}
% \vs{16}`\thinspace``After this I will return
-% and rebuild David’s fallen tent.
+% and rebuild David's fallen tent.
%
% Its ruins I will rebuild,
% and I will restore it,
@@ -1949,7 +2212,7 @@
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[2022-06-01]
-\ProvidesExplPackage{scripture}{2022/11/02}{1.2}
+\ProvidesExplPackage{scripture}{2023/01/08}{1.3}
{Format Scripture Quotations (DCP)}
% \end{macrocode}
%
@@ -1994,6 +2257,12 @@
, aboveskip .tl_set:N = \l_@@_aboveskip_tl
, aboveskip .value_required:n = true
, aboveskip .initial:n = \c_zero_skip
+ , added / font .tl_set:N = \l_@@_added_font_tl
+ , added / font .value_required:n = true
+ , added / font .initial:n =
+ , added / format .cs_set:Np = \@@_added_format:n #1
+ , added / format .value_required:n = true
+ , added / format .initial:n = \emph { #1 }
, belowskip .tl_set:N = \l_@@_belowskip_tl
, belowskip .value_required:n = true
, belowskip .initial:n = \c_zero_skip
@@ -2027,6 +2296,9 @@
, chapter / show .bool_set:N = \l_@@_chap_show_bool
, chapter / show .default:n = true
, chapter / show .initial:n = true
+ , chapter / showverse .bool_set:N = \l_@@_chap_show_verse_bool
+ , chapter / showverse .default:n = true
+ , chapter / showverse .initial:n = false
, extraskip .tl_set:N = \l_@@_extraskip_tl
, extraskip .value_required:n = true
, extraskip .initial:n = \medskipamount
@@ -2036,6 +2308,23 @@
, indent .bool_set:N = \l_@@_indent_bool
, indent .default:n = true
, indent .initial:n = true
+ , _inline .bool_set:N = \l_@@_inline_bool
+ , _inline .initial:n = false
+ , inline .meta:n = {
+ _inline = true ,
+ compact ,
+ reference / format = (##1) ,
+ reference / align = inline ,
+ reference / sep = 0.5 em,
+ version / format = ##1
+ }
+ , inline .value_forbidden:n = true
+ , inline / begin .tl_set:N = \l_@@_inline_begin_tl
+ , inline / begin .value_required:n = true
+ , inline / begin .initial:n = ``\,
+ , inline / end .tl_set:N = \l_@@_inline_end_tl
+ , inline / end .value_required:n = true
+ , inline / end .initial:n = \,''
, language .tl_set:N = \l_@@_language_tl
, language .value_required:n = true
, language .initial:n =
@@ -2066,19 +2355,26 @@
, redletter / colour .value_required:n = true
, redletter / colour .initial:n = red!80!black
, redletter / color .meta:n = { redletter / colour = { #1 } }
+ , reference / align .choices:nn = { inline, left, right }
+ {
+ \tl_if_exist:NF \l_@@_ref_align_tl
+ { \tl_new:N \l_@@_ref_align_tl }
+ \tl_set_eq:NN \l_@@_ref_align_tl \l_keys_choice_tl
+ }
+ , reference / align .value_required:n = true
+ , reference / align .initial:n = right
, reference / colour .tl_set:N = \l_@@_ref_colour_tl
, reference / colour .value_required:n = true
, reference / colour .initial:n = .
, reference / color .meta:n = { reference / colour = { #1 } }
- , reference / delim .tl_set:N = \l_@@_ref_delim_tl
- , reference / delim .value_required:n = true
- , reference / delim .initial:n = \hfill
, reference / font .tl_set:N = \l_@@_ref_font_tl
, reference / font .value_required:n = true
, reference / font .initial:n = \bfseries
, reference / format .cs_set:Np = \@@_ref_format:n #1
, reference / format .value_required:n = true
, reference / format .initial:n = #1
+ , reference / newline .meta:n = { reference / sep = \linewidth }
+ , reference / newline .value_forbidden:n = true
, reference / sep .tl_set:N = \l_@@_ref_sep_tl
, reference / sep .value_required:n = true
, reference / sep .initial:n = 2 em
@@ -2104,6 +2400,15 @@
, verse / colour .value_required:n = true
, verse / colour .initial:n = .
, verse / color .meta:n = { verse / colour = { #1 } }
+ , verse / first .bool_set:N = \l_@@_verse_first_bool
+ , verse / first .default:n = true
+ , verse / first .initial:n = false
+ , verse / firstformat .cs_set:Np = \@@_verse_first_format:n #1
+ , verse / firstformat .value_required:n = true
+ , verse / firstformat .initial:n = #1
+ , verse / firstsep .tl_set:N = \l_@@_verse_first_sep_tl
+ , verse / firstsep .value_required:n = true
+ , verse / firstsep .initial:n = 0.5em
, verse / font .tl_set:N = \l_@@_verse_font_tl
, verse / font .value_required:n = true
, verse / font .initial:n =
@@ -2234,7 +2539,7 @@
\ProcessKeyOptions
% \end{macrocode}
%
-% \subsection{hooks}
+% \subsection{Hooks}
%
% \begin{hooks}{scripture/chap/before, scripture/chap/after,
% scripture/verse/before, scripture/verse/after}
@@ -2278,7 +2583,7 @@
\g_@@_chap_par_prevgraf_int = 1
{
\dim_compare:nNnT
- { \parskip + \l_@@_extraskip_tl } < \baselineskip
+ { \parskip + \glueexpr \l_@@_extraskip_tl } < \baselineskip
{
\addvspace { \baselineskip }
}
@@ -2343,14 +2648,17 @@
\l_@@_ref_font_tl
\str_if_eq:VnF \l_@@_ref_colour_tl { . }
{ \exp_args:NV \color_select:n \l_@@_ref_colour_tl }
- \@@_ref_format:n { #1 }
+ \@@_ref_format:n
+ {
+ #1
% \end{macrocode}
% Append a Bible version if it has been specified.
% \begin{macrocode}
- \tl_if_empty:NF \l_@@_version_tl
- {
- \l_@@_version_delim_tl
- \@@_version_format:n { \l_@@_version_tl }
+ \tl_if_empty:NF \l_@@_version_tl
+ {
+ \l_@@_version_delim_tl
+ \@@_version_format:n { \l_@@_version_tl }
+ }
}
\group_end:
}
@@ -2385,7 +2693,17 @@
% \begin{macrocode}
\int_compare:nNnT \prevgraf = \c_zero_int
{ \skip_vertical:n { -\baselineskip } }
- \l_@@_ref_delim_tl
+ \tl_if_eq:NnT \l_@@_ref_align_tl { right }
+ { \hfill }
+ \tl_if_eq:NnT \l_@@_ref_align_tl { left }
+ {
+ \mode_leave_vertical:
+ \dim_compare:nNnT
+ { \box_wd:N \l_@@_ref_box + \g_@@_final_line_dim + \l_@@_ref_sep_tl }
+ <
+ \linewidth
+ { \skip_horizontal:n { \g_@@_final_line_dim + \l_@@_ref_sep_tl } }
+ }
\box_use:N \l_@@_ref_box
}
% \end{macrocode}
@@ -2399,7 +2717,7 @@
\bool_new:N \g_@@_red_letter_active_bool
% \end{macrocode}
% \end{macro}
-
+%
% \begin{macro}{\@@_red_letter_on:}
% Mark the beginning of a section of text attributed to Jesus Christ.
% \begin{macrocode}
@@ -2607,6 +2925,10 @@
\box_use:N \l_@@_chap_box
\hook_use:n { scripture / chap / after }
\group_end:
+ \bool_if:NT \l_@@_chap_show_verse_bool
+ {
+ \@@_verse_output:n { 1 }
+ }
}
% \end{macrocode}
% \end{macro}
@@ -2630,6 +2952,10 @@
\group_end:
\skip_horizontal:N \l_@@_chap_sep_tl
\hook_use:n { scripture / chap / after }
+ \bool_if:NT \l_@@_chap_show_verse_bool
+ {
+ \@@_verse_output:n { 1 }
+ }
}
{
\hook_use:n { scripture / chap / before }
@@ -2683,14 +3009,38 @@
%
% \subsubsection{Formatting and printing verse numbers}
%
+% \begin{macro}{\l_@@_verse_par_start_bool}
+% Flag for whether the current verse is at the start of a paragraph.
+% \begin{macrocode}
+\bool_new:N \l_@@_verse_par_start_bool
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l_@@_no_verse_first_bool}
+% Suppress the next verse from formatting differently if it begins a new
+% paragraph.
+% \begin{macrocode}
+\bool_new:N \l_@@_no_verse_first_bool
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\@@_verse_output:n}
% Output a formatted verse.
% \begin{macrocode}
\cs_new_protected:Nn \@@_verse_output:n
{
\cs_gset_nopar:Npn \scripturecurrentverse { #1 }
- \mode_if_vertical:T
+ \legacy_if:nTF { @endpe }
+ { \bool_set_false:N \l_@@_verse_par_start_bool }
+ { \bool_set_true:N \l_@@_verse_par_start_bool }
+ \mode_if_vertical:TF
{ \mode_leave_vertical: }
+ { \bool_set_false:N \l_@@_verse_par_start_bool }
+ \bool_if:NT \l_@@_no_verse_first_bool
+ {
+ \bool_set_false:N \l_@@_verse_par_start_bool
+ \bool_set_false:N \l_@@_no_verse_first_bool
+ }
\group_begin:
\hook_use:n { scripture / verse / before }
\bool_if:NT \l_@@_verse_show_bool
@@ -2699,9 +3049,22 @@
\l_@@_verse_font_tl
\str_if_eq:VnF \l_@@_verse_colour_tl { . }
{ \exp_args:NV \color_select:n \l_@@_verse_colour_tl }
- \@@_verse_format:n { #1 }
- \group_end:
- \kern \l_@@_verse_sep_tl
+ \bool_lazy_all:nTF
+ {
+ { \l_@@_verse_first_bool }
+ { \l_@@_verse_par_start_bool }
+ { \bool_not_p:n { \str_if_eq_p:Vn \l_@@_currenvir_str { poetry } } }
+ }
+ {
+ \@@_verse_first_format:n { #1 }
+ \group_end:
+ \kern \l_@@_verse_first_sep_tl
+ }
+ {
+ \@@_verse_format:n { #1 }
+ \group_end:
+ \kern \l_@@_verse_sep_tl
+ }
}
\hook_use:n { scripture / verse / after }
\group_end:
@@ -2840,6 +3203,13 @@
\cs_set_eq:NN \redletteron \@@_red_letter_on:
\cs_set_eq:NN \redletteroff \@@_red_letter_off:
\cs_set_eq:NN \vs \@@_verse_output:n
+ \cs_set_protected_nopar:Npn \added ##1
+ {
+ \group_begin:
+ \l_@@_added_font_tl
+ \@@_added_format:n { ##1 }
+ \group_end:
+ }
\cs_set_protected_nopar:Npn \name ##1
{
\group_begin:
@@ -2847,6 +3217,10 @@
\@@_name_format:n { ##1 }
\group_end:
}
+ \cs_set_protected_nopar:Npn \nofirstverse
+ {
+ \bool_set_true:N \l_@@_no_verse_first_bool
+ }
\cs_set_protected_nopar:Npn \LORD
{
\name { Lord }
@@ -2906,6 +3280,8 @@
{ \para_omit_indent: }
}
}
+ \bool_if:NT \l_@@_inline_bool
+ { \l_@@_inline_begin_tl }
}
% \end{macrocode}
% \end{macro}
@@ -2915,6 +3291,21 @@
% \begin{macrocode}
\cs_new_protected:Nn \@@_end:n
{
+ \tl_if_eq:NnTF \l_@@_ref_align_tl { inline }
+ {
+ \bool_lazy_or:nnF
+ { \tl_if_novalue_p:n { #1 } }
+ { \tl_if_empty_p:n { #1 } }
+ {
+ \unskip
+ \@@_red_letter_off:
+ \bool_if:NT \l_@@_inline_bool
+ { \l_@@_inline_end_tl }
+ \skip_horizontal:N \l_@@_ref_sep_tl
+ \@@_format_full_ref:n { #1 }
+ }
+ }
+ {
% \end{macrocode}
% Normally \cs{unskip} does not work in vertical mode, but there are some
% situations where it does work. The following condition is true if the
@@ -2922,66 +3313,67 @@
% environments. This removes any unwanted \opt{belowskip} if present and
% leaves the previously calculated line length of the final paragraph intact.
% \begin{macrocode}
- \@@_red_letter_off:
- \mode_if_vertical:TF
- {
- \unskip
- \unskip
- }
- {
- \tl_if_novalue:nTF { #1 }
- { \int_zero:N \postdisplaypenalty }
- { \int_set_eq:NN \postdisplaypenalty \@highpenalty }
- \@@_calc_final_line_length:
- }
+ \mode_if_vertical:TF
+ {
+ \unskip
+ \unskip
+ }
+ {
+ \tl_if_novalue:nTF { #1 }
+ { \int_zero:N \postdisplaypenalty }
+ { \int_set_eq:NN \postdisplaypenalty \@highpenalty }
+ \@@_calc_final_line_length:
+ }
% \end{macrocode}
% Restore left margin by resetting the \cs{parshape} if in a list
% based environment, otherwise the space required for the reference is
% incorrectly calculated.
% \begin{macrocode}
- \bool_lazy_or:nnTF
- { \dim_compare_p:n { \l_@@_leftmargin_tl > 0pt } }
- { \dim_compare_p:n { \l_@@_rightmargin_tl > 0pt } }
- {
- \dim_add:Nn \linewidth \l_@@_leftmargin_tl
- \int_compare:nNnT
- \@listdepth > \c_zero_int
- {
- \dim_sub:Nn \@totalleftmargin \l_@@_leftmargin_tl
- \parshape 1 ~ \@totalleftmargin ~ \linewidth
- }
- }
- { \parshape 1 ~ \@totalleftmargin ~ \linewidth }
- \bool_lazy_or:nnF
- { \tl_if_novalue_p:n { #1 } }
- { \tl_if_empty_p:n { #1 } }
- { \@@_reference:n { #1 } }
- \par
+ \bool_lazy_or:nnTF
+ { \dim_compare_p:n { \l_@@_leftmargin_tl > 0pt } }
+ { \dim_compare_p:n { \l_@@_rightmargin_tl > 0pt } }
+ {
+ \dim_add:Nn \linewidth \l_@@_leftmargin_tl
+ \int_compare:nNnT
+ \@listdepth > \c_zero_int
+ {
+ \dim_sub:Nn \@totalleftmargin \l_@@_leftmargin_tl
+ \parshape 1 ~ \@totalleftmargin ~ \linewidth
+ }
+ }
+ { \parshape 1 ~ \@totalleftmargin ~ \linewidth }
+ \@@_red_letter_off:
+ \bool_lazy_or:nnF
+ { \tl_if_novalue_p:n { #1 } }
+ { \tl_if_empty_p:n { #1 } }
+ { \@@_reference:n { #1 } }
+ \par
% \end{macrocode}
% Restore right margin by resetting the \cs{parshape} if in a \LaTeX{} list
% based environment, since only the left margin was restored above.
% \begin{macrocode}
- \bool_lazy_or:nnT
- { \dim_compare_p:n { \l_@@_leftmargin_tl > 0pt } }
- { \dim_compare_p:n { \l_@@_rightmargin_tl > 0pt } }
- {
- \int_compare:nNnT
- \@listdepth > \c_zero_int
- {
- \dim_add:Nn \linewidth \l_@@_rightmargin_tl
- \parshape 1 ~ \@totalleftmargin ~ \linewidth
- }
- }
- \dim_compare:nNnTF
- \l_@@_belowskip_tl > \parskip
- {
- \addvspace
- {
- \skip_eval:n { \l_@@_belowskip_tl - \parskip }
- }
- }
- {
- \addvspace { \l_@@_belowskip_tl }
+ \bool_lazy_or:nnT
+ { \dim_compare_p:n { \l_@@_leftmargin_tl > 0pt } }
+ { \dim_compare_p:n { \l_@@_rightmargin_tl > 0pt } }
+ {
+ \int_compare:nNnT
+ \@listdepth > \c_zero_int
+ {
+ \dim_add:Nn \linewidth \l_@@_rightmargin_tl
+ \parshape 1 ~ \@totalleftmargin ~ \linewidth
+ }
+ }
+ \dim_compare:nNnTF
+ { \glueexpr \l_@@_belowskip_tl } > \parskip
+ {
+ \addvspace
+ {
+ \skip_eval:n { \l_@@_belowskip_tl - \parskip }
+ }
+ }
+ {
+ \addvspace { \l_@@_belowskip_tl }
+ }
}
}
% \end{macrocode}
@@ -3034,7 +3426,7 @@
}
{
\dim_compare:nTF
- { \parskip >= \l_@@_center_aboveskip_tl > \c_zero_skip }
+ { \parskip >= \glueexpr \l_@@_center_aboveskip_tl > \c_zero_skip }
{
\skip_zero:N \topsep
\skip_zero:N \l_@@_delta_below_skip
@@ -3108,7 +3500,7 @@
}
{
\dim_compare:nTF
- { \parskip >= \l_@@_flushright_aboveskip_tl > \c_zero_skip }
+ { \parskip >= \glueexpr \l_@@_flushright_aboveskip_tl > \c_zero_skip }
{
\skip_zero:N \topsep
\skip_zero:N \l_@@_delta_below_skip
@@ -3225,6 +3617,10 @@
\box_use:N \l_@@_chap_box
\hook_use:n { scripture / chap / after }
\group_end:
+ \bool_if:NT \l_@@_chap_show_verse_bool
+ {
+ \@@_verse_output:n { 1 }
+ }
\hook_gput_next_code:nn { para / begin }
{ \parshape 1 ~ \@totalleftmargin ~ \linewidth }
}
@@ -3296,7 +3692,7 @@
}
{
\dim_compare:nTF
- { \parskip >= \l_@@_hanging_aboveskip_tl > \c_zero_skip }
+ { \parskip >= \glueexpr \l_@@_hanging_aboveskip_tl > \c_zero_skip }
{
\skip_zero:N \topsep
\skip_zero:N \l_@@_delta_below_skip
@@ -3482,6 +3878,13 @@
{ scripture / midparachap }
{ #1 }
}
+ \bool_lazy_and:nnT
+ { \bool_if_p:n \l_@@_chap_show_verse_bool }
+ { \bool_if_p:n \l_@@_chap_drop_bool }
+ {
+ \bool_set_true:N \l_@@_midparachap_show_verse_bool
+ \bool_set_false:N \l_@@_chap_show_verse_bool
+ }
\par
\bool_set_true:N \l_@@_mid_para_chap_bool
\@@_vbox_set_top:Nw \l_@@_mid_para_chap_box
@@ -3602,7 +4005,7 @@
}
{
\dim_compare:nTF
- { \parskip >= \l_@@_narrow_aboveskip_tl > \c_zero_skip }
+ { \parskip >= \glueexpr \l_@@_narrow_aboveskip_tl > \c_zero_skip }
{
\skip_zero:N \topsep
\skip_zero:N \l_@@_delta_below_skip
@@ -3882,7 +4285,9 @@
\box_use:N \l_@@_chap_box
\hook_use:n { scripture / chap / after }
\group_end:
- \bool_if:NT \g_@@_poetry_midparachap_show_verse_bool
+ \bool_lazy_or:nnT
+ { \bool_if_p:n \l_@@_chap_show_verse_bool }
+ { \bool_if_p:n \g_@@_poetry_midparachap_show_verse_bool }
{
\@@_verse_output:n { 1 }
}
@@ -3913,7 +4318,9 @@
\skip_horizontal:N \l_@@_chap_sep_tl
\hook_use:n { scripture / chap / after }
}
- \bool_if:NT \g_@@_poetry_midparachap_show_verse_bool
+ \bool_lazy_or:nnT
+ { \bool_if_p:n \l_@@_chap_show_verse_bool }
+ { \bool_if_p:n \g_@@_poetry_midparachap_show_verse_bool }
{
\@@_verse_output:n { 1 }
}
@@ -4044,7 +4451,7 @@
}
{
\dim_compare:nTF
- { \parskip >= \l_@@_poetry_aboveskip_tl > \c_zero_skip }
+ { \parskip >= \glueexpr \l_@@_poetry_aboveskip_tl > \c_zero_skip }
{
\skip_zero:N \topsep
\skip_zero:N \l_@@_delta_below_skip
@@ -4137,6 +4544,30 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\textscripture}
+% \begin{arguments}
+% \item \meta{|reference|} of quotation.
+% \item \meta{|options|} to set.
+% \item \meta{|quotation|} text.
+% \end{arguments}
+% Set an inline quotation. This is equivalent to calling the
+% \env{scripture} environment with the \opt{inline} option set.
+% \begin{macrocode}
+\NewDocumentCommand { \textscripture } { oo+m }
+ {
+ \tl_if_novalue:nTF { #2 }
+ {
+ \begin { scripture } [ #1 ] [ inline ]
+ }
+ {
+ \begin { scripture } [ #1 ] [ inline, #2 ]
+ }
+ #3
+ \end { scripture }
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{envmacro}{scripture}
% \begin{arguments}
% \item \meta{|reference|} of quotation.
@@ -4239,15 +4670,23 @@
% \end{macrocode}
% \end{envmacro}
% \begin{macrocode}
+ \bool_if:NT \l_@@_inline_bool
+ {
+ \tl_set:Nn \l_@@_aboveskip_tl { 0pt }
+ \tl_set:Nn \l_@@_belowskip_tl { 0pt }
+ \tl_set:Nn \l_@@_leftmargin_tl { 0pt }
+ \tl_set:Nn \l_@@_rightmargin_tl { 0pt }
+ }
\bool_if:NT \l_@@_compact_bool
{
\scripturesetup { chapter / nodrop }
- \RenewDocumentEnvironment { center } { o } { \ignorespaces } { }
- \RenewDocumentEnvironment { flushright } { o } { \ignorespaces } { }
- \RenewDocumentEnvironment { hanging } { o } { \ignorespaces } { }
- \RenewDocumentEnvironment { midparachap } { o } { \ignorespaces } { }
- \RenewDocumentEnvironment { narrow } { o } { \ignorespaces } { }
- \RenewDocumentEnvironment { poetry } { o } { \ignorespaces } { }
+ \RenewDocumentEnvironment { center } { o } { \ignorespaces } { \unskip }
+ \RenewDocumentEnvironment { flushright } { o } { \ignorespaces } { \unskip }
+ \RenewDocumentEnvironment { hanging } { o } { \ignorespaces } { \unskip }
+ \RenewDocumentEnvironment { midparachap } { o } { \ignorespaces } { \unskip }
+ \RenewDocumentEnvironment { narrow } { o } { \ignorespaces } { \unskip }
+ \RenewDocumentEnvironment { poetry } { o } { \ignorespaces } { \unskip }
+ \cs_set_eq:NN \\ \unskip
\cs_set_eq:NN \par \relax
\cs_set_eq:NN \extraskip \relax
\cs_set_eq:NN \nohang \relax
diff --git a/Master/texmf-dist/source/latex/scripture/scripture.ins b/Master/texmf-dist/source/latex/scripture/scripture.ins
index 44698f3ffd8..c61f1dab650 100644
--- a/Master/texmf-dist/source/latex/scripture/scripture.ins
+++ b/Master/texmf-dist/source/latex/scripture/scripture.ins
@@ -1,6 +1,6 @@
\iffalse meta-comment
-Copyright (c) 2022 David Purton <dcpurton@marshwiggle.net>
+Copyright (c) 2022-2023 David Purton <dcpurton@marshwiggle.net>
This work may be distributed and/or modified under the conditions of
the LaTeX Project Public License, either version 1.3c of this license
@@ -19,7 +19,7 @@ version 2005/12/01 or later.
This is a generated file.
-Copyright (c) 2022 David Purton <dcpurton@marshwiggle.net>
+Copyright (c) 2022-2023 David Purton <dcpurton@marshwiggle.net>
This work may be distributed and/or modified under the conditions of
the LaTeX Project2 Public License, either version 1.3c of this license