[latex3-commits] [latex3/latex2e] ltmarks-multicol: update after JAW review (4feb07e8e)

github at latex-project.org github at latex-project.org
Thu Nov 14 20:55:15 CET 2024


Repository : https://github.com/latex3/latex2e
On branch  : ltmarks-multicol
Link       : https://github.com/latex3/latex2e/commit/4feb07e8e2cbdf966279d7521a8a1d94b2eb6220

>---------------------------------------------------------------

commit 4feb07e8e2cbdf966279d7521a8a1d94b2eb6220
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Thu Nov 14 20:55:15 2024 +0100

    update after JAW review


>---------------------------------------------------------------

4feb07e8e2cbdf966279d7521a8a1d94b2eb6220
 required/tools/multicol.dtx | 43 +++++++++++++++++++++----------------------
 1 file changed, 21 insertions(+), 22 deletions(-)

diff --git a/required/tools/multicol.dtx b/required/tools/multicol.dtx
index 92751fc1a..a8dea06c5 100644
--- a/required/tools/multicol.dtx
+++ b/required/tools/multicol.dtx
@@ -99,7 +99,7 @@
 %<driver> \ProvidesFile{multicol.drv}
 % \fi
 %         \ProvidesFile{multicol.dtx}
-          [2024/11/09 v2.0a  multicolumn formatting (FMi)]
+          [2024/11/14 v2.0a  multicolumn formatting (FMi)]
 %
 %
 %
@@ -4343,13 +4343,13 @@
 %
 %
 %
-%  \begin{macro}{\g_mc_curr_col_int}
+%  \begin{macro}{\g_@@_curr_col_int}
 %    Counter for tracking the current column number. At the start of a
 %    \mc{} environment is holds the number of columns for
 %    which there is currently \texttt{mcol-...} data (i.e., the number
 %    of columns in the last \mc{} environment). 
 %    \begin{macrocode}
-\int_new:N \g_mc_curr_col_int
+\int_new:N \g_@@_curr_col_int
 %    \end{macrocode}
 %  \end{macro}
 %
@@ -4380,7 +4380,7 @@
 %    column structures am error as they are no longer valid (or at
 %    least empty them, not sure what is better).
 %    \begin{macrocode}
