diff options
Diffstat (limited to 'macros/latex/required/tools/multicol.dtx')
-rw-r--r-- | macros/latex/required/tools/multicol.dtx | 72 |
1 files changed, 59 insertions, 13 deletions
diff --git a/macros/latex/required/tools/multicol.dtx b/macros/latex/required/tools/multicol.dtx index 2676d03aa1..4d86448002 100644 --- a/macros/latex/required/tools/multicol.dtx +++ b/macros/latex/required/tools/multicol.dtx @@ -86,11 +86,10 @@ %<*dtx> \ProvidesFile{multicol.dtx} %</dtx> -%<package>\NeedsTeXFormat{LaTeX2e}[2018-04-01] -%<package> -%<package>\providecommand\DeclareRelease[3]{} -%<package>\providecommand\DeclareCurrentRelease[2]{} %<package> +% For any rollback before 2017 load the 2017 version and hope for the best: +%<package>\DeclareRelease{}{1994-06-01}{multicol-2017-04-11.sty} +% %<package>\DeclareRelease{}{2017-04-11}{multicol-2017-04-11.sty} %<package>\DeclareRelease{v1.8}{2019-10-01}{multicol-2019-10-01.sty} %<package>\DeclareCurrentRelease{}{2021-11-15} @@ -99,10 +98,10 @@ %<driver> \ProvidesFile{multicol.drv} % \fi % \ProvidesFile{multicol.dtx} - [2023/03/30 v1.9f multicolumn formatting (FMi)] + [2024/05/23 v1.9h multicolumn formatting (FMi)] +% % % -%% % % \changes{v1.9c}{2021/11/30}{Added rollback to v1.8} % \changes{v1.5n}{1997/06/05}{Applied improvement of documentation, @@ -919,9 +918,22 @@ % And we don't show macro names in the margin. % \begin{macrocode} \setcounter{IndexColumns}{4} -\let\DescribeMacro\SpecialUsageIndex -\let\DescribeEnv\SpecialEnvIndex -\renewcommand\PrintMacroName[1]{} +% \end{macrocode} +% +% The following redefinitions have to be moved until after the +% preamble because version 3 of \pkg{doc} resets them after the +% premable (this is tmp, because \pkg{hypdoc} is not yet +% integrated, but as we all know, tmp solutions have a tendency to +% survive for a long time\ldots). +% \begin{macrocode} +\AddToHook{begindocument}{% + \let\DescribeMacro\SpecialUsageIndex + \let\DescribeEnv\SpecialEnvIndex + \renewcommand\PrintMacroName[1]{}% +} +% \end{macrocode} +% +% \begin{macrocode} \CodelineIndex %\DisableCrossrefs % Partial index \RecordChanges % Change log @@ -1082,7 +1094,7 @@ % better test for this situation. Otherwise, we will get a \TeX{} % stack overflow as this would generate a self-referencing definition. % \changes{v1.6e}{2004/02/14}{Avoid self-referencing definition of -% \cs{@footnotetext} (pr/3618)}. +% \cs{@footnotetext} (pr/3618)} % \begin{macrocode} \ifx\@footnotetext\mult@footnotetext \else @@ -2376,7 +2388,7 @@ % If |\raggedcolumns| is in force we add a |vfill| at the bottom by % unboxing the split box. % But we need to unbox anyway to ensure that at the end of the box -% we do not have unwanted space. This can sneak in in certain +% we do not have unwanted space. This can sneak in, in certain % situations, for example, if two lists follow each other and we % break between them. While such space is usually zero it still has % an effect because it hides depth of the last line in the column @@ -2925,7 +2937,11 @@ % We start by setting the kept marks by updating them with any % marks from this box. This has to be done \emph{before} we add a % penalty of $-10000$ to the top of the box, otherwise only an -% empty box will be considered. +% empty box will be considered. But even that is not enough: the box +% may contain \cs{columnbreak}s in which case doing some artifical +% splitting to get the marks out still fails to see all marks +% unless we take some special precaution in \cs{get@keptmarks} +% (which is now done). % \changes{v1.5h}{1994/08/26}{Get kept marks first} % \begin{macrocode} \get@keptmarks\mult@box @@ -3751,8 +3767,15 @@ % everything is split off. As a result |\splitfirstmark| and % |\splitbotmark| will contain the first and last mark in the box % respectively. +% +% Unfortunately, a simple \cs{vsplit} is not enough if the material +% contains forced breaks in that case we first have to get rid of +% those which is why we do this work in a separate macro that can +% call itself recursively. +% \changes{v1.9g}{2023/11/10}{Get rid of forced breaks for mark +% extraction (gh/1130)} % \begin{macrocode} - \setbox#1\vsplit#1to\maxdimen + \mc@get@all@box@marks #1% % \end{macrocode} % Therefore we can now set the kept marks which is a global % operation and afterwards close the group. This will restore the @@ -3773,6 +3796,29 @@ % \end{macro} % % +% \begin{macro}{\mc@get@all@box@marks} +% This macro splits a box to \cs{maxdimen} in order to get at the +% marks inside. If it turns out that we have a remainder after the +% split (e.g., if there was a \cs{columnbreak} in the material) we +% stitch the two parts together again (which omits the forced +% break) and recurse. Eventually, everything is split off and the +% split marks will then have the appropriate values. +% \changes{v1.9g}{2023/11/10}{Get rid of forced breaks for mark +% extraction (gh/1130)} +% \begin{macrocode} +\def\mc@get@all@box@marks #1{% + \setbox\@tempboxa\vsplit#1to\maxdimen + \ifvoid#1\else + \setbox#1\vbox{\unvbox\@tempboxa \unvbox#1}% + \mc@get@all@box@marks #1% + \fi +} +% \end{macrocode} +% \end{macro} +% +% +% +% % \begin{macro}{\set@keptmarks} % The macro |\set@keptmarks| is responsible for setting % |\kept@firstmark| and |\kept@botmark|, by checking the current |