[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: Gh698 (#1029) (719e158f)
GitHub
noreply at github.com
Sat Apr 1 13:50:24 CEST 2023
Repository : https://github.com/latex3/latex2e
On branch : develop
Link : https://github.com/latex3/latex2e/commit/719e158f0e4c224a650a402c8ebbf1ec0e513a8a
>---------------------------------------------------------------
commit 719e158f0e4c224a650a402c8ebbf1ec0e513a8a
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date: Sat Apr 1 13:50:24 2023 +0200
Gh698 (#1029)
* fix #698 by implementing parts of the suggestion
* the multicol change shows in the patch for tagging
>---------------------------------------------------------------
719e158f0e4c224a650a402c8ebbf1ec0e513a8a
base/doc/ltnews37.tex | 19 ++++++-
required/latex-lab/latex-lab-new-or-1.dtx | 6 +-
required/tools/changes.txt | 12 +++-
required/tools/multicol.dtx | 28 ++++++++--
required/tools/testfiles/github-0698.lvt | 65 ++++++++++++++++++++++
.../tools/testfiles/github-0698.tlg | 5 +-
6 files changed, 123 insertions(+), 12 deletions(-)
diff --git a/base/doc/ltnews37.tex b/base/doc/ltnews37.tex
index e15c4bca..d24e7f73 100644
--- a/base/doc/ltnews37.tex
+++ b/base/doc/ltnews37.tex
@@ -515,7 +515,24 @@ This is fixed in the present \LaTeX{} release.
\section{Changes to packages in the \pkg{tools} category}
-\subsection{Fix handling of nested \env{multicols}}
+\subsection{\pkg{multicol}: Fix handling of nested environments}
+
+The default minimum depth of each column in a \env{multicols}
+corresponds to the depth of a \enquote{p} in the current font. This
+helps to get some uniformity if rules are used between the columns and
+makes sense for Latin-based languages. Until now it was hard-wired,
+but for CJK languages it is better to use a zero depth because there
+all characters have the same height and depth. And even with
+Latin-based languages one might want to use the depth of a \cs{strut}
+or that of a parenthesis. So we now offer a way to adjust this while
+maintaining backward compatibility. Just redefine
+\cs{multicolmindepthstring} to hold whatever you want to get measured
+for its depth (the width is not relevant).
+%
+\githubissue{698}
+
+
+\subsection{\pkg{multicol}: Fix handling of nested environments}
If \env{multicols} environments have been nested into each other (the
inner one boxed) it could fail if the boxed environment appeared near a
diff --git a/required/latex-lab/latex-lab-new-or-1.dtx b/required/latex-lab/latex-lab-new-or-1.dtx
index b3e763ff..ef799e81 100644
--- a/required/latex-lab/latex-lab-new-or-1.dtx
+++ b/required/latex-lab/latex-lab-new-or-1.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: latex-lab-new-or-1.dtx (C) Copyright 2020-2022 Frank Mittelbach
+%% File: latex-lab-new-or-1.dtx (C) Copyright 2020-2023 Frank Mittelbach
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -128,9 +128,9 @@
%
% \begin{macrocode}
\patchcmd\page at sofar
- {\setbox\z@\hbox{p}\global\dimen\tw@\dp\z@}%
+ {\global\dimen\tw@\dp\z@}%
{%
- \setbox\z@\hbox{p}\global\dimen\tw@\dp\z@
+ \global\dimen\tw@\dp\z@
\@mult at ptagging@hook
}%
{\typeout{Patching \string\page at sofar\space for tagging}}{\PATCHerror}%
diff --git a/required/tools/changes.txt b/required/tools/changes.txt
index 95a3d685..f41e929f 100644
--- a/required/tools/changes.txt
+++ b/required/tools/changes.txt
@@ -5,9 +5,11 @@ completeness or accuracy and it contains some references to files that
are not part of the distribution.
=======================================================================
-================================================================================
-All changes above are only part of the development branch for the next release.
-================================================================================
+2023-03-30 Frank Mittelbach <Frank.Mittelbach at latex-project.org>
+
+ * multicol.dtx (subsection{The output routines}]):
+ Make column min depth customizable through the command
+ \multicolmindepthstring defaulting to 'p' (gh/698)
2023-02-25 Frank Mittelbach <Frank.Mittelbach at latex-project.org>
@@ -15,6 +17,10 @@ All changes above are only part of the development branch for the next release.
Delay returning boxed multicols so that all parameters get restored first
in case the boxed multicols is used into another multicols (gh/1002)
+================================================================================
+All changes above are only part of the development branch for the next release.
+================================================================================
+
#########################
# 2022-11-01 Release
#########################
diff --git a/required/tools/multicol.dtx b/required/tools/multicol.dtx
index 16f28bff..2676d03a 100644
--- a/required/tools/multicol.dtx
+++ b/required/tools/multicol.dtx
@@ -99,7 +99,7 @@
%<driver> \ProvidesFile{multicol.drv}
% \fi
% \ProvidesFile{multicol.dtx}
- [2023/02/25 v1.9e multicolumn formatting (FMi)]
+ [2023/03/30 v1.9f multicolumn formatting (FMi)]
%
%
%%
@@ -2137,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 at leftmargin
\hbox to\full at width{%
% \end{macrocode}
@@ -2153,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
@@ -2197,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|.
diff --git a/required/tools/testfiles/github-0698.lvt b/required/tools/testfiles/github-0698.lvt
new file mode 100644
index 00000000..63185cbd
--- /dev/null
+++ b/required/tools/testfiles/github-0698.lvt
@@ -0,0 +1,65 @@
+
+\documentclass{article}
+
+\usepackage{multicol}
+
+\setlength\columnseprule{0.5pt}
+
+\newcommand\embox{\fbox{\setlength\fboxsep{0pt}\phantom{\vrule width 1em height 0.88em depth 0.12em}}}
+
+
+\input{test2e}
+
+\begin{document}
+
+\START
+
+
+\begin{multicols}{3}
+ A a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
+ A a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
+ A a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
+ A a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
+ A a a a a a a a a a\hrulefill\
+\end{multicols}
+\typeout{==>\the\dimen2\space\space(makes use of an implementation detail)}
+
+\renewcommand\multicolmindepthstring{(}
+
+\begin{multicols}{3}
+ A a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
+ A a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
+ A a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
+ A a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
+ A a a a a a a a a a\hrulefill\
+\end{multicols}
+\typeout{==>\the\dimen2 }
+
+\renewcommand\multicolmindepthstring{\vrule depth 10pt}
+
+\begin{multicols}{3}
+ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ %
+ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ %
+ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ %
+ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ %
+ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\hrulefill\
+\end{multicols}
+\typeout{==>\the\dimen2 }
+
+\renewcommand\multicolmindepthstring{}
+\topskip=.88em
+
+\begin{multicols}{3}
+ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ %
+ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ %
+ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ %
+ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ %
+ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\ \embox\allowbreak\hrulefill\
+\end{multicols}
+\typeout{==>\the\dimen2 }
+
+
+\newpage
+\OMIT
+\end{document}
+
diff --git a/base/testfiles/tlb-negfloat-001.tlg b/required/tools/testfiles/github-0698.tlg
similarity index 55%
copy from base/testfiles/tlb-negfloat-001.tlg
copy to required/tools/testfiles/github-0698.tlg
index 21c2e49c..85e76014 100644
--- a/base/testfiles/tlb-negfloat-001.tlg
+++ b/required/tools/testfiles/github-0698.tlg
@@ -1,5 +1,8 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
+==>1.94444pt (makes use of an implementation detail)
+==>2.5pt
+==>10.0pt
+==>4.59995pt
[1
-Float Output
]
More information about the latex3-commits
mailing list.