diff options
Diffstat (limited to 'macros/latex-dev/required/tools/multicol.dtx')
-rw-r--r-- | macros/latex-dev/required/tools/multicol.dtx | 60 |
1 files changed, 49 insertions, 11 deletions
diff --git a/macros/latex-dev/required/tools/multicol.dtx b/macros/latex-dev/required/tools/multicol.dtx index aa21d75f07..2676d03aa1 100644 --- a/macros/latex-dev/required/tools/multicol.dtx +++ b/macros/latex-dev/required/tools/multicol.dtx @@ -20,7 +20,7 @@ % \iffalse This is a METACOMMENT % %% Package `multicol' to use with LaTeX2e -%% Copyright 1989-2019 Frank Mittelbach +%% Copyright 1989-2023 Frank Mittelbach %% %% In addition to the terms of LPPL any distributed version %% (unchanged or modified) of multicol has to keep the statement @@ -99,7 +99,7 @@ %<driver> \ProvidesFile{multicol.drv} % \fi % \ProvidesFile{multicol.dtx} - [2021/11/30 v1.9d multicolumn formatting (FMi)] + [2023/03/30 v1.9f multicolumn formatting (FMi)] % % %% @@ -1760,14 +1760,27 @@ \kept@firstmark \return@nonemptymark{bot}% \kept@botmark - \page@sofar +% \end{macrocode} +% When the boxed multicol is returned to the page it can happen +% that it doesn't fit onto it and \LaTeX{} therefore breaks +% earlier. The problem in that case is that during the generation +% \cs{hsize}, etc.\ got changed and this setting is still in effect +% right now, and if this boxed multicol is within, say, +% \texttt{multicols*} then its output routine gets very upset. We +% therefore delay returning the result by saving it in box for now +% until we have left the group below. +% \changes{v1.9e}{2023/02/25}{Delay returning boxed multicols (gh/1002)} +% \begin{macrocode} + \global\setbox\mc@boxedresult\vbox{% + \page@sofar % \end{macrocode} % % \begin{macrocode} - \global\let\kept@firstmark - \l@kept@firstmark - \global\let\kept@botmark - \l@kept@botmark + \global\let\kept@firstmark + \l@kept@firstmark + \global\let\kept@botmark + \l@kept@botmark + }% %<*marktrace> \mult@info\tw@ {Restore kept marks to\MessageBreak @@ -1879,12 +1892,15 @@ % \end{macrocode} % Now it's time to return any footnotes if we are in unrestricted % mode. In boxed mode footnotes are kept inside, but in that case -% we have to write another column status into the \texttt{.aux} +% we have to first return the saved box to the page and then write +% another column status into the \texttt{.aux} % file to support \cs{docolaction} in case we have nested % environments. % \changes{v1.8s}{2018/04/20}{Support for \cs{docolaction} (issue/39)} +% \changes{v1.9e}{2023/02/25}{Delay returning boxed multicols (gh/1002)} % \begin{macrocode} \if@boxedmulticols + \unvbox\mc@boxedresult \mc@col@status@write \else \reinsert@footnotes @@ -1949,6 +1965,7 @@ % \SpecialMainIndex{\multicolsep} % \SpecialMainIndex{\multicolbaselineskip} % \SpecialMainIndex{\partial@page} +% \SpecialMainIndex{\mc@boxedresult} % Let us end this section by allocating all the registers used so % far. % \begin{macrocode} @@ -1970,6 +1987,7 @@ \newskip\multicolbaselineskip \newbox\partial@page \newbox\last@line +\newbox\mc@boxedresult % \end{macrocode} % And here are their default values: % \begin{macrocode} @@ -2119,8 +2137,9 @@ % of the character ``p'' since that is one of the depths that % compete for the maximum. % \changes{v1.6a}{2003/03/15}{Preparing for adjusting \cs{prevdepth}} +% \changes{v1.9f}{2023/03/30}{Make column min depth customizable (gh/698)} % \begin{macrocode} - \setbox\z@\hbox{p}\global\dimen\tw@\dp\z@ + \setbox\z@\hbox{\multicolmindepthstring}\global\dimen\tw@\dp\z@ \moveright\multicol@leftmargin \hbox to\full@width{% % \end{macrocode} @@ -2135,9 +2154,11 @@ % The depths of the columns depend on their last lines. To ensure % that we will always get a similar look as far as the rules are % concerned we force the depth to be at least the depth of a -% letter~`p' (which is what we set |\dimen2| to above). +% letter~`p' or more exactly \cs{multicolmindepthstring} (which is what +% we set |\dimen2| to above). +% \changes{v1.9f}{2023/03/30}{Make column min depth customizable (gh/698)} % \begin{macrocode} - \rlap{\phantom p}% + \rlap{\phantom \multicolmindepthstring}% }% % \end{macrocode} % The processed material might consist of a last line with a @@ -2179,6 +2200,23 @@ % \end{macrocode} % \end{macro} % +% +% \begin{macro}{\multicolmindepthstring} +% The default minimum depth of each column corresponds to the depth +% of a `p' in the current font. This makes sense for Latin-based +% languages and was hard-wired intitially, but for Asian languages +% it is better to use a zero depth (and alternatively one might +% want to use the depth of a strut or a parentheses). So we now +% offer a way to adjust this while maintaining backward +% compatibility. Use \cs{renewcommand} to alter it. +% \changes{v1.9f}{2023/03/30}{Make column min depth customizable (gh/698)} +% \begin{macrocode} +\def\multicolmindepthstring{p} +% \end{macrocode} +% \end{macro} +% +% +% % \begin{macro}{\columnseprulecolor} % \changes{v1.6f}{2006/09/19}{Make the color of the rule a hook} % By default the vertical rule between columns will be in |\normalcolor|. |