[latex3-commits] [git/LaTeX3-latex3-latex3] master, rand: Apply \par only at the end of vertical boxes (584e7b1)
Joseph Wright
joseph.wright at morningstar2.co.uk
Sun Dec 2 09:51:16 CET 2018
Repository : https://github.com/latex3/latex3
On branches: master,rand
Link : https://github.com/latex3/latex3/commit/584e7b126b3b592bac9ce2c7cd72c4010fa99732
>---------------------------------------------------------------
commit 584e7b126b3b592bac9ce2c7cd72c4010fa99732
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Sun Dec 2 08:48:19 2018 +0000
Apply \par only at the end of vertical boxes
>---------------------------------------------------------------
584e7b126b3b592bac9ce2c7cd72c4010fa99732
l3kernel/CHANGELOG.md | 4 ++++
l3kernel/l3box.dtx | 24 +++++++++++++-----------
l3kernel/l3color-base.dtx | 12 ++++--------
3 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index f2a9603..ee8a1e3 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -7,6 +7,10 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+### Changed
+
+- Apply `\par` only at the end of vertical boxes
+
## [2018-11-19]
### Added
diff --git a/l3kernel/l3box.dtx b/l3kernel/l3box.dtx
index d02d4dd..7990658 100644
--- a/l3kernel/l3box.dtx
+++ b/l3kernel/l3box.dtx
@@ -1364,7 +1364,8 @@
%
% \TeX{} ends these boxes directly with the internal \emph{end_graf}
% routine. This means that there is no \cs{par} at the end of vertical
-% boxes unless we insert one.
+% boxes unless we insert one. Thus all vertical boxes include a \cs{par}
+% just before closing the color group.
%
% \begin{macro}{\vbox:n}
% \TestFiles{m3box003.lvt}
@@ -1373,9 +1374,9 @@
% Put a vertical box directly into the input stream.
% \begin{macrocode}
\cs_new_protected:Npn \vbox:n #1
- { \tex_vbox:D { \color_group_begin: #1 \color_group_end: } }
+ { \tex_vbox:D { \color_group_begin: #1 \par \color_group_end: } }
\cs_new_protected:Npn \vbox_top:n #1
- { \tex_vtop:D { \color_group_begin: #1 \color_group_end: } }
+ { \tex_vtop:D { \color_group_begin: #1 \par \color_group_end: } }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1388,12 +1389,12 @@
\cs_new_protected:Npn \vbox_to_ht:nn #1#2
{
\tex_vbox:D to \@@_dim_eval:n {#1}
- { \color_group_begin: #2 \color_group_end: }
+ { \color_group_begin: #2 \par \color_group_end: }
}
\cs_new_protected:Npn \vbox_to_zero:n #1
{
\tex_vbox:D to \c_zero_dim
- { \color_group_begin: #1 \color_group_end: }
+ { \color_group_begin: #1 \par \color_group_end: }
}
% \end{macrocode}
% \end{macro}
@@ -1408,13 +1409,13 @@
\cs_new_protected:Npn \vbox_set:Nn #1#2
{
\tex_setbox:D #1 \tex_vbox:D
- { \color_group_begin: #2 \color_group_end: }
+ { \color_group_begin: #2 \par \color_group_end: }
}
\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { }
\cs_new_protected:Npn \vbox_gset:Nn #1#2
{
\tex_global:D \tex_setbox:D #1 \tex_vbox:D
- { \color_group_begin: #2 \color_group_end: }
+ { \color_group_begin: #2 \par \color_group_end: }
}
\cs_generate_variant:Nn \vbox_set:Nn { c }
\cs_generate_variant:Nn \vbox_gset:Nn { c }
@@ -1432,13 +1433,13 @@
\cs_new_protected:Npn \vbox_set_top:Nn #1#2
{
\tex_setbox:D #1 \tex_vtop:D
- { \color_group_begin: #2 \color_group_end: }
+ { \color_group_begin: #2 \par \color_group_end: }
}
\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { }
\cs_new_protected:Npn \vbox_gset_top:Nn #1#2
{
\tex_global:D \tex_setbox:D #1 \tex_vtop:D
- { \color_group_begin: #2 \color_group_end: }
+ { \color_group_begin: #2 \par \color_group_end: }
}
\cs_generate_variant:Nn \vbox_set_top:Nn { c }
\cs_generate_variant:Nn \vbox_gset_top:Nn { c }
@@ -1455,13 +1456,13 @@
\cs_new_protected:Npn \vbox_set_to_ht:Nnn #1#2#3
{
\tex_setbox:D #1 \tex_vbox:D to \@@_dim_eval:n {#2}
- { \color_group_begin: #3 \color_group_end: }
+ { \color_group_begin: #3 \par \color_group_end: }
}
\__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { }
\cs_new_protected:Npn \vbox_gset_to_ht:Nnn #1#2#3
{
\tex_global:D \tex_setbox:D #1 \tex_vbox:D to \@@_dim_eval:n {#2}
- { \color_group_begin: #3 \color_group_end: }
+ { \color_group_begin: #3 \par \color_group_end: }
}
\cs_generate_variant:Nn \vbox_set_to_ht:Nnn { c }
\cs_generate_variant:Nn \vbox_gset_to_ht:Nnn { c }
@@ -1494,6 +1495,7 @@
\cs_generate_variant:Nn \vbox_gset:Nw { c }
\cs_new_protected:Npn \vbox_set_end:
{
+ \par
\color_group_end:
\c_group_end_token
}
diff --git a/l3kernel/l3color-base.dtx b/l3kernel/l3color-base.dtx
index 0f281c1..a51d6b4 100644
--- a/l3kernel/l3color-base.dtx
+++ b/l3kernel/l3color-base.dtx
@@ -122,16 +122,12 @@
% \end{variable}
%
% \begin{macro}{\color_group_begin:, \color_group_end:}
-% Grouping for color is almost the same as using the basic \cs{group_begin:}
-% and \cs{group_end:} functions. However, in vertical mode the end-of-group
-% needs a \tn{par}, which in horizontal mode does nothing.
+% Grouping for color is the same as using the basic \cs{group_begin:}
+% and \cs{group_end:} functions. However, for semantic reasons, they
+% are renamed here.
% \begin{macrocode}
\cs_new_eq:NN \color_group_begin: \group_begin:
-\cs_new_protected:Npn \color_group_end:
- {
- \par
- \group_end:
- }
+\cs_new_eq:NN \color_group_end: \group_end:
% \end{macrocode}
% \end{macro}
%
More information about the latex3-commits
mailing list