[latex3-commits] [git/LaTeX3-latex3-latex2e] array-doc: extended array documentation with respect to \\ behavior (7ed5a363)
Frank Mittelbach
frank.mittelbach at latex-project.org
Sun Jan 10 00:37:03 CET 2021
Repository : https://github.com/latex3/latex2e
On branch : array-doc
Link : https://github.com/latex3/latex2e/commit/7ed5a3639f79b3d2d9740471fb3d7806034df4d4
>---------------------------------------------------------------
commit 7ed5a3639f79b3d2d9740471fb3d7806034df4d4
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date: Sun Jan 10 00:37:03 2021 +0100
extended array documentation with respect to \\ behavior
>---------------------------------------------------------------
7ed5a3639f79b3d2d9740471fb3d7806034df4d4
required/tools/array.dtx | 56 +++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 53 insertions(+), 3 deletions(-)
diff --git a/required/tools/array.dtx b/required/tools/array.dtx
index ff963d7f..a390892b 100644
--- a/required/tools/array.dtx
+++ b/required/tools/array.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 1993-2020
+% Copyright (C) 1993-2021
%
% The LaTeX3 Project and any individual authors listed elsewhere
% in this file.
@@ -33,7 +33,7 @@
%<+package>\DeclareCurrentRelease{}{2020-10-01}
%<+package>
%<+package>\ProvidesPackage{array}
-%<+package> [2020/10/01 v2.5c Tabular extension package (FMi)]
+%<+package> [2021/01/09 v2.5c Tabular extension package (FMi)]
%
% \fi
%
@@ -188,7 +188,7 @@
% David Carlisle\thanks{David kindly agreed on the inclusion
% of the \texttt{\textbackslash{}newcolumntype} implementation,
% formerly in
-% \texttt{newarray.sty} into this package }}
+% \texttt{newarray.sty} into this package.}}
%
% \date{Printed \today}
%
@@ -361,6 +361,56 @@
% columns have predefined widths.
% \end{itemize}
%
+%
+% \subsection{The behavior of the \texttt{\string\\} command}
+%
+% In the basic \texttt{tabular} implementation of \LaTeX{} the \cs{\bslash}
+% command ending the rows of the \texttt{tabular} or \texttt{array} has
+% a somewhat inconsistent behavior if its optional argument is used. The
+% result then depends on the type of rightmost column and as remarked in
+% Leslie Lamport's \LaTeX{} manual~\cite{bk:lamport} may not always produce the
+% expected extra space.
+%
+%
+% Without the \textsf{array} package the extra space requested by the
+% optional argument of \cs{\bslash} is measured from the last baseline of
+% the rightmost column (indicated by ``x'' in the following
+% example). As a result, swapping the column will give different
+% results:
+% \begin{verbatim}
+% \begin{tabular}[t]{lp{1cm}}
+% 1 & 1\newline x \\[20pt] 2 & 2 \end{tabular}
+% \begin{tabular}[t]{p{1cm}l}
+% 1\newline 1 & x \\[20pt] 2 & 2 \end{tabular}
+% \end{verbatim}
+% \pagebreak
+% If you run this without the \textsf{array} package you will get the
+% following result:
+% \begin{center}
+% \begin{tabular}[t]{lp{1cm}}
+% 1 & 1\newline x \\[32pt] 2 & 2 \end{tabular}
+% \begin{tabular}[t]{p{1cm}l}
+% 1\newline 1 & x \\[20pt] 2 & 2 \end{tabular}
+% \end{center}
+% In contrast, when the \textsf{array} package is loaded, the requested
+% space in the optional argument is always measured from the baseline of
+% the whole row and not from the last baseline of the rightmost column, thus
+% swapping columns doesn't change the spacing and we same table height
+% with an effective 8pt of extra space (as the second line already takes
+% up 12pt of the requested 20pt):
+% \begin{center}
+% \begin{tabular}[t]{lp{1cm}}
+% 1 & 1\newline x \\[20pt] 2 & 2 \end{tabular}
+% \begin{tabular}[t]{p{1cm}l}
+% 1\newline 1 & x \\[20pt] 2 & 2 \end{tabular}
+% \end{center}
+%
+% This correction of behavior only makes a difference if the rightmost column
+% is a \texttt{p}-column. Thus if you add the \textsf{array}
+% package to an existing document, you should verify the spacing in all
+% tables that have this kind of structure.
+%
+%
% \subsection{Defining new column specifiers}
%
% \DeleteShortVerb{\=}
More information about the latex3-commits
mailing list.