summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-08-05 13:28:35 +0000
committerKarl Berry <karl@freefriends.org>2009-08-05 13:28:35 +0000
commitee03b9da50173f49e8224ca79e2e6a99db620923 (patch)
tree7669887f57b62cb9c3777886864f05b844e7c611 /Master/texmf-dist
parent57492ca80acec7230b5a56b6cea74388c7b8f6f6 (diff)
cellspace update (3aug09)
git-svn-id: svn://tug.org/texlive/trunk@14534 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/cellspace/README6
-rw-r--r--Master/texmf-dist/doc/latex/cellspace/cellspace.pdfbin469567 -> 340602 bytes
-rw-r--r--Master/texmf-dist/doc/latex/cellspace/cellspace.tex50
-rw-r--r--Master/texmf-dist/tex/latex/cellspace/cellspace.sty25
4 files changed, 72 insertions, 9 deletions
diff --git a/Master/texmf-dist/doc/latex/cellspace/README b/Master/texmf-dist/doc/latex/cellspace/README
index 3a0f0ff47b7..cd395219f2c 100644
--- a/Master/texmf-dist/doc/latex/cellspace/README
+++ b/Master/texmf-dist/doc/latex/cellspace/README
@@ -1,4 +1,4 @@
-% (C) 2006 Josselin Noirel
+% (C) 2006-2009 Josselin Noirel
%
% Package cellspace: Ensuring a minimal spacing of table cells.
%
@@ -12,3 +12,7 @@ the amsmath package) a \dfrac{1}{2} surrounded by \hlines touches the
horizontal rules. This package provides a modifier S to usual column
types (l, c, r, p, m, and b) that ensures a minimal spacing between rules
and cells of an array.
+
+v1.6: New feature as suggested by Bastien Roucaries - an option [math]
+has been introduced, which allows to use cellspace's features into
+matrix environments.
diff --git a/Master/texmf-dist/doc/latex/cellspace/cellspace.pdf b/Master/texmf-dist/doc/latex/cellspace/cellspace.pdf
index b783f21e292..62baa91cfa9 100644
--- a/Master/texmf-dist/doc/latex/cellspace/cellspace.pdf
+++ b/Master/texmf-dist/doc/latex/cellspace/cellspace.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/cellspace/cellspace.tex b/Master/texmf-dist/doc/latex/cellspace/cellspace.tex
index 1fb49022071..ccfde640689 100644
--- a/Master/texmf-dist/doc/latex/cellspace/cellspace.tex
+++ b/Master/texmf-dist/doc/latex/cellspace/cellspace.tex
@@ -1,4 +1,4 @@
-% (C) 2006 Josselin Noirel
+% (C) 2006-2009 Josselin Noirel
%
% Package cellspace: Ensuring a minimal spacing of table cells.
%
@@ -9,7 +9,7 @@
\def \filedate {#4}%
\def \fileversion {v#3}%
}
-\tempa $Id: cellspace.tex,v 1.2 2006/03/13 19:28:10 noirel Exp $
+\tempa $Id: cellspace.tex,v 1.6 2009/07/31 09:00:00 noirel Exp $
\ProvidesFile{cellspace}%
[\filedate \space \fileversion \space cellspace documentation (JN)]
\pdfoutput = 1
@@ -28,7 +28,7 @@
\usepackage{lmodern}
\usepackage{microtype}
\usepackage[a4paper, margin = 1.3in]{geometry}
-\usepackage{cellspace}
+\usepackage[math]{cellspace}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{moreverb}
@@ -157,7 +157,8 @@ and need fine tuning.
\section{How to solve this?}
The \pack{cellspace} loads several packages to carry out its job:
-\pack{array}, \pack{ifthen}, and~\pack{calc}. It redefines several
+\pack{array}, \pack{ifthen}, and~\pack{calc} (along \tex{amsmath} when
+the option \tex{math} is passed to \tex{cellspace}). It redefines several
internals, still not too many (\cmd{@startpbox} and \cmd{@endpbox}). By
default, the tables will behave as usual. To improve the spacing of your
tables, you must change the table preamble and prepend \tex{S} to the
@@ -224,8 +225,8 @@ bottom space limits.
%
Some space is added at the top the first row because it doesn't fulfil
the condition imposed by the package. Similarly some space is added at
-the below the first row. It has to be noticed that no space
-is added however in other rows because they are far enough from the cell
+the bottom of the first row. It has to be noted, however, that no space
+is added in other rows because they are far enough from the cell
separations.
\compare{%
@@ -321,6 +322,43 @@ The following example shows that how it works with paragraph columns.
\end{tabular}
}
+\section{Matrices}
+
+The package can be loaded with the options \tex{nomath} (default) and
+\tex{math}. The latter does two things: it first loads the
+\tex{amsmath} package and then redefines
+the command that is invoked when one typesets matrices
+(\tex{\textbackslash env@matrix} --- this improvement was suggested by
+Bastien Roucaries). The following
+examples illustrate what happens with (left) or without (right)
+\pack{cellspace}'s correction in a \tex{pmatrix} environment.
+%
+\[
+\begingroup
+\makeatletter
+ \def\env@matrix{\hskip -\arraycolsep
+ \let\@ifnextchar\new@ifnextchar
+ \array{*\c@MaxMatrixCols c}}
+\makeatother
+%
+\text{\tex{nomath} option\ }%
+\begin{pmatrix}
++\frac{1}{2} & +\frac{1}{3} \\
+-\frac{1}{3} & +\frac{1}{2} \\
+\end{pmatrix}
+\endgroup
+\qquad
+\text{\tex{math} option\ }%
+\begin{pmatrix}
++\frac{1}{2} & +\frac{1}{3} \\
+-\frac{1}{3} & +\frac{1}{2} \\
+\end{pmatrix}
+\]
+
+As a~consequence, the \tex{amsmath} package can be loaded beforehand
+with other packages (such as \tex{empheq} or \tex{mathtools}), were an
+incompatibility to arise from one's loading it later.
+
\section{Bugs and limitations}
This package hasn't been heavily tested, so there may be plenty of bugs.
diff --git a/Master/texmf-dist/tex/latex/cellspace/cellspace.sty b/Master/texmf-dist/tex/latex/cellspace/cellspace.sty
index 0da49c33eca..387025e669d 100644
--- a/Master/texmf-dist/tex/latex/cellspace/cellspace.sty
+++ b/Master/texmf-dist/tex/latex/cellspace/cellspace.sty
@@ -1,4 +1,4 @@
-% (C) 2006 Josselin Noirel
+% (C) 2006-2009 Josselin Noirel
%
% Package cellspace: Ensuring a minimal spacing of table cells.
%
@@ -9,7 +9,7 @@
\def \filedate {#4}%
\def \fileversion {v#3}%
}
-\@tempa $Id: cellspace.sty,v 1.5 2006/03/13 19:28:10 noirel Exp $
+\@tempa $Id: cellspace.sty,v 1.6 2009/07/31 09:00:00 noirel Exp $
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{cellspace}%
@@ -39,6 +39,7 @@
\newboolean{cellspace@lr} % Is it a LR column type ?
\newboolean{cellspace@} % Is it a paragraph column that needs to be
% spaced out?
+\newboolean{cellspace@m} % [math] option: matrices
\@ifdefinable \cellspacetoplimit {\newdimen \cellspacetoplimit}
\@ifdefinable \cellspacebottomlimit {\newdimen \cellspacebottomlimit}
@@ -48,6 +49,14 @@
\setlength{\cellspacetoplimit}{1pt}
\setlength{\cellspacebottomlimit}{1pt}
+% Options
+
+\DeclareOption{math}{\setboolean{cellspace@m}{true}}
+\DeclareOption{nomath}{\setboolean{cellspace@m}{false}}
+
+\ExecuteOptions{nomath}
+\ProcessOptions
+
% 4. Redefinitions
\renewcommand*{\@startpbox}[1]{%
@@ -111,6 +120,18 @@
\let \@@startpbox = \@startpbox
\let \@@endpbox = \@endpbox
+% Make it work with matrices
+% 31 Jul 2009: suggested by Bastien Roucaries (for a long time)
+
+\ifcellspace@m
+ \RequirePackage{amsmath}%
+ \def \env@matrix {%
+ \hskip -\arraycolsep
+ \let \@ifnextchar \new@ifnextchar
+ \array{*{\c@MaxMatrixCols}{>{$}Sc<{$}}@{}}%
+ }
+\fi
+
% 5. Defining a prefix
\newcolumntype{S}[1]{>{\bcolumn #1\@nil}#1<{\ecolumn}}