-  \int_step_inline:nnn {\col at number + 1} { \g_mc_curr_col_int }
+  \int_step_inline:nnn {\col at number + 1} { \g_@@_curr_col_int }
              { \__mark_set_structure_to_err:n { mcol - ##1 } }
 %    \end{macrocode}
 %
@@ -4391,7 +4391,7 @@
 %    Once we have done this we reset the column counter for further
 %    processing.
 %    \begin{macrocode}
-  \int_gset:Nn \g_mc_curr_col_int {1}
+  \int_gset:Nn \g_@@_curr_col_int {1}
 %    \end{macrocode}
 %    Now we loop through all the assembled column material, using the
 %    \texttt{column} and \texttt{previous-column} regions as an
@@ -4405,14 +4405,14 @@
              {\unvcopy\count@} 
 %    \end{macrocode}
 %    Once the \texttt{column} region got updated we copy it to
-%    \texttt{mcol-\meta{\cs{\detokenize{g_mc_curr_col_int}}}} and then increment
+%    \texttt{mcol-\meta{\cs{\detokenize{g_@@_curr_col_int}}}} and then increment
 %    the counter.
 %    \begin{macrocode}
         \__mark_copy_structure:nn
-             {mcol - \int_use:N\g_mc_curr_col_int }
+             {mcol - \int_use:N\g_@@_curr_col_int }
 %fmi             {mcol}
              {column}
-        \int_gincr:N \g_mc_curr_col_int
+        \int_gincr:N \g_@@_curr_col_int
       }
 %    \end{macrocode}
 %    The above loop takes care of all columns, except for the last one
@@ -4423,7 +4423,7 @@
      {column}
      {\unvcopy\mult at rightbox}
   \__mark_copy_structure:nn
-     { mcol - \int_use:N\g_mc_curr_col_int }
+     { mcol - \int_use:N\g_@@_curr_col_int }
 %fmi     {mcol}
      {column}
 %    \end{macrocode}
@@ -4506,11 +4506,11 @@
 %  \end{macro}
 %
 %
-%  \begin{macro}{mc at reinsert@marks}
+%  \begin{macro}{\mc at reinsert@marks}
 %    So reinserting it just means executing the token lists (with some
 %    surrounding debugging statements).
 %    \begin{macrocode}
-\def\mc at reinsert@marks{
+\cs_new_protected:Npn \mc at reinsert@marks{
   \@@_debug_marks:n
      { \typeout{Marks:~ --~ reinsert~ marks~ (multicol)} }
      \l_@@_first_marks_tl \l_@@_last_marks_tl
@@ -4530,7 +4530,7 @@
 %    would be used to generate the top marks and that would be
 %    obviously wrong for the first column.
 %    \begin{macrocode}
-\def \mc at prepare@mark at regions {
+\cs_new_protected:Npn \mc at prepare@mark at regions {
 %    \end{macrocode}
 %    However, before we do this we need to save away the current
 %    column data in case this is a boxed multicol, because when that
@@ -4539,9 +4539,8 @@
 %    \texttt{column} region is overwritten in the standard output
 %    routine by copying the \texttt{page} region.
 %    \begin{macrocode}
-  \if at boxedmulticols
-    \__mark_copy_structure:nn{saved-column}{column}
-  \fi
+  \legacy_if:nT { @boxedmulticols }
+    { \__mark_copy_structure:nn{saved-column}{column} }
   \@@_debug_marks:n
      { \typeout{Marks:~ empty~ mcol~ regions~ (multicol)} }
   \__mark_clear_structure:n {column}
@@ -4557,7 +4556,7 @@
 %    galley. in that situation we do have to prepare the
 %    \texttt{mcol-...}  regions and also do this reinsertion.
 %    \begin{macrocode}
-\def \mc at handle@marks at and@reinserts #1 {
+\cs_new_protected:Npn \mc at handle@marks at and@reinserts #1 {
   \@@_update_mcol_structures:
 %    \end{macrocode}
 %    Show the current region status when debugging:
@@ -4571,9 +4570,8 @@
 %    Finally, we restore the \texttt{column} region in case this was a
 %    boxed \mc{} environment.
 %    \begin{macrocode}
-  \if at boxedmulticols
-    \__mark_copy_structure:nn {column}{saved-column}
-  \fi
+  \legacy_if:nT { @boxedmulticols }
+    { \__mark_copy_structure:nn {column}{saved-column} }
 }
 
 %    \end{macrocode}
@@ -4586,7 +4584,7 @@
 %    have to update the \texttt{mcol-...} regions but also the
 %    \texttt{page} region.
 %    \begin{macrocode}
-\def \mc at handle@col at andpage@marks #1 {
+\cs_new_protected:Npn \mc at handle@col at andpage@marks #1 {
   \@@_update_mcol_structures:
   \@@_update_page_structures:
 %    \end{macrocode}
@@ -4605,10 +4603,11 @@
 %    is loaded, but eventually this will move to the kernel which then
 %    also simplifies the definitions for \cs{markboth} and friends.
 %
+%    These commands should be expandable, so no protection.
 %    \changes{v2.0a}{2024/11/10}{Use the new mark mechanism}
 %    \begin{macrocode}
-\def\leftmark{\mark_use_last:nn{page}{2e-left}}
-\def\rightmark{\mark_use_first:nn{page}{2e-right}}
+\cs_set:Npn \leftmark {\mark_use_last:nn{page}{2e-left}}
+\cs_set:Npn \rightmark {\mark_use_first:nn{page}{2e-right}}
 %    \end{macrocode}
 %  \end{macro}
 %





More information about the latex3-commits mailing list.