[latex3-commits] [latex3/latex2e] tagging/gh767: different approach to handle legacy \listparindent (3d4d144da)
github at latex-project.org
github at latex-project.org
Sun Nov 24 12:38:59 CET 2024
Repository : https://github.com/latex3/latex2e
On branch : tagging/gh767
Link : https://github.com/latex3/latex2e/commit/3d4d144dac3fbf29195df0fedc90d221b7409316
>---------------------------------------------------------------
commit 3d4d144dac3fbf29195df0fedc90d221b7409316
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date: Sun Nov 24 12:38:59 2024 +0100
different approach to handle legacy \listparindent
>---------------------------------------------------------------
3d4d144dac3fbf29195df0fedc90d221b7409316
required/latex-lab/latex-lab-block.dtx | 32 ++++++++++++++++------
.../testfiles-block/blocks-verse-01.luatex.tlg | 2 +-
.../latex-lab/testfiles-block/blocks-verse-01.tlg | 2 +-
required/latex-lab/update-blocks-all.sh | 32 ++++++++++++----------
4 files changed, 42 insertions(+), 26 deletions(-)
diff --git a/required/latex-lab/latex-lab-block.dtx b/required/latex-lab/latex-lab-block.dtx
index 14593a4ac..1508b9ab0 100644
--- a/required/latex-lab/latex-lab-block.dtx
+++ b/required/latex-lab/latex-lab-block.dtx
@@ -1244,12 +1244,6 @@
{
item-indent=-1.5em,
parindent=-1.5em,
-% \end{macrocode}
-%
-% \changes{v0.8w}{2024/11/23}{Need to set \cs{listparindent} now that
-% block and list templates are decoupled (tagging/767)}
-% \begin{macrocode}
- listparindent=-1.5em,
item-skip=0pt,
rightmargin=\leftmargin,
leftmargin=\leftmargin+1.5em,
@@ -2471,9 +2465,29 @@
{ \bool_if:NT \l_@@_long_label_bool { \nobreak \hfil \break } }
% version of \newline inside an hbox that will be unpacked
}
- % \skip_set_eq:NN \parsep \l_@@_item_parsep_skip TODO??? FMi
- % what's that?
- \dim_set_eq:NN \parindent \listparindent
+ % \skip_set_eq:NN \parsep \l_@@_item_parsep_skip TODO??? FMi what's that?
+% \end{macrocode}
+% The next setting is for compatibility: The list template sets
+% \cs{listparindent} to zero and otherwise doesn't use it any
+% more. However, in the second argument of a legacy \env{list}
+% envrironment the user may have set it explicitly to some other
+% value and whatever value it had was then used for \cs{parindent}
+% within the list. Now we use its value only if it differs from
+% zero but otherwise use whatever the template instances
+% specify. This gives 99.9\% compatibility for legacy
+% documents. 100\% for definitions using the \env{list} environment
+% and a setting inside, but if the user used \cs{listparindent}
+% within the document, e.g., inside a \env{verse} environment there
+% there is one case in which the setting is ignored, i.e., when it
+% was set back to zero. That's a rather unlikely scenario, but it
+% is not impossible. However, I couldn't think of an approach that
+% circumvents such boundary cases.
+%
+% \changes{v0.8w}{2024/11/24}{Only use \cs{listparindent} if it was changed
+% from its default (tagging/767)}
+% \begin{macrocode}
+ \dim_compare:nNnF \listparindent = {0pt}
+ { \dim_set_eq:NN \parindent \listparindent }
% \end{macrocode}
% Placing the list label(s) is done when the paragraph for the
% \cs{item} is started, which executes \cs{@@_item_everypar:}
diff --git a/required/latex-lab/testfiles-block/blocks-verse-01.luatex.tlg b/required/latex-lab/testfiles-block/blocks-verse-01.luatex.tlg
index e870d76af..b940ba37c 100644
--- a/required/latex-lab/testfiles-block/blocks-verse-01.luatex.tlg
+++ b/required/latex-lab/testfiles-block/blocks-verse-01.luatex.tlg
@@ -3,7 +3,7 @@ Don't change this file in any respect.
before ---> \leftmargin = 25.00003pt
verse ---> \itemindent = -15.00002pt
verse ---> \parindent = -15.00002pt
-verse ---> \listparindent = -15.00002pt
+verse ---> \listparindent = 0.0pt
verse ---> \leftmargin = 40.00005pt
Completed box being shipped out [1]
\vbox(633.0+0.0)x407.0, direction TLT
diff --git a/required/latex-lab/testfiles-block/blocks-verse-01.tlg b/required/latex-lab/testfiles-block/blocks-verse-01.tlg
index 9e61d6b59..462aa8c25 100644
--- a/required/latex-lab/testfiles-block/blocks-verse-01.tlg
+++ b/required/latex-lab/testfiles-block/blocks-verse-01.tlg
@@ -3,7 +3,7 @@ Don't change this file in any respect.
before ---> \leftmargin = 24.9939pt
verse ---> \itemindent = -14.99634pt
verse ---> \parindent = -14.99634pt
-verse ---> \listparindent = -14.99634pt
+verse ---> \listparindent = 0.0pt
verse ---> \leftmargin = 39.99023pt
Completed box being shipped out [1]
\vbox(633.0+0.0)x407.0
diff --git a/required/latex-lab/update-blocks-all.sh b/required/latex-lab/update-blocks-all.sh
index 18f537bba..7d35a7a72 100644
--- a/required/latex-lab/update-blocks-all.sh
+++ b/required/latex-lab/update-blocks-all.sh
@@ -6,16 +6,21 @@ l3build save -cconfig-block -epdftex \
l3build save -cconfig-block -epdftex,luatex \
- blocks-item-01 \
- blocks-item-02 \
- blocks-item-03 \
- blocks-item-04 \
blocks-000 \
+ blocks-description-01 \
+ blocks-description-01b \
+ blocks-description-02b \
+ blocks-description-03 \
blocks-enumerate-01 \
blocks-enumerate-01b \
blocks-enumerate-02 \
blocks-enumerate-02b \
blocks-enumerate-05 \
+ blocks-hyperref-01 \
+ blocks-item-01 \
+ blocks-item-02 \
+ blocks-item-03 \
+ blocks-item-04 \
blocks-itemize-01 \
blocks-itemize-01b \
blocks-itemize-02 \
@@ -25,28 +30,25 @@ l3build save -cconfig-block -epdftex,luatex \
blocks-list-02b \
blocks-list-03b \
blocks-list-04 \
- blocks-description-01 \
- blocks-description-01b \
- blocks-description-02b \
- blocks-description-03 \
- blocks-hyperref-01 \
blocks-minipage-gh544 \
+ blocks-quote-01 \
+ blocks-quote-02 \
blocks-theorem-01 \
blocks-theorem-02 \
blocks-theorem-03 \
- blocks-quote-01 \
- blocks-quote-02 \
- blocks-trivlist-00 \
+ blocks-theorem-04 \
+ blocks-trivlist-00 \
blocks-trivlist-01 \
blocks-trivlist-02 \
blocks-verbatim-01 \
blocks-verbatim-02 \
+ blocks-verbatim-nested-gh119 \
blocks-verse-01 \
- hyperref-target \
- ptag-001 \
- problem-blocks-tabbing \
gallery-III \
gallery-III-with-sec \
+ hyperref-target \
+ problem-blocks-tabbing \
+ ptag-001 \
tagging-0097 \
tagging-0097b \
tagging-0730
More information about the latex3-commits
mailing list.