diff options
author | Karl Berry <karl@freefriends.org> | 2017-12-06 23:56:06 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-12-06 23:56:06 +0000 |
commit | cc862e582aa0dd7c0dee16bb5475394338a07641 (patch) | |
tree | b03dbc5b6657d47f5c61b8fcc26f04a564ad6afd /Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx | |
parent | 7ffad570b11726b0ca150867d23878fc1a949865 (diff) |
l3 (7dec17)
git-svn-id: svn://tug.org/texlive/trunk@46003 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx | 162 |
1 files changed, 76 insertions, 86 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx index e312125842a..824d6d13d88 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx @@ -7,7 +7,7 @@ % license or (at your option) any later version. The latest version % of this license is in the file % -% http://www.latex-project.org/lppl.txt +% https://www.latex-project.org/lppl.txt % % This file is part of the "l3kernel bundle" (The Work in LPPL) % and all files in that bundle must be distributed together. @@ -21,7 +21,7 @@ % for those people who are interested. % %<*driver> -\documentclass[full]{l3doc} +\documentclass[full,kernel]{l3doc} \begin{document} \DocInput{\jobname.dtx} \end{document} @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2017/11/14} +% \date{Released 2017/12/05} % % \maketitle % @@ -358,11 +358,13 @@ % opposed to the \TeX{} bounding box. They all start off in the same % place, of course. % \begin{macrocode} -\prop_new:N \c_@@_corners_prop -\prop_put:Nnn \c_@@_corners_prop { tl } { { 0pt } { 0pt } } -\prop_put:Nnn \c_@@_corners_prop { tr } { { 0pt } { 0pt } } -\prop_put:Nnn \c_@@_corners_prop { bl } { { 0pt } { 0pt } } -\prop_put:Nnn \c_@@_corners_prop { br } { { 0pt } { 0pt } } +\prop_const_from_keyval:Nn \c_@@_corners_prop + { + tl = { 0pt } { 0pt } , + tr = { 0pt } { 0pt } , + bl = { 0pt } { 0pt } , + br = { 0pt } { 0pt } , + } % \end{macrocode} % \end{variable} % @@ -370,18 +372,18 @@ % Pole positions are given for horizontal, vertical and reference-point % based values. % \begin{macrocode} -\prop_new:N \c_@@_poles_prop -\tl_set:Nn \l_@@_internal_tl { { 0pt } { 0pt } { 0pt } { 1000pt } } -\prop_put:Nno \c_@@_poles_prop { l } { \l_@@_internal_tl } -\prop_put:Nno \c_@@_poles_prop { hc } { \l_@@_internal_tl } -\prop_put:Nno \c_@@_poles_prop { r } { \l_@@_internal_tl } -\tl_set:Nn \l_@@_internal_tl { { 0pt } { 0pt } { 1000pt } { 0pt } } -\prop_put:Nno \c_@@_poles_prop { b } { \l_@@_internal_tl } -\prop_put:Nno \c_@@_poles_prop { vc } { \l_@@_internal_tl } -\prop_put:Nno \c_@@_poles_prop { t } { \l_@@_internal_tl } -\prop_put:Nno \c_@@_poles_prop { B } { \l_@@_internal_tl } -\prop_put:Nno \c_@@_poles_prop { H } { \l_@@_internal_tl } -\prop_put:Nno \c_@@_poles_prop { T } { \l_@@_internal_tl } +\prop_const_from_keyval:Nn \c_@@_poles_prop + { + l = { 0pt } { 0pt } { 0pt } { 1000pt } , + hc = { 0pt } { 0pt } { 0pt } { 1000pt } , + r = { 0pt } { 0pt } { 0pt } { 1000pt } , + b = { 0pt } { 0pt } { 1000pt } { 0pt } , + vc = { 0pt } { 0pt } { 1000pt } { 0pt } , + t = { 0pt } { 0pt } { 1000pt } { 0pt } , + B = { 0pt } { 0pt } { 1000pt } { 0pt } , + H = { 0pt } { 0pt } { 1000pt } { 0pt } , + T = { 0pt } { 0pt } { 1000pt } { 0pt } , + } % \end{macrocode} % \end{variable} % @@ -506,38 +508,23 @@ % Creating a new coffin means making the underlying box and adding the % data structures. These are created globally, as there is a need to % avoid any strange effects if the coffin is created inside a group. -% This means that the usual rule about \cs[no-index]{l_\ldots} variables has -% to be broken. The \cs{__debug_suspend_log:} and -% \cs{__debug_resume_log:} functions prevent \cs{prop_clear_new:c} -% from writing useless information to the log file; however they only -% exist if debugging is enabled. +% This means that the usual rule about \cs[no-index]{l_\ldots} +% variables has to be broken. The \cs{debug_suspend:} and +% \cs{debug_resume:} functions prevent these checks. They also +% prevent \cs{prop_clear_new:c} from writing useless information to +% the log file. % \begin{macrocode} -\__debug:TF - { - \cs_new_protected:Npn \coffin_new:N #1 - { - \box_new:N #1 - \__debug_suspend_log: - \prop_clear_new:c { l_@@_corners_ \__int_value:w #1 _prop } - \prop_clear_new:c { l_@@_poles_ \__int_value:w #1 _prop } - \prop_gset_eq:cN { l_@@_corners_ \__int_value:w #1 _prop } - \c_@@_corners_prop - \prop_gset_eq:cN { l_@@_poles_ \__int_value:w #1 _prop } - \c_@@_poles_prop - \__debug_resume_log: - } - } +\cs_new_protected:Npn \coffin_new:N #1 { - \cs_new_protected:Npn \coffin_new:N #1 - { - \box_new:N #1 - \prop_clear_new:c { l_@@_corners_ \__int_value:w #1 _prop } - \prop_clear_new:c { l_@@_poles_ \__int_value:w #1 _prop } - \prop_gset_eq:cN { l_@@_corners_ \__int_value:w #1 _prop } - \c_@@_corners_prop - \prop_gset_eq:cN { l_@@_poles_ \__int_value:w #1 _prop } - \c_@@_poles_prop - } + \box_new:N #1 + \debug_suspend: + \prop_clear_new:c { l_@@_corners_ \__int_value:w #1 _prop } + \prop_clear_new:c { l_@@_poles_ \__int_value:w #1 _prop } + \prop_gset_eq:cN { l_@@_corners_ \__int_value:w #1 _prop } + \c_@@_corners_prop + \prop_gset_eq:cN { l_@@_poles_ \__int_value:w #1 _prop } + \c_@@_poles_prop + \debug_resume: } \cs_generate_variant:Nn \coffin_new:N { c } % \end{macrocode} @@ -699,9 +686,12 @@ % Special coffins: these cannot be set up earlier as they need % \cs{coffin_new:N}. The empty coffin is set as a box as the full % coffin-setting system needs some material which is not yet available. +% Debugging must be suspended as we are assigning to a constant coffin. % \begin{macrocode} \coffin_new:N \c_empty_coffin +\debug_suspend: \hbox_set:Nn \c_empty_coffin { } +\debug_resume: \coffin_new:N \l_@@_aligned_coffin \coffin_new:N \l_@@_aligned_internal_coffin % \end{macrocode} @@ -896,8 +886,8 @@ % \subsection{Coffins: calculation of pole intersections} % % \begin{macro}{\@@_calculate_intersection:Nnn} -% \begin{macro}[aux]{\@@_calculate_intersection:nnnnnnnn} -% \begin{macro}[aux]{\@@_calculate_intersection_aux:nnnnnN} +% \begin{macro}{\@@_calculate_intersection:nnnnnnnn} +% \begin{macro}{\@@_calculate_intersection_aux:nnnnnN} % The lead off in finding intersections is to recover the two poles % and then hand off to the auxiliary for the actual calculation. There % may of course not be an intersection, for which an error trap is @@ -1235,7 +1225,7 @@ % \end{macro} % % \begin{macro}{\@@_offset_poles:Nnn} -% \begin{macro}[aux]{\@@_offset_pole:Nnnnnnn} +% \begin{macro}{\@@_offset_pole:Nnnnnnn} % Transferring structures from one coffin to another requires that the % positions are updated by the offset between the two coffins. This is % done by mapping to the property list of the source coffins, moving @@ -1270,7 +1260,7 @@ % \end{macro} % % \begin{macro}{\@@_offset_corners:Nnn} -% \begin{macro}[aux]{\@@_offset_corner:Nnnnn} +% \begin{macro}{\@@_offset_corner:Nnnnn} % Saving the offset corners of a coffin is very similar, except that % there is no need to worry about naming: every corner can be saved % here as order is unimportant. @@ -1295,8 +1285,8 @@ % \end{macro} % % \begin{macro}{\@@_update_vertical_poles:NNN} -% \begin{macro}[aux]{\@@_update_T:nnnnnnnnN} -% \begin{macro}[aux]{\@@_update_B:nnnnnnnnN} +% \begin{macro}{\@@_update_T:nnnnnnnnN} +% \begin{macro}{\@@_update_B:nnnnnnnnN} % The \texttt{T} and \texttt{B} poles need to be recalculated % after alignment. These functions find the larger absolute value for % the poles, but this is of course only logical when the poles are @@ -1462,7 +1452,7 @@ % \end{variable} % % \begin{macro}{\coffin_mark_handle:Nnnn, \coffin_mark_handle:cnnn} -% \begin{macro}[aux]{\@@_mark_handle_aux:nnnnNnn} +% \begin{macro}{\@@_mark_handle_aux:nnnnNnn} % Marking a single handle is relatively easy. The standard attachment % function is used, meaning that there are two calculations for the % location. However, this is likely to be okay given the load expected. @@ -1529,9 +1519,9 @@ % \end{macro} % % \begin{macro}{\coffin_display_handles:Nn, \coffin_display_handles:cn} -% \begin{macro}[aux]{\@@_display_handles_aux:nnnnnn} -% \begin{macro}[aux]{\@@_display_handles_aux:nnnn} -% \begin{macro}[aux]{\@@_display_attach:Nnnnn} +% \begin{macro}{\@@_display_handles_aux:nnnnnn} +% \begin{macro}{\@@_display_handles_aux:nnnn} +% \begin{macro}{\@@_display_attach:Nnnnn} % Printing the poles starts by removing any duplicates, for which the % \texttt{H} poles is used as the definitive version for the baseline % and bottom. Two loops are then used to find the combinations of @@ -1666,38 +1656,41 @@ % \end{macro} % \end{macro} % -% \begin{macro}{\coffin_show_structure:N, \coffin_show_structure:c} +% \begin{macro} +% { +% \coffin_show_structure:N, \coffin_show_structure:c, +% \coffin_log_structure:N, \coffin_log_structure:c, +% \@@_show_structure:NN +% } % For showing the various internal structures attached to a coffin in % a way that keeps things relatively readable. If there is no apparent % structure then the code complains. % \begin{macrocode} -\cs_new_protected:Npn \coffin_show_structure:N #1 +\cs_new_protected:Npn \coffin_show_structure:N + { \@@_show_structure:NN \msg_show:nnxxxx } +\cs_generate_variant:Nn \coffin_show_structure:N { c } +\cs_new_protected:Npn \coffin_log_structure:N + { \@@_show_structure:NN \msg_log:nnxxxx } +\cs_generate_variant:Nn \coffin_log_structure:N { c } +\cs_new_protected:Npn \@@_show_structure:NN #1#2 { - \@@_if_exist:NT #1 + \@@_if_exist:NT #2 { - \__msg_show_pre:nnxxxx { LaTeX / kernel } { show-coffin } - { \token_to_str:N #1 } - { \dim_eval:n { \coffin_ht:N #1 } } - { \dim_eval:n { \coffin_dp:N #1 } } - { \dim_eval:n { \coffin_wd:N #1 } } - \__msg_show_wrap:n + #1 { LaTeX / kernel } { show-coffin } + { \token_to_str:N #2 } + { + \iow_newline: >~ ht ~=~ \dim_eval:n { \coffin_ht:N #2 } + \iow_newline: >~ dp ~=~ \dim_eval:n { \coffin_dp:N #2 } + \iow_newline: >~ wd ~=~ \dim_eval:n { \coffin_wd:N #2 } + } { \prop_map_function:cN - { l_@@_poles_ \__int_value:w #1 _prop } - \__msg_show_item_unbraced:nn + { l_@@_poles_ \int_eval:n {#2} _prop } + \msg_show_item_unbraced:nn } + { } } } -\cs_generate_variant:Nn \coffin_show_structure:N { c } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\coffin_log_structure:N, \coffin_log_structure:c} -% Redirect output of \cs{coffin_show_structure:N} to the log. -% \begin{macrocode} -\cs_new_protected:Npn \coffin_log_structure:N - { \__msg_log_next: \coffin_show_structure:N } -\cs_generate_variant:Nn \coffin_log_structure:N { c } % \end{macrocode} % \end{macro} % @@ -1724,11 +1717,8 @@ } \__msg_kernel_new:nnn { kernel } { show-coffin } { - Size~of~coffin~#1 : \\ - > ~ ht~=~#2 \\ - > ~ dp~=~#3 \\ - > ~ wd~=~#4 \\ - Poles~of~coffin~#1 : + Size~of~coffin~#1 : #2 \\ + Poles~of~coffin~#1 : #3 . } % \end{macrocode} % |