summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/spacingtricks/spacingtricks.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-11-03 03:02:09 +0000
committerNorbert Preining <norbert@preining.info>2020-11-03 03:02:09 +0000
commit7d12aa3abfed48004f4fb8fa84ee757b6f900726 (patch)
tree684cb1d606f8571edf8bb93cb53b4952f6835bee /macros/latex/contrib/spacingtricks/spacingtricks.dtx
parentede2cee3dfac406ff8defae5014e86c839b852ca (diff)
CTAN sync 202011030302
Diffstat (limited to 'macros/latex/contrib/spacingtricks/spacingtricks.dtx')
-rw-r--r--macros/latex/contrib/spacingtricks/spacingtricks.dtx49
1 files changed, 29 insertions, 20 deletions
diff --git a/macros/latex/contrib/spacingtricks/spacingtricks.dtx b/macros/latex/contrib/spacingtricks/spacingtricks.dtx
index 698b64dcb3..3c22a98a8a 100644
--- a/macros/latex/contrib/spacingtricks/spacingtricks.dtx
+++ b/macros/latex/contrib/spacingtricks/spacingtricks.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2019 by Antoine Missier <antoine.missier@ac-toulouse.fr>
+% Copyright (C) 2019-2020 by Antoine Missier <antoine.missier@ac-toulouse.fr>
%
% This file may be distributed and/or modified under the conditions of
% the LaTeX Project Public License, either version 1.3 of this license
@@ -20,7 +20,7 @@
%<*package>
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{spacingtricks}
- [2019/09/09 v1.2 .dtx spacingtricks file]
+ [2020/11/02 v1.3 .dtx spacingtricks file]
%</package>
%<*driver>
\documentclass{ltxdoc}
@@ -54,7 +54,7 @@
%</driver>
% \fi
%
-% \CheckSum{905}
+% \CheckSum{165}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -78,20 +78,21 @@
% \changes{v1.0}{2019/06/16}{English translation of the documentation}
% \changes{v1.1}{2019/09/06}{No automatic line breaking at the end of the centered command,
% new length compactitemlist}
-% \changes{v1.2}{2019/09/09}{Removing par command to get the expected centered macro}
+% \changes{v1.2}{2019/09/09}{A bug correction in the last update}
+% \changes{v1.3}{2020/11/02}{Loading the setspace package,
+% small changes in compactlist environment, improvement in dualboxes macro}
%
% \GetFileInfo{spacingtricks.sty}
%
% \title{The \texttt{spacingtricks} package\thanks{This document
% corresponds to \textsf{spacingtricks}~\fileversion, dated \filedate.}}
% \author{Antoine Missier \\ \texttt{antoine.missier@ac-toulouse.fr}}
-% \date{September 09, 2019}
+% \date{November 02, 2020}
% \maketitle
%
% \section{Introduction}
%
-% This package proposes some macros to deal with spacing issues. Thus:
-%
+% This package offers some macros to deal with spacing issues. Thus:
% \begin{compactlist}
% \item "\centered" yields good horizontal centering without vertical spacing;
% \item "\footnote" has been redefined to avoid unsuitable spacings;
@@ -109,15 +110,18 @@
% (figures, tables, text) side by side by adjusting the vertical positioning.
% \end{compactlist}
%
+% \medskip
+% Two other common packages are loaded by \textsf{spacingtricks}:
+% \textsf{setspace} (natively in \LaTeXe),
+% for setting line spacing in a piece of text
+% (with the \texttt{spacing} environment), and
+% \textsf{xspace}~\cite{XSP}, which adds an interword space unless the macro
+% is followed by a punctuation character.
+%
% Otherwise, we provide the package \textsf{arraycols}~\cite{ARCOL},
% wich allows a good management of spacings in \texttt{tabular} and \texttt{array} environments,
% and \textsf{mismath}~\cite{MSMATH} of which several macros tends to improve spacings
% in mathematical formulas.
-% Let us mention also the \textsf{setspace} package (natively in \LaTeXe),
-% which allows to set the space between the lines of text, and
-% at last \textsf{xspace}~\cite{XSP},
-% which is loaded by \textsf{spacingtricks}: it adds a space unless the macro
-% is followed by certain punctuation characters.
%
% \section{Usage}
%
@@ -380,7 +384,7 @@
%
% \medskip
% \DescribeMacro{\compactlistindent}
-% This length (fixed at 1\,em by default) can be modified with "\setlength" to increase
+% This length (fixed at 0.5\,em by default) can be modified with "\setlength" to increase
% or decrease the indentation of the \texttt{compactlist} environment.
% Notice that there are several other ways to construct a compact list in particular
% with the \texttt{noitemsep} key of the \textsf{enumitem} package~\cite{ENUM}.
@@ -411,11 +415,11 @@
% (for several paragraphs and lists), etc.
% The optional \meta{pos} parameter sets the vertical level on which the boxes are aligned:
% a number between 0 (bottom) and 1 (top, default value).
-% Here is a first example with "\dualboxes[0.7]".
+% Here is a first example with "\dualboxes[0.65]".
%
% \medskip
% \psset{xunit=0.5cm,yunit=1.0cm,algebraic=true}
-% \dualboxes[0.7]{\footnotesize
+% \dualboxes[0.65]{\footnotesize
% $\begin{array}{|*{7}{c|}} \hline
% x & -2 & -1 & 0 & 1 & 2 & 3 \\ \hline
% f(x) & -0.96 & -0.71 & 0 & 0.59 & 0.38 & 0.18 \\ \hline
@@ -485,9 +489,13 @@
% within "\dualboxes" arguments,
% just as it's not possible for footnotes or margin notes.
%
+% \StopEventually{}
+%
% \section{Implementation}
% \begin{macrocode}
\RequirePackage{ifthen}
+\RequirePackage{calc}
+\RequirePackage{setspace}
\RequirePackage{xspace}
\newcommand*{\centered}[1]{{\setlength{\parskip}{0pt}\par\noindent\hfill
@@ -535,8 +543,9 @@
}{\end{list}}
\newlength{\compactlistindent}
-\setlength{\compactlistindent}{1em}
+\setlength{\compactlistindent}{0.5em}
\newenvironment*{compactlist}[1][\textbullet]{
+ \par % sometimes necessary
\begin{list}{#1\unskip}{% \unskip suppresses the space created by \xspace
\setlength{\itemsep}{0pt}
\setlength{\parsep}{0pt}
@@ -567,13 +576,13 @@
\newcommand{\@@dualboxes}[3][1]{
\par\noindent
- \raisebox{-#1\height}{#2} \hfill
- \raisebox{-#1\height}{#3} \smallskip
+ \raisebox{\depth-#1\totalheight}{#2} \hfill
+ \raisebox{\depth-#1\totalheight}{#3} \smallskip
}
\newcommand{\@dualboxes}[3][1]{
\par\noindent \hfill
- \raisebox{-#1\height}{#2} \hfill
- \raisebox{-#1\height}{#3} \hfill\mbox{}\smallskip
+ \raisebox{\depth-#1\totalheight}{#2} \hfill
+ \raisebox{\depth-#1\totalheight}{#3} \hfill\mbox{}\smallskip
}
\newcommand{\dualboxes}{\@ifstar{\@@dualboxes}{\@dualboxes}}
% \end{macrocode}