summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx68
1 files changed, 36 insertions, 32 deletions
diff --git a/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx b/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx
index 16b7694578c..90441e87e97 100644
--- a/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx
@@ -38,8 +38,8 @@
%<*driver|package>
% The version of expl3 required is tested as early as possible, as
% some really old versions do not define \ProvidesExplPackage.
-\RequirePackage{expl3}[2015/07/14]
-%<package>\@ifpackagelater{expl3}{2015/07/14}
+\RequirePackage{expl3}[2015/07/28]
+%<package>\@ifpackagelater{expl3}{2015/07/28}
%<package> {}
%<package> {%
%<package> \PackageError{l3galley}{Support package l3kernel too old}
@@ -51,7 +51,7 @@
%<package> }%
%<package> \endinput
%<package> }
-\GetIdInfo$Id: l3galley.dtx 5662 2015-07-14 21:32:38Z joseph $
+\GetIdInfo$Id: l3galley.dtx 5700 2015-07-28 19:26:39Z joseph $
{L3 Experimental galley code}
%</driver|package>
%<*driver>
@@ -1472,26 +1472,37 @@
% \end{verbatim}
% and so anything applied here must be done globally.
%
-% \begin{macro}[int]{\@@_start_paragraph_std:}
+% \begin{macro}[int]{\@@_start_paragraph_common:N}
+% Share some code between all types of paragraph start.
% The routine at the start of a paragraph starts by removing any
% (empty) indent box from the vertical list. As there may be vertical
-% mode items still to insert, a \cs{tex_par:D} primitive is used to
+% mode items still to insert (|#1|), a \cs{tex_par:D} primitive is used to
% get back into vertical mode before they are tidied up. To get back
% again to horizontal mode, \cs{tex_noindent:D} can be used. To avoid
% an infinite loop, \cs{tex_everypar:D} is locally cleared before doing
-% that. Back in horizontal mode, the horizontal mode items can be
-% tidied up before sorting out any items which have been set on a
-% single-paragraph basis.
+% that.
% \begin{macrocode}
-\cs_new_protected_nopar:Npn \@@_start_paragraph_std:
+\cs_new_protected:Npn \@@_start_paragraph_common:N #1
{
\group_begin:
\box_gset_to_last:N \g_@@_last_box
\tex_par:D
- \@@_insert_vertical_items:
+ #1
\tex_everypar:D { }
\tex_noindent:D
\group_end:
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[int]{\@@_start_paragraph_std:}
+% After dealign with the common items, the horizontal mode items can be
+% tidied up before sorting out any items which have been set on a
+% single-paragraph basis.
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \@@_start_paragraph_std:
+ {
+ \@@_start_paragraph_common:N \@@_insert_vertical_items:
\@@_insert_horizontal_items:
\@@_restore_running_parameters:
}
@@ -1499,31 +1510,32 @@
% \end{macro}
%
% \begin{macro}[int]{\@@_start_paragraph_first:}
+% \begin{macro}[aux]{\@@_insert_vspace_first:}
% For the very first paragraph in a galley, the code needs to avoid
% adding any unnecessary vertical items at the top as it will interfere with
-% vertical positioning in \cs{tex_vtop:D}.
+% vertical positioning in \cs{tex_vtop:D}. That requirement also means we
+% must not add any vertical space as the start of the box unless there
+% is a user space to insert.
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_start_paragraph_first:
{
\bool_gset_false:N \g_@@_begin_level_bool
\mode_if_horizontal:TF
- {
- \group_begin:
- \box_gset_to_last:N \g_@@_last_box
- \tex_par:D
- \@@_insert_vspace:
- \tex_everypar:D { }
- \tex_noindent:D
- \group_end:
- }
- { \@@_insert_vspace: }
+ { \@@_start_paragraph_common:N \@@_insert_vspace_first: }
+ { \@@_insert_vspace_first: }
\@@_insert_horizontal_items:
\@@_restore_running_parameters:
}
+\cs_new_protected_nopar:Npn \@@_insert_vspace_first:
+ {
+ \tl_if_empty:NF \g_@@_interpar_vspace_user_tl
+ { \skip_vertical:n { \g_@@_interpar_vspace_user_tl } }
+ }
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
-% \begin{macro}[int]{\@@_insert_vertical_items, \@@_insert_vspace:}
+% \begin{macro}[int]{\@@_insert_vertical_items}
% The aim here is to insert the vertical items such that they attach to
% the correct place. This function is used as part of the \cs{tex_everypar:D}
% mechanism, meaning that the immediately-preceding item on the vertical
@@ -1532,7 +1544,8 @@
% should stay glued on. After the whatsits, a penalty for
% breaking will be inserted. This will be the user penalty if supplied,
% or the running penalty unless the no-break flag is set. Finally,
-% the inter-paragraph space is applied.
+% the inter-paragraph space is applied: only one space is ever added
+% there.
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_insert_vertical_items:
{
@@ -1550,15 +1563,6 @@
\tl_gclear:N \g_@@_interpar_penalty_user_tl
}
\bool_gset_false:N \g_galley_no_break_next_bool
- \@@_insert_vspace:
- }
-% \end{macrocode}
-% Inserting vertical space is set up as a separate function as it comes
-% up in a few places. The idea here is that any user-set space will
-% override the design value, and only one space is ever inserted.
-% \begin{macrocode}
-\cs_new_protected_nopar:Npn \@@_insert_vspace:
- {
\tl_if_empty:NTF \g_@@_interpar_vspace_user_tl
{ \skip_vertical:N \l_galley_interpar_vspace_skip }
{