diff options
author | Karl Berry <karl@freefriends.org> | 2023-12-28 23:07:42 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-12-28 23:07:42 +0000 |
commit | cb908e7527b1723a5913ed8ee0b7d76448c1c0f6 (patch) | |
tree | 3b94e39657c439466d5fc4b8443b5a5565190bc1 /Master/texmf-dist/tex | |
parent | 46927a6f33d9a63981a79f9489ccd9d5cca8c65e (diff) |
scripture (27dec23)
git-svn-id: svn://tug.org/texlive/trunk@69232 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/scripture/scripture.sty | 1282 |
1 files changed, 633 insertions, 649 deletions
diff --git a/Master/texmf-dist/tex/latex/scripture/scripture.sty b/Master/texmf-dist/tex/latex/scripture/scripture.sty index 3d03ee0825a..5cdbca4dce9 100644 --- a/Master/texmf-dist/tex/latex/scripture/scripture.sty +++ b/Master/texmf-dist/tex/latex/scripture/scripture.sty @@ -24,8 +24,8 @@ %% This work consists of the files scripture.ins, scripture.dtx, README.md, %% and the derived files scripture.sty and scripture.pdf %% -\NeedsTeXFormat{LaTeX2e}[2022-06-01] -\ProvidesExplPackage{scripture}{2023/01/08}{1.3} +\NeedsTeXFormat{LaTeX2e}[2022-11-01] +\ProvidesExplPackage{scripture}{2023/12/27}{2.0} {Format Scripture Quotations (DCP)} \msg_new:nnnn { scripture } { nested-environment } { Nesting~of~scripture~environments~not~supported. } @@ -39,275 +39,332 @@ { Language~requested~without~support. } { You~have~requested~language=#1,~but~neither~babel~nor~polyglossia~ have~been~loaded~and~set~up.~Ignoring~option~language=#1. } +\msg_new:nnnn { scripture } { unknown-style } + { Style~#1~not~defined. } + { You~have~requested~style=#1,~but~it~has~not~been~defined.~ + You~can~define~it~using~\token_to_str:N \scripturestyle.~ + Ignoring~option~style=#1. } \keys_define:nn { scripture } { - , aboveskip .tl_set:N = \l__scripture_aboveskip_tl - , aboveskip .value_required:n = true - , aboveskip .initial:n = \c_zero_skip - , added / font .tl_set:N = \l__scripture_added_font_tl - , added / font .value_required:n = true - , added / font .initial:n = - , added / format .cs_set:Np = \__scripture_added_format:n #1 - , added / format .value_required:n = true - , added / format .initial:n = \emph { #1 } - , belowskip .tl_set:N = \l__scripture_belowskip_tl - , belowskip .value_required:n = true - , belowskip .initial:n = \c_zero_skip - , colour .tl_set:N = \l__scripture_colour_tl - , colour .value_required:n = true - , colour .initial:n = . - , color .meta:n = { colour = { #1 } } - , compact .bool_set:N = \l__scripture_compact_bool - , compact .default:n = true - , compact .initial:n = false - , chapter / font .tl_set:N = \l__scripture_chap_font_tl - , chapter / font .value_required:n = true - , chapter / font .initial:n = \bfseries - , chapter / colour .tl_set:N = \l__scripture_chapter_colour_tl - , chapter / colour .value_required:n = true - , chapter / colour .initial:n = . - , chapter / color .meta:n = { chapter / colour = { #1 } } - , chapter / drop .bool_set:N = \l__scripture_chap_drop_bool - , chapter / drop .default:n = true - , chapter / drop .initial:n = true - , chapter / format .cs_set:Np = \__scripture_chap_format:n #1 - , chapter / format .value_required:n = true - , chapter / format .initial:n = #1 - , chapter / hide .bool_set_inverse:N = \l__scripture_chap_show_bool - , chapter / hide .default:n = true - , chapter / nodrop .bool_set_inverse:N = \l__scripture_chap_drop_bool - , chapter / nodrop .default:n = true - , chapter / sep .tl_set:N = \l__scripture_chap_sep_tl - , chapter / sep .value_required:n = true - , chapter / sep .initial:n = 0.5 em - , chapter / show .bool_set:N = \l__scripture_chap_show_bool - , chapter / show .default:n = true - , chapter / show .initial:n = true - , chapter / showverse .bool_set:N = \l__scripture_chap_show_verse_bool - , chapter / showverse .default:n = true - , chapter / showverse .initial:n = false - , extraskip .tl_set:N = \l__scripture_extraskip_tl - , extraskip .value_required:n = true - , extraskip .initial:n = \medskipamount - , font .tl_set:N = \l__scripture_font_tl - , font .value_required:n = true - , font .initial:n = - , indent .bool_set:N = \l__scripture_indent_bool - , indent .default:n = true - , indent .initial:n = true - , _inline .bool_set:N = \l__scripture_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__scripture_inline_begin_tl - , inline / begin .value_required:n = true - , inline / begin .initial:n = ``\, - , inline / end .tl_set:N = \l__scripture_inline_end_tl - , inline / end .value_required:n = true - , inline / end .initial:n = \,'' - , language .tl_set:N = \l__scripture_language_tl - , language .value_required:n = true - , language .initial:n = - , language / variant .tl_set:N = \l__scripture_language_variant_tl - , language / variant .value_required:n = true - , language / variant .initial:n = - , leftmargin .tl_set:N = \l__scripture_leftmargin_tl - , leftmargin .value_required:n = true - , leftmargin .initial:n = \c_zero_dim - , name / font .tl_set:N = \l__scripture_name_font_tl - , name / font .value_required:n = true - , name / font .initial:n = \scshape - , name / format .cs_set:Np = \__scripture_name_format:n #1 - , name / format .value_required:n = true - , name / format .initial:n = #1 - , noindent .bool_set_inverse:N = \l__scripture_indent_bool - , noindent .default:n = true - , parindent .tl_set:N = \l__scripture_parindent_tl - , parindent .value_required:n = true - , parindent .initial:n = \parindent - , parskip .tl_set:N = \l__scripture_parskip_tl - , parskip .value_required:n = true - , parskip .initial:n = \parskip - , redletter .bool_set:N = \l__scripture_red_letter_bool - , redletter .default:n = true - , redletter .initial:n = false - , redletter / colour .tl_set:N = \l__scripture_red_letter_colour_tl - , 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__scripture_ref_align_tl - { \tl_new:N \l__scripture_ref_align_tl } - \tl_set_eq:NN \l__scripture_ref_align_tl \l_keys_choice_tl - } - , reference / align .value_required:n = true - , reference / align .initial:n = right - , reference / colour .tl_set:N = \l__scripture_ref_colour_tl - , reference / colour .value_required:n = true - , reference / colour .initial:n = . - , reference / color .meta:n = { reference / colour = { #1 } } - , reference / font .tl_set:N = \l__scripture_ref_font_tl - , reference / font .value_required:n = true - , reference / font .initial:n = \bfseries - , reference / format .cs_set:Np = \__scripture_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__scripture_ref_sep_tl - , reference / sep .value_required:n = true - , reference / sep .initial:n = 2 em - , rightmargin .tl_set:N = \l__scripture_rightmargin_tl - , rightmargin .value_required:n = true - , rightmargin .initial:n = \c_zero_dim - , selah / text .tl_set:N = \l__scripture_selah_text_tl - , selah / text .value_required:n = true - , selah / text .initial:n = Selah - , selah / font .tl_set:N = \l__scripture_selah_font_tl - , selah / font .value_required:n = true - , selah / font .initial:n = \itshape - , selah / format .cs_set:Np = \__scripture_selah_format:n #1 - , selah / format .value_required:n = true - , selah / format .initial:n = #1 - , selah / sep .tl_set:N = \l__scripture_selah_sep_tl - , selah / sep .value_required:n = true - , selah / sep .initial:n = 1 em - , textright / sep .tl_set:N = \l__scripture_text_right_sep_tl - , textright / sep .value_required:n = true - , textright / sep .initial:n = 1 em - , verse / colour .tl_set:N = \l__scripture_verse_colour_tl - , verse / colour .value_required:n = true - , verse / colour .initial:n = . - , verse / color .meta:n = { verse / colour = { #1 } } - , verse / first .bool_set:N = \l__scripture_verse_first_bool - , verse / first .default:n = true - , verse / first .initial:n = false - , verse / firstformat .cs_set:Np = \__scripture_verse_first_format:n #1 - , verse / firstformat .value_required:n = true - , verse / firstformat .initial:n = #1 - , verse / firstsep .tl_set:N = \l__scripture_verse_first_sep_tl - , verse / firstsep .value_required:n = true - , verse / firstsep .initial:n = 0.5em - , verse / font .tl_set:N = \l__scripture_verse_font_tl - , verse / font .value_required:n = true - , verse / font .initial:n = - , verse / format .cs_set:Np = \__scripture_verse_format:n #1 - , verse / format .value_required:n = true - , verse / format .initial:n = \textsuperscript{#1} - , verse / hide .bool_set_inverse:N = \l__scripture_verse_show_bool - , verse / hide .default:n = true - , verse / sep .tl_set:N = \l__scripture_verse_sep_tl - , verse / sep .value_required:n = true - , verse / sep .initial:n = 0.05 em - , verse / show .bool_set:N = \l__scripture_verse_show_bool - , verse / show .default:n = true - , verse / show .initial:n = true - , version .tl_set:N = \l__scripture_version_tl - , version .value_required:n = true - , version .initial:n = - , version / delim .tl_set:N = \l__scripture_version_delim_tl - , version / delim .value_required:n = true - , version / delim .initial:n = \c_space_tl - , version / format .cs_set:Np = \__scripture_version_format:n #1 - , version / format .value_required:n = true - , version / format .initial:n = (#1) - , center / aboveskip .tl_set:N = \l__scripture_center_aboveskip_tl - , center / aboveskip .value_required:n = true - , center / aboveskip .initial:n = \medskipamount - , center / belowskip .tl_set:N = \l__scripture_center_belowskip_tl - , center / belowskip .value_required:n = true - , center / belowskip .initial:n = \medskipamount - , center / leftmargin .tl_set:N = \l__scripture_center_leftmargin_tl - , center / leftmargin .value_required:n = true - , center / leftmargin .initial:n = \c_zero_dim - , center / rightmargin .tl_set:N = \l__scripture_center_rightmargin_tl - , center / rightmargin .value_required:n = true - , center / rightmargin .initial:n = \c_zero_dim - , flushright / aboveskip .tl_set:N = \l__scripture_flushright_aboveskip_tl - , flushright / aboveskip .value_required:n = true - , flushright / aboveskip .initial:n = \medskipamount - , flushright / belowskip .tl_set:N = \l__scripture_flushright_belowskip_tl - , flushright / belowskip .value_required:n = true - , flushright / belowskip .initial:n = \medskipamount - , flushright / leftmargin .tl_set:N = \l__scripture_flushright_leftmargin_tl - , flushright / leftmargin .value_required:n = true - , flushright / leftmargin .initial:n = \c_zero_dim - , flushright / rightmargin .tl_set:N = \l__scripture_flushright_rightmargin_tl - , flushright / rightmargin .value_required:n = true - , flushright / rightmargin .initial:n = \c_zero_dim - , hanging / aboveskip .tl_set:N = \l__scripture_hanging_aboveskip_tl - , hanging / aboveskip .value_required:n = true - , hanging / aboveskip .initial:n = \medskipamount - , hanging / belowskip .tl_set:N = \l__scripture_hanging_belowskip_tl - , hanging / belowskip .value_required:n = true - , hanging / belowskip .initial:n = \medskipamount - , hanging / hang .tl_set:N = \l__scripture_hanging_hang_tl - , hanging / hang .value_required:n = true - , hanging / hang .initial:n = 2 em - , hanging / leftmargin .tl_set:N = \l__scripture_hanging_leftmargin_tl - , hanging / leftmargin .value_required:n = true - , hanging / leftmargin .initial:n = 1 em - , hanging / rightmargin .tl_set:N = \l__scripture_hanging_rightmargin_tl - , hanging / rightmargin .value_required:n = true - , hanging / rightmargin .initial:n = \c_zero_dim - , midparachap / hideverse .bool_set_inverse:N = \l__scripture_midparachap_show_verse_bool - , midparachap / hideverse .default:n = true - , midparachap / showverse .bool_set:N = \l__scripture_midparachap_show_verse_bool - , midparachap / showverse .default:n = true - , midparachap / showverse .initial:n = true - , narrow / aboveskip .tl_set:N = \l__scripture_narrow_aboveskip_tl - , narrow / aboveskip .value_required:n = true - , narrow / aboveskip .initial:n = \medskipamount - , narrow / belowskip .tl_set:N = \l__scripture_narrow_belowskip_tl - , narrow / belowskip .value_required:n = true - , narrow / belowskip .initial:n = \medskipamount - , narrow / leftmargin .tl_set:N = \l__scripture_narrow_leftmargin_tl - , narrow / leftmargin .value_required:n = true - , narrow / leftmargin .initial:n = 1 em - , narrow / rightmargin .tl_set:N = \l__scripture_narrow_rightmargin_tl - , narrow / rightmargin .value_required:n = true - , narrow / rightmargin .initial:n = 1 em - , poetry / aboveskip .tl_set:N = \l__scripture_poetry_aboveskip_tl - , poetry / aboveskip .value_required:n = true - , poetry / aboveskip .initial:n = \medskipamount - , poetry / belowskip .tl_set:N = \l__scripture_poetry_belowskip_tl - , poetry / belowskip .value_required:n = true - , poetry / belowskip .initial:n = \medskipamount - , poetry / bigindent .tl_set:N = \l__scripture_poetry_big_indent_tl - , poetry / bigindent .value_required:n = true - , poetry / bigindent .initial:n = 4 em - , poetry / indent .tl_set:N = \l__scripture_poetry_indent_tl - , poetry / indent .value_required:n = true - , poetry / indent .initial:n = 1 em - , poetry / leftmargin .tl_set:N = \l__scripture_poetry_leftmargin_tl - , poetry / leftmargin .value_required:n = true - , poetry / leftmargin .initial:n = 1 em - , poetry / rightmargin .tl_set:N = \l__scripture_poetry_rightmargin_tl - , poetry / rightmargin .value_required:n = true - , poetry / rightmargin .initial:n = \c_zero_dim - , poetry / verse / left .bool_set_inverse:N = \l__scripture_poetry_verse_right_bool - , poetry / verse / left .default:n = true - , poetry / verse / right .bool_set:N = \l__scripture_poetry_verse_right_bool - , poetry / verse / right .default:n = true - , poetry / verse / right .initial:n = true - , poetry / verse / sep .tl_set:N = \l__scripture_poetry_verse_sep_tl - , poetry / verse / sep .value_required:n = true - , poetry / verse / sep .initial:n = 0.05 em + , aboveskip .tl_set:N = \l__scripture_aboveskip_tl + , aboveskip .value_required:n = true + , aboveskip .initial:n = \c_zero_skip + , added / font .tl_set:N = \l__scripture_added_font_tl + , added / font .value_required:n = true + , added / font .initial:n = + , added / format .cs_set:Np = \__scripture_added_format:n #1 + , added / format .value_required:n = true + , added / format .initial:n = \emph { #1 } + , belowskip .tl_set:N = \l__scripture_belowskip_tl + , belowskip .value_required:n = true + , belowskip .initial:n = \c_zero_skip + , colour .tl_set:N = \l__scripture_colour_tl + , colour .value_required:n = true + , colour .initial:n = . + , color .meta:n = { colour = { #1 } } + , compact .bool_set:N = \l__scripture_compact_bool + , compact .default:n = true + , compact .initial:n = false + , chapter / font .tl_set:N = \l__scripture_chap_font_tl + , chapter / font .value_required:n = true + , chapter / font .initial:n = \bfseries + , chapter / colour .tl_set:N = \l__scripture_chapter_colour_tl + , chapter / colour .value_required:n = true + , chapter / colour .initial:n = . + , chapter / color .meta:n = { chapter / colour = { #1 } } + , chapter / drop .bool_set:N = \l__scripture_chap_drop_bool + , chapter / drop .default:n = true + , chapter / drop .initial:n = true + , chapter / format .cs_set:Np = \__scripture_chap_format:n #1 + , chapter / format .value_required:n = true + , chapter / format .initial:n = #1 + , chapter / hide .bool_set_inverse:N = \l__scripture_chap_show_bool + , chapter / hide .default:n = true + , chapter / nodrop .bool_set_inverse:N = \l__scripture_chap_drop_bool + , chapter / nodrop .default:n = true + , chapter / sep .tl_set:N = \l__scripture_chap_sep_tl + , chapter / sep .value_required:n = true + , chapter / sep .initial:n = 0.5 em + , chapter / show .bool_set:N = \l__scripture_chap_show_bool + , chapter / show .default:n = true + , chapter / show .initial:n = true + , chapter / showverse .bool_set:N = \l__scripture_chap_show_verse_bool + , chapter / showverse .default:n = true + , chapter / showverse .initial:n = false + , extraskip .tl_set:N = \l__scripture_extraskip_tl + , extraskip .value_required:n = true + , extraskip .initial:n = \medskipamount + , font .tl_set:N = \l__scripture_font_tl + , font .value_required:n = true + , font .initial:n = + , indent .bool_set:N = \l__scripture_indent_bool + , indent .default:n = true + , indent .initial:n = true + , inline .bool_set:N = \l__scripture_inline_bool + , inline .default:n = true + , inline .initial:n = false + , inline / begin .tl_set:N = \l__scripture_inline_begin_tl + , inline / begin .value_required:n = true + , inline / begin .initial:n = ``\, + , inline / end .tl_set:N = \l__scripture_inline_end_tl + , inline / end .value_required:n = true + , inline / end .initial:n = \,'' + , inline / reference / format .cs_set:Np = \__scripture_inline_ref_format:n #1 + , inline / reference / format .value_required:n = true + , inline / reference / format .initial:n = (#1) + , inline / reference / sep .tl_set:N = \l__scripture_inline_ref_sep_tl + , inline / reference / sep .value_required:n = true + , inline / reference / sep .initial:n = 0.5 em + , inline / version / delim .tl_set:N = \l__scripture_inline_version_delim_tl + , inline / version / delim .value_required:n = true + , inline / version / delim .initial:n = \c_space_tl + , inline / version / format .cs_set:Np = \__scripture_inline_version_format:n #1 + , inline / version / format .value_required:n = true + , inline / version / format .initial:n = #1 + , language .tl_set:N = \l__scripture_language_tl + , language .value_required:n = true + , language .initial:n = + , language / variant .tl_set:N = \l__scripture_language_variant_tl + , language / variant .value_required:n = true + , language / variant .initial:n = + , leftmargin .tl_set:N = \l__scripture_leftmargin_tl + , leftmargin .value_required:n = true + , leftmargin .initial:n = \c_zero_dim + , name / font .tl_set:N = \l__scripture_name_font_tl + , name / font .value_required:n = true + , name / font .initial:n = \scshape + , name / format .cs_set:Np = \__scripture_name_format:n #1 + , name / format .value_required:n = true + , name / format .initial:n = #1 + , noindent .bool_set_inverse:N = \l__scripture_indent_bool + , noindent .default:n = true + , parindent .tl_set:N = \l__scripture_parindent_tl + , parindent .value_required:n = true + , parindent .initial:n = \parindent + , parskip .tl_set:N = \l__scripture_parskip_tl + , parskip .value_required:n = true + , parskip .initial:n = \parskip + , redletter .bool_set:N = \l__scripture_red_letter_bool + , redletter .default:n = true + , redletter .initial:n = false + , redletter / colour .tl_set:N = \l__scripture_red_letter_colour_tl + , redletter / colour .value_required:n = true + , redletter / colour .initial:n = red!80!black + , redletter / color .meta:n = { redletter / colour = { #1 } } + , reference / align .choices:nn = { left, right } + { + \tl_if_exist:NF \l__scripture_ref_align_tl + { \tl_new:N \l__scripture_ref_align_tl } + \tl_set_eq:NN \l__scripture_ref_align_tl \l_keys_choice_tl + } + , reference / align .value_required:n = true + , reference / align .initial:n = right + , reference / colour .tl_set:N = \l__scripture_ref_colour_tl + , reference / colour .value_required:n = true + , reference / colour .initial:n = . + , reference / color .meta:n = { reference / colour = { #1 } } + , reference / font .tl_set:N = \l__scripture_ref_font_tl + , reference / font .value_required:n = true + , reference / font .initial:n = \bfseries + , reference / format .cs_set:Np = \__scripture_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__scripture_ref_sep_tl + , reference / sep .value_required:n = true + , reference / sep .initial:n = 2 em + , rightmargin .tl_set:N = \l__scripture_rightmargin_tl + , rightmargin .value_required:n = true + , rightmargin .initial:n = \c_zero_dim + , selah / text .tl_set:N = \l__scripture_selah_text_tl + , selah / text .value_required:n = true + , selah / text .initial:n = Selah + , selah / font .tl_set:N = \l__scripture_selah_font_tl + , selah / font .value_required:n = true + , selah / font .initial:n = \itshape + , selah / format .cs_set:Np = \__scripture_selah_format:n #1 + , selah / format .value_required:n = true + , selah / format .initial:n = #1 + , selah / sep .tl_set:N = \l__scripture_selah_sep_tl + , selah / sep .value_required:n = true + , selah / sep .initial:n = 1 em + , style .choice: + , style / unknown .code:n = \msg_error:nnx + { scripture } + { unknown-style } + { \exp_not:n {#1} } + , textright / sep .tl_set:N = \l__scripture_text_right_sep_tl + , textright / sep .value_required:n = true + , textright / sep .initial:n = 1 em + , verse / colour .tl_set:N = \l__scripture_verse_colour_tl + , verse / colour .value_required:n = true + , verse / colour .initial:n = . + , verse / color .meta:n = { verse / colour = { #1 } } + , verse / first .bool_set:N = \l__scripture_verse_first_bool + , verse / first .default:n = true + , verse / first .initial:n = false + , verse / firstformat .cs_set:Np = \__scripture_verse_first_format:n #1 + , verse / firstformat .value_required:n = true + , verse / firstformat .initial:n = #1 + , verse / firstsep .tl_set:N = \l__scripture_verse_first_sep_tl + , verse / firstsep .value_required:n = true + , verse / firstsep .initial:n = 0.5em + , verse / font .tl_set:N = \l__scripture_verse_font_tl + , verse / font .value_required:n = true + , verse / font .initial:n = + , verse / format .cs_set:Np = \__scripture_verse_format:n #1 + , verse / format .value_required:n = true + , verse / format .initial:n = \textsuperscript{#1} + , verse / hide .bool_set_inverse:N = \l__scripture_verse_show_bool + , verse / hide .default:n = true + , verse / sep .tl_set:N = \l__scripture_verse_sep_tl + , verse / sep .value_required:n = true + , verse / sep .initial:n = 0.05 em + , verse / show .bool_set:N = \l__scripture_verse_show_bool + , verse / show .default:n = true + , verse / show .initial:n = true + , version .tl_set:N = \l__scripture_version_tl + , version .value_required:n = true + , version .initial:n = + , version / delim .tl_set:N = \l__scripture_version_delim_tl + , version / delim .value_required:n = true + , version / delim .initial:n = \c_space_tl + , version / format .cs_set:Np = \__scripture_version_format:n #1 + , version / format .value_required:n = true + , version / format .initial:n = (#1) + , center / aboveskip .tl_set:N = \l__scripture_center_aboveskip_tl + , center / aboveskip .value_required:n = true + , center / aboveskip .initial:n = \medskipamount + , center / belowskip .tl_set:N = \l__scripture_center_belowskip_tl + , center / belowskip .value_required:n = true + , center / belowskip .initial:n = \medskipamount + , center / leftmargin .tl_set:N = \l__scripture_center_leftmargin_tl + , center / leftmargin .value_required:n = true + , center / leftmargin .initial:n = \c_zero_dim + , center / rightmargin .tl_set:N = \l__scripture_center_rightmargin_tl + , center / rightmargin .value_required:n = true + , center / rightmargin .initial:n = \c_zero_dim + , flushright / aboveskip .tl_set:N = \l__scripture_flushright_aboveskip_tl + , flushright / aboveskip .value_required:n = true + , flushright / aboveskip .initial:n = \medskipamount + , flushright / belowskip .tl_set:N = \l__scripture_flushright_belowskip_tl + , flushright / belowskip .value_required:n = true + , flushright / belowskip .initial:n = \medskipamount + , flushright / leftmargin .tl_set:N = \l__scripture_flushright_leftmargin_tl + , flushright / leftmargin .value_required:n = true + , flushright / leftmargin .initial:n = \c_zero_dim + , flushright / rightmargin .tl_set:N = \l__scripture_flushright_rightmargin_tl + , flushright / rightmargin .value_required:n = true + , flushright / rightmargin .initial:n = \c_zero_dim + , hanging / aboveskip .tl_set:N = \l__scripture_hanging_aboveskip_tl + , hanging / aboveskip .value_required:n = true + , hanging / aboveskip .initial:n = \medskipamount + , hanging / belowskip .tl_set:N = \l__scripture_hanging_belowskip_tl + , hanging / belowskip .value_required:n = true + , hanging / belowskip .initial:n = \medskipamount + , hanging / hang .tl_set:N = \l__scripture_hanging_hang_tl + , hanging / hang .value_required:n = true + , hanging / hang .initial:n = 2 em + , hanging / leftmargin .tl_set:N = \l__scripture_hanging_leftmargin_tl + , hanging / leftmargin .value_required:n = true + , hanging / leftmargin .initial:n = 1 em + , hanging / rightmargin .tl_set:N = \l__scripture_hanging_rightmargin_tl + , hanging / rightmargin .value_required:n = true + , hanging / rightmargin .initial:n = \c_zero_dim + , midparachap / hideverse .bool_set_inverse:N = \l__scripture_midparachap_show_verse_bool + , midparachap / hideverse .default:n = true + , midparachap / showverse .bool_set:N = \l__scripture_midparachap_show_verse_bool + , midparachap / showverse .default:n = true + , midparachap / showverse .initial:n = true + , narrow / aboveskip .tl_set:N = \l__scripture_narrow_aboveskip_tl + , narrow / aboveskip .value_required:n = true + , narrow / aboveskip .initial:n = \medskipamount + , narrow / belowskip .tl_set:N = \l__scripture_narrow_belowskip_tl + , narrow / belowskip .value_required:n = true + , narrow / belowskip .initial:n = \medskipamount + , narrow / leftmargin .tl_set:N = \l__scripture_narrow_leftmargin_tl + , narrow / leftmargin .value_required:n = true + , narrow / leftmargin .initial:n = 1 em + , narrow / rightmargin .tl_set:N = \l__scripture_narrow_rightmargin_tl + , narrow / rightmargin .value_required:n = true + , narrow / rightmargin .initial:n = 1 em + , poetry / aboveskip .tl_set:N = \l__scripture_poetry_aboveskip_tl + , poetry / aboveskip .value_required:n = true + , poetry / aboveskip .initial:n = \medskipamount + , poetry / belowskip .tl_set:N = \l__scripture_poetry_belowskip_tl + , poetry / belowskip .value_required:n = true + , poetry / belowskip .initial:n = \medskipamount + , poetry / bigindent .tl_set:N = \l__scripture_poetry_big_indent_tl + , poetry / bigindent .value_required:n = true + , poetry / bigindent .initial:n = 4 em + , poetry / indent .tl_set:N = \l__scripture_poetry_indent_tl + , poetry / indent .value_required:n = true + , poetry / indent .initial:n = 1 em + , poetry / leftmargin .tl_set:N = \l__scripture_poetry_leftmargin_tl + , poetry / leftmargin .value_required:n = true + , poetry / leftmargin .initial:n = 1 em + , poetry / rightmargin .tl_set:N = \l__scripture_poetry_rightmargin_tl + , poetry / rightmargin .value_required:n = true + , poetry / rightmargin .initial:n = \c_zero_dim + , poetry / verse / left .bool_set_inverse:N = \l__scripture_poetry_verse_right_bool + , poetry / verse / left .default:n = true + , poetry / verse / right .bool_set:N = \l__scripture_poetry_verse_right_bool + , poetry / verse / right .default:n = true + , poetry / verse / right .initial:n = true + , poetry / verse / sep .tl_set:N = \l__scripture_poetry_verse_sep_tl + , poetry / verse / sep .value_required:n = true + , poetry / verse / sep .initial:n = 0.05 em } \ProcessKeyOptions +\cs_new_protected:Nn \__scripture_setup_style:nnn + { + \bool_if:NTF #1 + { + \tl_if_exist:cF { g__scripture_style_ #2 _tl } + { \tl_new:c { g__scripture_style_ #2 _tl } } + \__scripture_setup_style:nne \c_false_bool { #2 } + { \tl_use:c { g__scripture_style_ #2 _tl } , #3 } + } + { + \tl_gset:cn { g__scripture_style_ #2 _tl } { #3 } + \keys_define:nn { scripture } + { style / #2 .meta:n = { #3 } } + } + } +\cs_generate_variant:Nn \__scripture_setup_style:nnn { nne } \hook_new_pair:nn { scripture / chap / before } { scripture / chap / after } \hook_new_pair:nn { scripture / verse / before } { scripture / verse / after } \bool_new:N \l__scripture_active_bool \bool_new:N \l__scripture_active_inner_bool \int_new:N \l__scripture_clubpenalty_saved_int +\skip_new:N \g__scripture_prev_inner_below_skip +\dim_new:N \l__scripture_outer_itemindent_dim +\cs_new_protected_nopar:Nn \__scripture_setup_list_noindent:n + { + \legacy_if:nT {@newlist} + { + \cs_set_protected_nopar:Npn \noindent + { + \skip_horizontal:n { -#1 } + } + \hook_gput_next_code:nn { para / end } + { + \cs_gset_eq:NN \noindent \tex_noindent:D + } + } + } +\cs_new_protected:Nn \__scripture_skip_diff:NN + { + \skip_eval:n + { + \dim_eval:n { \dimexpr #1 - \dimexpr #2 } + ~ plus ~ + \dim_max:nn { \gluestretch #1 - \gluestretch #2 } \c_zero_dim + ~ minus ~ + \dim_max:nn { \glueshrink #1 - \glueshrink #2 } \c_zero_dim + } + } \cs_new_protected:Nn \__scripture_extra_skip: { \int_compare:nNnT @@ -363,7 +420,8 @@ #1 \tl_if_empty:NF \l__scripture_version_tl { - \l__scripture_version_delim_tl + \tl_if_empty:nF { #1 } + { \l__scripture_version_delim_tl } \__scripture_version_format:n { \l__scripture_version_tl } } } @@ -375,20 +433,21 @@ { \__scripture_format_full_ref:n { #1 } } - \bool_if:NT \g__scripture_poetry_end_bool - { \skip_vertical:n { -\parskip } } \dim_compare:nNnT { \box_wd:N \l__scripture_ref_box + \g__scripture_final_line_dim + \l__scripture_ref_sep_tl } > \linewidth - { \skip_vertical:N \baselineskip } - \int_compare:nNnT \prevgraf = \c_zero_int - { \skip_vertical:n { -\baselineskip } } - \tl_if_eq:NnT \l__scripture_ref_align_tl { right } + { + \skip_vertical:N \baselineskip + \tl_if_eq:NnT \l__scripture_ref_align_tl { left } + { + \int_compare:nNnT \g__scripture_chap_par_prevgraf_int = 1 + { \skip_vertical:N \baselineskip } + } + } + \tl_if_eq:NnTF \l__scripture_ref_align_tl { right } { \hfill } - \tl_if_eq:NnT \l__scripture_ref_align_tl { left } { - \mode_leave_vertical: \dim_compare:nNnT { \box_wd:N \l__scripture_ref_box + \g__scripture_final_line_dim + \l__scripture_ref_sep_tl } < @@ -461,7 +520,7 @@ { \msg_warning:nnx { scripture } - { language-waning } + { language-warning } { \l__scripture_language_tl } } } @@ -508,8 +567,7 @@ \hook_gput_next_code:nn { para / after } { \int_gset_eq:NN \g__scripture_chap_par_prevgraf_int \prevgraf - \int_compare:nNnT - \g__scripture_chap_par_prevgraf_int = 1 + \int_compare:nNnT \g__scripture_chap_par_prevgraf_int = 1 { \penalty 10000 } \hook_gput_next_code:nn { para / before } { \int_set_eq:NN \clubpenalty \l__scripture_clubpenalty_saved_int } @@ -535,9 +593,7 @@ \hook_use:n { scripture / chap / after } \group_end: \bool_if:NT \l__scripture_chap_show_verse_bool - { - \__scripture_verse_output:n { 1 } - } + { \__scripture_verse_output:n { 1 } } } \cs_new_protected:Nn \__scripture_nodrop_chap:n { @@ -592,13 +648,13 @@ } \hook_gput_next_code:nn { para / before } { - \int_compare:nNnT - \g__scripture_chap_par_prevgraf_int = 1 - { \extraskip } - \int_gzero:N \g__scripture_chap_par_prevgraf_int - \int_compare:nNnT - \@listdepth > \c_zero_int - { \parshape 1 ~ \@totalleftmargin ~ \linewidth } + \legacy_if:nF { @newlist } + { + \int_compare:nNnT \g__scripture_chap_par_prevgraf_int = 1 + { \extraskip } + \int_gzero:N \g__scripture_chap_par_prevgraf_int + } + \parshape 1 ~ \@totalleftmargin ~ \linewidth } } \bool_new:N \l__scripture_verse_par_start_bool @@ -665,20 +721,58 @@ } $$ \__scripture_reset_spacing: - \dim_compare:nNnT \g__scripture_final_line_dim > \linewidth - { - \dim_gset_eq:NN \g__scripture_final_line_dim \linewidth - } + \dim_compare:nNnT \g__scripture_final_line_dim > \paperwidth + { \dim_gset:Nn \g__scripture_final_line_dim { \@totalleftmargin + \linewidth } } \dim_compare:nNnT \g__scripture_final_line_dim > { \c_zero_dim - 1 sp } - { - \skip_vertical:n { -\baselineskip - \parskip } - } + { \skip_vertical:n { -\baselineskip - \parskip } } } \str_new:N \l__scripture_currenvir_str \skip_new:N \l__scripture_parskip_correction_skip -\bool_new:N \g__scripture_start_bool +\cs_new_protected_nopar:Nn \__scripture_added:n + { + \group_begin: + \l__scripture_added_font_tl + \__scripture_added_format:n { #1 } + \group_end: + } +\cs_new_protected_nopar:Nn \__scripture_name:n + { + \group_begin: + \l__scripture_name_font_tl + \__scripture_name_format:n { #1 } + \group_end: + } +\cs_new_protected_nopar:Nn \__scripture_no_first_verse: + { + \bool_set_true:N \l__scripture_no_verse_first_bool + } +\cs_new_protected:Nn \__scripture_ch_output:nn + { + \bool_if:NTF \l__scripture_chap_show_bool + { + \bool_if:NTF \l__scripture_chap_drop_bool + { + \__scripture_chap:n { #2 } + \bool_if:nTF { #1 } + { + \hook_gput_next_code:nn { para / after } + { + \int_gzero:N \g__scripture_chap_par_prevgraf_int + \int_gzero:N \g__scripture_mid_para_chap_prevgraf_int + } + } + { + \hook_gput_next_code:nn { para / after } + { \int_gset_eq:NN \g__scripture_mid_para_chap_prevgraf_int \prevgraf } + } + } + { \__scripture_nodrop_chap:n { #2 } } + } + { \__scripture_nodrop_chap:n { #2 } } + } \cs_new_protected:Nn \__scripture_begin:n { + \cs_set_eq:NN \__scripture_noindent_saved: \noindent \bool_if:NT \l__scripture_active_bool { \msg_error:nn { scripture } { nested-environment } @@ -690,191 +784,122 @@ \keys_set:nn { scripture } { #1 } } \__scripture_select_language: - \legacy_if:nT { @newlist } - { - \strut - \par - \vspace* { \dim_eval:n { -\baselineskip - \parskip } } - } - \mode_if_vertical:T - { - \addvspace { \l__scripture_aboveskip_tl } - } - \DeclareDocumentCommand { \ch } { sm } - { - \bool_if:NTF \l__scripture_chap_show_bool - { - \bool_if:NTF \l__scripture_chap_drop_bool - { - \__scripture_chap:n { ##2 } - \bool_if:nT { ##1 } - { - \hook_gput_next_code:nn { para / after } - { \int_gzero:N \g__scripture_chap_par_prevgraf_int } - } - } - { \__scripture_nodrop_chap:n { ##2 } } - } - { \__scripture_nodrop_chap:n { ##2 } } - } + \int_gzero:N \g__scripture_chap_par_prevgraf_int \everydisplay { } \int_set:Nn \predisplaypenalty { 10000 } \int_set_eq:NN \postdisplaypenalty \@lowpenalty - \bool_gset_true:N \g__scripture_start_bool + \int_set:Nn \@beginparpenalty { -\@lowpenalty } + \int_set_eq:NN \@endparpenalty \@lowpenalty \bool_gset_false:N \g__scripture_poetry_end_bool - \dim_set_eq:NN \parindent \l__scripture_parindent_tl \cs_set_eq:NN \extraskip \__scripture_extra_skip: \cs_set_eq:NN \redletteron \__scripture_red_letter_on: \cs_set_eq:NN \redletteroff \__scripture_red_letter_off: + \DeclareDocumentCommand { \ch } { sm } + { \__scripture_ch_output:nn { ##1 } { ##2 } } \cs_set_eq:NN \vs \__scripture_verse_output:n - \cs_set_protected_nopar:Npn \added ##1 - { - \group_begin: - \l__scripture_added_font_tl - \__scripture_added_format:n { ##1 } - \group_end: - } - \cs_set_protected_nopar:Npn \name ##1 - { - \group_begin: - \l__scripture_name_font_tl - \__scripture_name_format:n { ##1 } - \group_end: - } - \cs_set_protected_nopar:Npn \nofirstverse - { - \bool_set_true:N \l__scripture_no_verse_first_bool - } - \cs_set_protected_nopar:Npn \LORD - { - \name { Lord } - } - \cs_set_protected_nopar:Npn \GOD - { - \name { God } - } + \cs_set_eq:NN \added \__scripture_added:n + \cs_set_eq:NN \name \__scripture_name:n + \cs_set_protected_nopar:Npn \LORD { \name { Lord } } + \cs_set_protected_nopar:Npn \GOD { \name { God } } + \cs_set_eq:NN \nofirstverse \__scripture_no_first_verse: \cs_set_protected_nopar:Npn \textright ##1 - { - \__scripture_text_right:nn { \l__scripture_text_right_sep_tl } { ##1 } - } + { \__scripture_text_right:nn { \l__scripture_text_right_sep_tl } { ##1 } } \hook_gclear_next_code:n { para / before } - \skip_set:Nn \l__scripture_parskip_correction_skip { \parskip - \l__scripture_parskip_tl } - \mode_if_vertical:T - { - \addvspace { \l__scripture_parskip_correction_skip } - } - \skip_set_eq:NN \parskip \l__scripture_parskip_tl \l__scripture_font_tl \exp_args:NnV \color_set:nn { scripture default colour } \l__scripture_colour_tl \str_if_eq:VnF \l__scripture_colour_tl { . } + { \color_select:n { scripture default colour } } + \bool_if:NTF \l__scripture_inline_bool + { \l__scripture_inline_begin_tl } { - \color_select:n { scripture default colour } - } - \bool_lazy_or:nnT - { \dim_compare_p:n { \l__scripture_leftmargin_tl > 0pt } } - { \dim_compare_p:n { \l__scripture_rightmargin_tl > 0pt } } - { - \dim_sub:Nn \linewidth - { \l__scripture_leftmargin_tl + \l__scripture_rightmargin_tl } - \int_compare:nNnTF - \@listdepth > \c_zero_int - { - \dim_add:Nn \@totalleftmargin \l__scripture_leftmargin_tl - \parshape 1 ~ \@totalleftmargin ~ \linewidth - } - { - \dim_add:Nn \leftskip \l__scripture_leftmargin_tl - \dim_add:Nn \rightskip \l__scripture_rightmargin_tl - } - } - \bool_if:NF \l__scripture_indent_bool - { - \hook_gput_next_code:nn { para / begin } + \legacy_if:nTF { @newlist } + { \dim_set_eq:NN \l__scripture_outer_itemindent_dim \itemindent } + { \dim_zero:N \l__scripture_outer_itemindent_dim } + \list { } { - \bool_lazy_any:nT + \dim_set_eq:NN \leftmargin \l__scripture_leftmargin_tl + \dim_set_eq:NN \rightmargin \l__scripture_rightmargin_tl + \dim_set:Nn \itemindent { \l__scripture_parindent_tl - \l__scripture_outer_itemindent_dim } + \dim_set_eq:NN \listparindent \l__scripture_parindent_tl + \skip_zero:N \partopsep + \skip_set_eq:NN \parsep \l__scripture_parskip_tl + \dim_compare:nNnTF \parskip > \l__scripture_aboveskip_tl + { \skip_zero:N \topsep } + { \skip_set:Nn \topsep { \__scripture_skip_diff:NN \l__scripture_aboveskip_tl \parskip } } + \__scripture_setup_list_noindent:n { \l__scripture_parindent_tl } + \bool_if:NF \l__scripture_indent_bool { - { \str_if_eq_p:Vn \l__scripture_currenvir_str { midparachap } } - { \str_if_eq_p:Vn \l__scripture_currenvir_str { narrow } } - { \str_if_eq_p:Vn \l__scripture_currenvir_str { scripture } } + \hook_gput_next_code:nn { para / begin } + { + \bool_lazy_any:nT + { + { \str_if_eq_p:Vn \l__scripture_currenvir_str { midparachap } } + { \str_if_eq_p:Vn \l__scripture_currenvir_str { narrow } } + { \str_if_eq_p:Vn \l__scripture_currenvir_str { scripture } } + } + { + \legacy_if:nTF { @noparlist } + { \noindent } + { \para_omit_indent: } + } + } } - { \para_omit_indent: } } - } - \bool_if:NT \l__scripture_inline_bool - { \l__scripture_inline_begin_tl } + \dim_set_eq:NN \parindent \l__scripture_parindent_tl + \item + \relax + } } \cs_new_protected:Nn \__scripture_end:n { - \tl_if_eq:NnTF \l__scripture_ref_align_tl { inline } + \bool_if:NTF \l__scripture_inline_bool { - \bool_lazy_or:nnF + \unskip + \__scripture_red_letter_off: + \l__scripture_inline_end_tl + \bool_lazy_or:nnTF { \tl_if_novalue_p:n { #1 } } { \tl_if_empty_p:n { #1 } } { - \unskip - \__scripture_red_letter_off: - \bool_if:NT \l__scripture_inline_bool - { \l__scripture_inline_end_tl } + \tl_if_empty:NF \l__scripture_version_tl + { + \skip_horizontal:N \l__scripture_ref_sep_tl + \__scripture_format_full_ref:n { } + } + } + { \skip_horizontal:N \l__scripture_ref_sep_tl \__scripture_format_full_ref:n { #1 } } } { - \mode_if_vertical:TF - { - \unskip - \unskip - } - { - \tl_if_novalue:nTF { #1 } - { \int_zero:N \postdisplaypenalty } - { \int_set_eq:NN \postdisplaypenalty \@highpenalty } - \__scripture_calc_final_line_length: - } - \bool_lazy_or:nnTF - { \dim_compare_p:n { \l__scripture_leftmargin_tl > 0pt } } - { \dim_compare_p:n { \l__scripture_rightmargin_tl > 0pt } } - { - \dim_add:Nn \linewidth \l__scripture_leftmargin_tl - \int_compare:nNnT - \@listdepth > \c_zero_int - { - \dim_sub:Nn \@totalleftmargin \l__scripture_leftmargin_tl - \parshape 1 ~ \@totalleftmargin ~ \linewidth - } - } - { \parshape 1 ~ \@totalleftmargin ~ \linewidth } - \__scripture_red_letter_off: - \bool_lazy_or:nnF - { \tl_if_novalue_p:n { #1 } } - { \tl_if_empty_p:n { #1 } } - { \__scripture_reference:n { #1 } } - \par - \bool_lazy_or:nnT - { \dim_compare_p:n { \l__scripture_leftmargin_tl > 0pt } } - { \dim_compare_p:n { \l__scripture_rightmargin_tl > 0pt } } - { - \int_compare:nNnT - \@listdepth > \c_zero_int - { - \dim_add:Nn \linewidth \l__scripture_rightmargin_tl - \parshape 1 ~ \@totalleftmargin ~ \linewidth - } - } - \dim_compare:nNnTF - { \glueexpr \l__scripture_belowskip_tl } > \parskip - { - \addvspace - { - \skip_eval:n { \l__scripture_belowskip_tl - \parskip } - } - } - { - \addvspace { \l__scripture_belowskip_tl } - } + \__scripture_red_letter_off: + \skip_zero:N \parskip + \int_set:Nn \postdisplaypenalty { 10000 } + \__scripture_calc_final_line_length: + \dim_gsub:Nn \g__scripture_final_line_dim \@totalleftmargin + \dim_compare:nNnTF \@outerparskip > \l__scripture_belowskip_tl + { \skip_zero:N \@topsepadd } + { \skip_set:Nn \@topsepadd { \__scripture_skip_diff:NN \l__scripture_belowskip_tl \@outerparskip } } + \int_compare:nNnT \prevgraf = \c_zero_int + { \skip_vertical:n { -\g__scripture_prev_inner_below_skip } } + \hook_gclear_next_code:n { para / before } + \parshape 1 ~ \@totalleftmargin ~ \linewidth + \noindent + \bool_lazy_or:nnTF + { \tl_if_novalue_p:n { #1 } } + { \tl_if_empty_p:n { #1 } } + { + \tl_if_empty:NTF \l__scripture_version_tl + { \hbox:n { } } + { \__scripture_reference:n { } } + } + { \__scripture_reference:n { #1 } } + \@noparlistfalse + \endlist } + \cs_set_eq:NN \noindent \__scripture_noindent_saved: } -\skip_new:N \l__scripture_delta_below_skip \cs_new_protected:Nn \__scripture_center_begin:n { \bool_if:NT \l__scripture_active_inner_bool @@ -889,47 +914,38 @@ { scripture / center } { #1 } } - \mode_if_horizontal:T - { \par } + \legacy_if:nTF { @newlist } + { \dim_add:Nn \l__scripture_outer_itemindent_dim \itemindent } + { \dim_zero:N \l__scripture_outer_itemindent_dim } \list { } { - \skip_set_eq:NN \l__scripture_delta_below_skip \l__scripture_center_belowskip_tl - \bool_if:NTF \g__scripture_start_bool - { - \skip_zero:N \topsep - \skip_sub:Nn \topsep \parskip - \skip_add:Nn \l__scripture_delta_below_skip \parskip - \bool_gset_false:N \g__scripture_start_bool - } - { - \dim_compare:nTF - { \parskip >= \glueexpr \l__scripture_center_aboveskip_tl > \c_zero_skip } - { - \skip_zero:N \topsep - \skip_zero:N \l__scripture_delta_below_skip - } - { - \skip_set_eq:NN \topsep \l__scripture_center_aboveskip_tl - \skip_sub:Nn \l__scripture_delta_below_skip \l__scripture_center_aboveskip_tl - } - \int_compare:nNnT \g__scripture_chap_par_prevgraf_int = 1 - { \addvspace { \baselineskip } } - \int_gzero:N \g__scripture_chap_par_prevgraf_int - } + \dim_zero:N \labelsep + \dim_set_eq:NN \leftmargin \l__scripture_center_leftmargin_tl + \dim_set_eq:NN \rightmargin \l__scripture_center_rightmargin_tl + \dim_set:Nn \itemindent { -\l__scripture_outer_itemindent_dim } + \dim_zero:N \listparindent \skip_set_eq:NN \parsep \parskip \skip_zero:N \partopsep - \dim_zero:N \leftmargin - \dim_zero:N \labelsep - } + \dim_compare:nNnTF \parskip > \l__scripture_center_aboveskip_tl + { \skip_zero:N \topsep } + { \skip_set:Nn \topsep { \__scripture_skip_diff:NN \l__scripture_center_aboveskip_tl \parskip } } + \__scripture_setup_list_noindent:n { \c_zero_dim } + } + \int_compare:nNnT \g__scripture_chap_par_prevgraf_int = 1 + { \addvspace { \baselineskip } } + \int_gzero:N \g__scripture_chap_par_prevgraf_int \centering \item \relax } \cs_new_protected:Nn \__scripture_center_end: { - \__scripture_calc_final_line_length: - \skip_add:Nn \@topsepadd \l__scripture_delta_below_skip - \int_set_eq:NN \@endparpenalty \@lowpenalty + \dim_gset:Nn \g__scripture_final_line_dim { \@totalleftmargin + \linewidth } + \dim_compare:nNnTF \@outerparskip > \l__scripture_center_belowskip_tl + { \skip_zero:N \@topsepadd } + { \skip_set:Nn \@topsepadd { \__scripture_skip_diff:NN \l__scripture_center_belowskip_tl \@outerparskip } } + \skip_gset_eq:NN \g__scripture_prev_inner_below_skip \@topsepadd + \legacy_if_set_false:n { @noparlist } \endlist } \cs_new_protected:Nn \__scripture_flushright_begin:n @@ -946,52 +962,51 @@ { scripture / flushright } { #1 } } - \mode_if_horizontal:T - { \par } + \legacy_if:nTF { @newlist } + { \dim_add:Nn \l__scripture_outer_itemindent_dim \itemindent } + { \dim_zero:N \l__scripture_outer_itemindent_dim } \list { } { - \skip_set_eq:NN \l__scripture_delta_below_skip \l__scripture_flushright_belowskip_tl - \bool_if:NTF \g__scripture_start_bool - { - \skip_zero:N \topsep - \skip_sub:Nn \topsep \parskip - \skip_add:Nn \l__scripture_delta_below_skip \parskip - \bool_gset_false:N \g__scripture_start_bool - } - { - \dim_compare:nTF - { \parskip >= \glueexpr \l__scripture_flushright_aboveskip_tl > \c_zero_skip } - { - \skip_zero:N \topsep - \skip_zero:N \l__scripture_delta_below_skip - } - { - \skip_set_eq:NN \topsep \l__scripture_flushright_aboveskip_tl - \skip_sub:Nn \l__scripture_delta_below_skip \l__scripture_flushright_aboveskip_tl - } - \int_compare:nNnT \g__scripture_chap_par_prevgraf_int = 1 - { \addvspace { \baselineskip } } - \int_gzero:N \g__scripture_chap_par_prevgraf_int - } + \dim_zero:N \labelsep \dim_set_eq:NN \leftmargin \l__scripture_flushright_leftmargin_tl \dim_set_eq:NN \rightmargin \l__scripture_flushright_rightmargin_tl + \dim_set:Nn \itemindent { -\l__scripture_outer_itemindent_dim } + \dim_zero:N \listparindent \skip_set_eq:NN \parsep \parskip \skip_zero:N \partopsep - \dim_zero:N \leftmargin - \dim_zero:N \labelsep - } + \dim_compare:nNnTF \parskip > \l__scripture_flushright_aboveskip_tl + { \skip_zero:N \topsep } + { \skip_set:Nn \topsep { \__scripture_skip_diff:NN \l__scripture_flushright_aboveskip_tl \parskip } } + \__scripture_setup_list_noindent:n { \c_zero_dim } + } + \int_compare:nNnT \g__scripture_chap_par_prevgraf_int = 1 + { \addvspace { \baselineskip } } + \int_gzero:N \g__scripture_chap_par_prevgraf_int \raggedleft \item \relax } \cs_new_protected:Nn \__scripture_flushright_end: { - \__scripture_calc_final_line_length: - \skip_add:Nn \@topsepadd \l__scripture_delta_below_skip - \int_set_eq:NN \@endparpenalty \@lowpenalty + \dim_gset:Nn \g__scripture_final_line_dim { \@totalleftmargin + \linewidth } + \dim_compare:nNnTF \@outerparskip > \l__scripture_flushright_belowskip_tl + { \skip_zero:N \@topsepadd } + { \skip_set:Nn \@topsepadd { \__scripture_skip_diff:NN \l__scripture_flushright_belowskip_tl \@outerparskip } } + \skip_gset_eq:NN \g__scripture_prev_inner_below_skip \@topsepadd + \legacy_if_set_false:n { @noparlist } \endlist } \dim_new:N \l__scripture_hanging_parindent_saved_dim +\cs_new_protected:Nn \__scripture_hanging_ch:n + { + \bool_if:NTF \l__scripture_chap_show_bool + { + \bool_if:NTF \l__scripture_chap_drop_bool + { \__scripture_hanging_chap:n { #1 } } + { \__scripture_nodrop_chap:n { #1 } } + } + { \__scripture_nodrop_chap:n { #1 } } + } \cs_new_protected:Nn \__scripture_hanging_chap:n { \__scripture_drop_chap_set_up:n { #1 } @@ -1027,17 +1042,15 @@ } ~ \@totalleftmargin ~ \linewidth } - \mode_if_vertical:T + \tl_set:Nx \l__scripture_chap_sep_tl { - \tl_set:Nx \l__scripture_chap_sep_tl + \dim_eval:n { - \dim_eval:n - { - \l__scripture_chap_sep_tl + \l__scripture_hanging_parindent_saved_dim - } + \l__scripture_chap_sep_tl + \l__scripture_hanging_parindent_saved_dim } - \__scripture_nohang: } + \par + \__scripture_nohang: \hbox_set:Nn \l__scripture_chap_box { \box_move_down:nn @@ -1078,7 +1091,7 @@ } \cs_new_protected_nopar:Nn \__scripture_nohang: { - \para_raw_noindent: + \noindent \hbox_to_wd:nn { \l__scripture_hanging_parindent_saved_dim } { } } \cs_new_protected:Nn \__scripture_hanging_begin:n @@ -1095,63 +1108,41 @@ { scripture / hanging } { #1 } } - \mode_if_horizontal:T - { \par } + \DeclareDocumentCommand { \ch } { sm } { \__scripture_hanging_ch:n { ##2 } } + \cs_set_eq:NN \vs \__scripture_hanging_verse:n + \cs_set_eq:NN \nohang \__scripture_nohang: + \dim_set_eq:NN \l__scripture_hanging_parindent_saved_dim \parindent + \legacy_if:nTF { @newlist } + { \dim_add:Nn \l__scripture_outer_itemindent_dim \itemindent } + { \dim_zero:N \l__scripture_outer_itemindent_dim } \list { } { - \skip_set_eq:NN \l__scripture_delta_below_skip \l__scripture_hanging_belowskip_tl - \bool_if:NTF \g__scripture_start_bool - { - \dim_zero:N \topsep - \skip_sub:Nn \topsep \parskip - \skip_add:Nn \l__scripture_delta_below_skip \parskip - \bool_gset_false:N \g__scripture_start_bool - } - { - \dim_compare:nTF - { \parskip >= \glueexpr \l__scripture_hanging_aboveskip_tl > \c_zero_skip } - { - \skip_zero:N \topsep - \skip_zero:N \l__scripture_delta_below_skip - } - { - \skip_set_eq:NN \topsep \l__scripture_hanging_aboveskip_tl - \skip_sub:Nn \l__scripture_delta_below_skip \l__scripture_hanging_aboveskip_tl - } - \int_compare:nNnT \g__scripture_chap_par_prevgraf_int = 1 - { \addvspace { \baselineskip } } - \int_gzero:N \g__scripture_chap_par_prevgraf_int - } - \dim_set:Nn \leftmargin - { \l__scripture_hanging_leftmargin_tl + \l__scripture_hanging_hang_tl } + \dim_zero:N \labelsep + \dim_set:Nn \leftmargin { \l__scripture_hanging_leftmargin_tl + \l__scripture_hanging_hang_tl } \dim_set_eq:NN \rightmargin \l__scripture_hanging_rightmargin_tl - \dim_set:Nn \itemindent { -\l__scripture_hanging_hang_tl } + \dim_set:Nn \itemindent { -\l__scripture_hanging_hang_tl - \l__scripture_outer_itemindent_dim } \dim_set:Nn \listparindent { -\l__scripture_hanging_hang_tl } \skip_set_eq:NN \parsep \parskip \skip_zero:N \partopsep - \dim_zero:N \labelsep - \dim_set_eq:NN \l__scripture_hanging_parindent_saved_dim \parindent - } - \DeclareDocumentCommand { \ch } { sm } - { - \bool_if:NTF \l__scripture_chap_show_bool - { - \bool_if:NTF \l__scripture_chap_drop_bool - { \__scripture_hanging_chap:n { ##2 } } - { \__scripture_nodrop_chap:n { ##2 } } - } - { \__scripture_nodrop_chap:n { ##2 } } - } - \cs_set_eq:NN \vs \__scripture_hanging_verse:n - \cs_set_eq:NN \nohang \__scripture_nohang: + \dim_compare:nNnTF \parskip > \l__scripture_hanging_aboveskip_tl + { \skip_zero:N \topsep } + { \skip_set:Nn \topsep { \__scripture_skip_diff:NN \l__scripture_hanging_aboveskip_tl \parskip } } + \__scripture_setup_list_noindent:n { -\l__scripture_hanging_hang_tl } + } + \int_compare:nNnT \g__scripture_chap_par_prevgraf_int = 1 + { \addvspace { \baselineskip } } + \int_gzero:N \g__scripture_chap_par_prevgraf_int \item \relax } \cs_new_protected:Nn \__scripture_hanging_end: { \__scripture_calc_final_line_length: - \skip_add:Nn \@topsepadd \l__scripture_delta_below_skip - \int_set_eq:NN \@endparpenalty \@lowpenalty + \dim_compare:nNnTF \@outerparskip > \l__scripture_hanging_belowskip_tl + { \skip_zero:N \@topsepadd } + { \skip_set:Nn \@topsepadd { \__scripture_skip_diff:NN \l__scripture_hanging_belowskip_tl \@outerparskip } } + \skip_gset_eq:NN \g__scripture_prev_inner_below_skip \@topsepadd + \legacy_if_set_false:n { @noparlist } \endlist } \cs_new_protected:Npn \__scripture_vbox_set_top:Nw #1 @@ -1163,6 +1154,7 @@ \bool_new:N \l__scripture_mid_para_chap_bool \box_new:N \l__scripture_mid_para_chap_line_box \dim_new:N \g__scripture_mid_para_chap_prevdepth_dim +\dim_new:N \l__scripture_mid_para_chap_totalleftmargin_dim \int_new:N \g__scripture_mid_para_chap_prevgraf_int \box_new:N \l__scripture_mid_para_chap_snap_box \int_new:N \l__scripture_mid_para_chap_spacefactor_int @@ -1233,12 +1225,16 @@ \par \bool_set_true:N \l__scripture_mid_para_chap_bool \__scripture_vbox_set_top:Nw \l__scripture_mid_para_chap_box + \dim_zero:N \leftskip + \dim_zero:N \rightskip + \dim_set_eq:NN \l__scripture_mid_para_chap_totalleftmargin_dim \@totalleftmargin + \dim_zero:N \@totalleftmargin + \dim_set_eq:NN \hsize \linewidth \skip_zero:N \parskip } \cs_new_protected:Nn \__scripture_mid_para_chap_end: { \par - \int_gset_eq:NN \g__scripture_mid_para_chap_prevgraf_int \prevgraf \dim_gset_eq:NN \g__scripture_mid_para_chap_prevdepth_dim \prevdepth \box_set_to_last:N \l__scripture_mid_para_chap_line_box \hbox_set:Nn \l__scripture_mid_para_chap_snap_box @@ -1248,7 +1244,8 @@ \unskip \unpenalty } - \dim_gset:Nn \g__scripture_final_line_dim { \box_wd:N \l__scripture_mid_para_chap_snap_box } + \dim_gset:Nn \g__scripture_final_line_dim + { \box_wd:N \l__scripture_mid_para_chap_snap_box + \l__scripture_mid_para_chap_totalleftmargin_dim } \box_clear:N \l__scripture_mid_para_chap_snap_box \nointerlineskip \int_compare:nNnT @@ -1297,9 +1294,7 @@ \hook_gput_next_code:nn { para / before } { \int_gzero:N \g__scripture_chap_par_prevgraf_int - \int_compare:nNnT - \@listdepth > \c_zero_int - { \parshape 1 ~ \@totalleftmargin ~ \linewidth } + \parshape 1 ~ \@totalleftmargin ~ \linewidth } } \cs_new_protected:Nn \__scripture_narrow_begin:n @@ -1316,49 +1311,47 @@ { scripture / narrow } { #1 } } - \mode_if_horizontal:T - { \par } + \legacy_if:nTF { @newlist } + { \dim_add:Nn \l__scripture_outer_itemindent_dim \itemindent } + { \dim_zero:N \l__scripture_outer_itemindent_dim } \list { } { - \skip_set_eq:NN \l__scripture_delta_below_skip \l__scripture_narrow_belowskip_tl - \bool_if:NTF \g__scripture_start_bool + %\int_compare:nNnT \g__scripture_chap_par_prevgraf_int = 1 + % { \addvspace { \baselineskip } } + %\int_gzero:N \g__scripture_chap_par_prevgraf_int + \dim_zero:N \labelsep + \dim_set_eq:NN \leftmargin \l__scripture_narrow_leftmargin_tl + \dim_set_eq:NN \rightmargin \l__scripture_narrow_rightmargin_tl + \dim_set_eq:NN \listparindent \parindent + \mode_if_vertical:TF { - \skip_zero:N \topsep - \skip_sub:Nn \topsep \parskip - \skip_add:Nn \l__scripture_delta_below_skip \parskip - \bool_gset_false:N \g__scripture_start_bool + \dim_set:Nn \itemindent { \parindent - \l__scripture_outer_itemindent_dim } + \__scripture_setup_list_noindent:n { \parindent } } { - \dim_compare:nTF - { \parskip >= \glueexpr \l__scripture_narrow_aboveskip_tl > \c_zero_skip } - { - \skip_zero:N \topsep - \skip_zero:N \l__scripture_delta_below_skip - } - { - \skip_set_eq:NN \topsep \l__scripture_narrow_aboveskip_tl - \skip_sub:Nn \l__scripture_delta_below_skip \l__scripture_narrow_aboveskip_tl - } - \int_compare:nNnT \g__scripture_chap_par_prevgraf_int = 1 - { \addvspace { \baselineskip } } - \int_gzero:N \g__scripture_chap_par_prevgraf_int + \dim_set:Nn \itemindent { -\l__scripture_outer_itemindent_dim } + \__scripture_setup_list_noindent:n { \c_zero_dim } } - \dim_set_eq:NN \leftmargin \l__scripture_narrow_leftmargin_tl - \dim_set_eq:NN \rightmargin \l__scripture_narrow_rightmargin_tl - \dim_set_eq:NN \listparindent \parindent - \dim_set_eq:NN \itemindent \parindent \skip_set_eq:NN \parsep \parskip \skip_zero:N \partopsep - \dim_zero:N \labelsep + \dim_compare:nNnTF \parskip > \l__scripture_narrow_aboveskip_tl + { \skip_zero:N \topsep } + { \skip_set:Nn \topsep { \__scripture_skip_diff:NN \l__scripture_narrow_aboveskip_tl \parskip } } } + \int_compare:nNnT \g__scripture_chap_par_prevgraf_int = 1 + { \addvspace { \baselineskip } } + \int_gzero:N \g__scripture_chap_par_prevgraf_int \item \relax } \cs_new_protected:Nn \__scripture_narrow_end: { \__scripture_calc_final_line_length: - \skip_add:Nn \@topsepadd \l__scripture_delta_below_skip - \int_set_eq:NN \@endparpenalty \@lowpenalty + \dim_compare:nNnTF \@outerparskip > \l__scripture_narrow_belowskip_tl + { \skip_zero:N \@topsepadd } + { \skip_set:Nn \@topsepadd { \__scripture_skip_diff:NN \l__scripture_narrow_belowskip_tl \@outerparskip } } + \skip_gset_eq:NN \g__scripture_prev_inner_below_skip \@topsepadd + \legacy_if_set_false:n { @noparlist } \endlist } \hook_new:n { scripture / poetry / para / after } @@ -1407,6 +1400,16 @@ { \__scripture_selah_format:n { \l__scripture_selah_text_tl } } \group_end: } +\cs_new_protected:Nn \__scripture_poetry_ch:n + { + \bool_if:NTF \l__scripture_chap_show_bool + { + \bool_if:NTF \l__scripture_chap_drop_bool + { \__scripture_poetry_chap:n { #1 } } + { \__scripture_poetry_nodrop_chap:n { #1 } } + } + { \__scripture_poetry_nodrop_chap:n { #1 } } + } \cs_new_protected:Nn \__scripture_poetry_chap:n { \__scripture_drop_chap_set_up:n { #1 } @@ -1640,62 +1643,35 @@ } \bool_set_true:N \l__scripture_active_inner_bool \tl_set:Nn \l__scripture_currenvir_str { poetry } - \mode_if_horizontal:T - { \par } + \bool_gset_false:N \g__scripture_poetry_midparachap_show_verse_bool + \DeclareDocumentCommand { \ch } { sm } { \__scripture_poetry_ch:n { ##2 } } + \cs_set_eq:NN \vs \__scripture_poetry_mode_vertical_verse:n + \cs_set_eq:NN \extraskip \__scripture_poetry_extra_skip: + \cs_set_eq:NN \selah \__scripture_selah_output: + \cs_set_protected_nopar:Npn \textright ##1 + { \__scripture_poetry_text_right:nn { \l__scripture_text_right_sep_tl } { ##1 } } + \legacy_if:nTF { @newlist } + { \dim_add:Nn \l__scripture_outer_itemindent_dim \itemindent } + { \dim_zero:N \l__scripture_outer_itemindent_dim } \list { } { - \skip_set_eq:NN \l__scripture_delta_below_skip \l__scripture_poetry_belowskip_tl - \bool_if:NTF \g__scripture_start_bool - { - \skip_zero:N \topsep - \skip_sub:Nn \topsep \parskip - \skip_add:Nn \l__scripture_delta_below_skip \parskip - \bool_gset_false:N \g__scripture_start_bool - } - { - \dim_compare:nTF - { \parskip >= \glueexpr \l__scripture_poetry_aboveskip_tl > \c_zero_skip } - { - \skip_zero:N \topsep - \skip_zero:N \l__scripture_delta_below_skip - } - { - \skip_set_eq:NN \topsep \l__scripture_poetry_aboveskip_tl - \skip_sub:Nn \l__scripture_delta_below_skip \l__scripture_poetry_aboveskip_tl - } - \int_compare:nNnT \g__scripture_chap_par_prevgraf_int = 1 - { \addvspace { \baselineskip } } - \int_gzero:N \g__scripture_chap_par_prevgraf_int - } + \dim_zero:N \labelsep \dim_set_eq:NN \leftmargin \l__scripture_poetry_leftmargin_tl \dim_set_eq:NN \rightmargin \l__scripture_poetry_rightmargin_tl - \dim_set_eq:NN \itemindent \l__scripture_poetry_indent_tl + \dim_set:Nn \itemindent { \l__scripture_poetry_indent_tl - \l__scripture_outer_itemindent_dim } \dim_set_eq:NN \listparindent \l__scripture_poetry_indent_tl \skip_zero:N \parsep \skip_zero:N \partopsep - \dim_zero:N \labelsep - } + \dim_compare:nNnTF \parskip > { \l__scripture_poetry_aboveskip_tl } + { \skip_zero:N \topsep } + { \skip_set:Nn \topsep { \__scripture_skip_diff:NN \l__scripture_poetry_aboveskip_tl \parskip } } + \__scripture_setup_list_noindent:n { \l__scripture_poetry_indent_tl } + } + \int_compare:nNnT \g__scripture_chap_par_prevgraf_int = 1 + { \addvspace { \baselineskip } } + \int_gzero:N \g__scripture_chap_par_prevgraf_int \raggedright - \dim_set_eq:NN \listparindent \l__scripture_poetry_indent_tl \dim_set_eq:NN \parindent \l__scripture_poetry_indent_tl - \bool_gset_false:N \g__scripture_poetry_midparachap_show_verse_bool - \DeclareDocumentCommand { \ch } { sm } - { - \bool_if:NTF \l__scripture_chap_show_bool - { - \bool_if:NTF \l__scripture_chap_drop_bool - { \__scripture_poetry_chap:n { ##2 } } - { \__scripture_poetry_nodrop_chap:n { ##2 } } - } - { \__scripture_poetry_nodrop_chap:n { ##2 } } - } - \cs_set_eq:NN \vs \__scripture_poetry_mode_vertical_verse:n - \cs_set_eq:NN \extraskip \__scripture_poetry_extra_skip: - \cs_set_eq:NN \selah \__scripture_selah_output: - \cs_set_protected_nopar:Npn \textright ##1 - { - \__scripture_poetry_text_right:nn { \l__scripture_text_right_sep_tl } { ##1 } - } \item \relax \cs_set_eq:NN \__scripture_tmp_para_end: \par @@ -1706,8 +1682,11 @@ \cs_new_protected:Nn \__scripture_poetry_end: { \__scripture_calc_final_line_length: - \skip_add:Nn \@topsepadd \l__scripture_delta_below_skip - \int_set_eq:NN \@endparpenalty \@lowpenalty + \dim_compare:nNnTF \@outerparskip > { \l__scripture_poetry_belowskip_tl } + { \skip_zero:N \@topsepadd } + { \skip_set:Nn \@topsepadd { \__scripture_skip_diff:NN \l__scripture_poetry_belowskip_tl \@outerparskip } } + \skip_gset_eq:NN \g__scripture_prev_inner_below_skip \@topsepadd + \legacy_if_set_false:n { @noparlist } \endlist \bool_gset_true:N \g__scripture_poetry_end_bool \hook_gput_next_code:nn { para / begin } @@ -1719,7 +1698,11 @@ { \keys_set:nn { scripture } { #1 } } -\NewDocumentCommand { \textscripture } { oo+m } +\NewDocumentCommand { \scripturestyle } { s m m } + { + \__scripture_setup_style:nnn { #1 } { #2 } { #3 } + } +\NewDocumentCommand { \textscripture } { o o +m } { \tl_if_novalue:nTF { #2 } { @@ -1731,7 +1714,7 @@ #3 \end { scripture } } -\NewDocumentEnvironment { scripture } { oo } +\NewDocumentEnvironment { scripture } { o o } { \__scripture_begin:n { #2 } \DeclareDocumentEnvironment { center } { o } @@ -1788,6 +1771,11 @@ \tl_set:Nn \l__scripture_belowskip_tl { 0pt } \tl_set:Nn \l__scripture_leftmargin_tl { 0pt } \tl_set:Nn \l__scripture_rightmargin_tl { 0pt } + \cs_set_eq:NN \__scripture_ref_format:n \__scripture_inline_ref_format:n + \tl_set_eq:NN \l__scripture_ref_sep_tl \l__scripture_inline_ref_sep_tl + \cs_set_eq:NN \__scripture_version_format:n \__scripture_inline_version_format:n + \tl_set_eq:NN \l__scripture_version_delim_tl \l__scripture_inline_version_delim_tl + \bool_set_true:N \l__scripture_compact_bool } \bool_if:NT \l__scripture_compact_bool { @@ -1819,11 +1807,7 @@ } \mode_leave_vertical: } - \peek_remove_spaces:n - { - \peek_meaning:NF \begin - { \bool_gset_false:N \g__scripture_start_bool } - } + \ignorespaces } { \bool_if:NT \l__scripture_compact_bool |