[latex3-commits] [git/LaTeX3-latex3-mathtools] master: \xmathstrut still need some documentation (a224a16)

daleif daleif at math.au.dk
Fri Mar 6 08:25:22 CET 2020


Repository : https://github.com/latex3/mathtools
On branch  : master
Link       : https://github.com/latex3/mathtools/commit/a224a1606a3e0b0eb707f041c925e4849083a515

>---------------------------------------------------------------

commit a224a1606a3e0b0eb707f041c925e4849083a515
Author: daleif <daleif at math.au.dk>
Date:   Fri Mar 6 08:25:22 2020 +0100

    \xmathstrut still need some documentation


>---------------------------------------------------------------

a224a1606a3e0b0eb707f041c925e4849083a515
 mathtools.dtx | 53 ++++++++++++++++++++++++++++++-----------------------
 1 file changed, 30 insertions(+), 23 deletions(-)

diff --git a/mathtools.dtx b/mathtools.dtx
index ece7f2f..acb6955 100644
--- a/mathtools.dtx
+++ b/mathtools.dtx
@@ -2722,25 +2722,31 @@ colorlinks,
 %  \]
 % Note how the line spaces aren't even on the left hand side.
 %
+% For even more control, one can use \env{aligned} or \env{gathered}
+% instead of \cs{splitfrac}.
 %
 %
+%  \newpage
 %
 % \section{New additions}
 %
 % \subsection{Variable math strut}
 %
 %  \begin{codesyntax}
-%    \SpecialUsageIndex{\varmathstrut}\cs{varmathstrut}\oarg{depth scale}\marg{scale}
+%    \SpecialUsageIndex{\xmathstrut}\cs{xmathstrut}\oarg{depth scale}\marg{scale}
 %  \end{codesyntax}
 %  In typography we use \emph{struts} to ensure specific line
 %  spacing. In text we have the \cs{strut} and in math
 %  \cs{mathstrut}. Both have no width, but equals the height and depth
-%  of an »(« from the text font and math font respectively. At times
-%  we'd like to have a math strut that can be changed. The
-%  \emph{variant} math strut \cs{varmathstrut} does this. In its
-%  normal form the \meta{scale} will be apllied to both the height and
-%  depth of the strut. When both are given, \oarg{depth scale} applies
-%  only to the depth and \marg{scale} only to the height.
+%  of an »(« from the current text/math font and size.  In math we
+%  often need to make minute adjustments in macro definitiones
+%  etc. The \emph{extended} math strut \cs{xmathstrut} allows to
+%  \emph{scale} the math strut in various ways. Useful if the macro
+%  you are adding it to needs to be used in both normal and script
+%  modes. In its normal form the \meta{scale} will be apllied to both
+%  the height and depth of the strut. When both arguments are given,
+%  \oarg{depth~scale} applies only to the depth and \marg{scale} only
+%  to the height.
 %
 %  \emph{example missing}  
 %
@@ -6373,26 +6379,27 @@ colorlinks,
 %  \section{Additional features 2020–}
 %
 % 
+%  \changes{v1.24}{2020/03/06}{Added \cs{xmathstrut}}
 %    \begin{macrocode}
-\newbox\varmathstrut at box
-\newdimen\varmathstrut at dim
-\def\varmathstrut{\@dblarg\varmathstrut@}
-\def\varmathstrut@[#1]#2{%
-  \def\varmathstrut at dp{#1}%
-  \vphantom{\mathpalette\varmathstrut at do{#2}}%
+\newbox\xmathstrut at box
+\newdimen\xmathstrut at dim
+\def\xmathstrut{\@dblarg\xmathstrut@}
+\def\xmathstrut@[#1]#2{%
+  \def\xmathstrut at dp{#1}%
+  \vphantom{\mathpalette\xmathstrut at do{#2}}%
 }
-\def\varmathstrut at do#1#2{%
-  \setbox\varmathstrut at box\hbox{$#1($}%)%emacs
-   \varmathstrut at dim\dimexpr\ht\varmathstrut at box+\dp\varmathstrut at box\relax
-   \ht\varmathstrut at box\dimexpr\ht\varmathstrut at box
-           +#2\varmathstrut at dim
-           -\varmathstrut at dim
+\def\xmathstrut at do#1#2{%
+  \setbox\xmathstrut at box\hbox{$#1($}%)%emacs
+   \xmathstrut at dim\dimexpr\ht\xmathstrut at box+\dp\xmathstrut at box\relax
+   \ht\xmathstrut at box\dimexpr\ht\xmathstrut at box
+           +#2\xmathstrut at dim
+           -\xmathstrut at dim
            \relax
-   \dp\varmathstrut at box\dimexpr\dp\varmathstrut at box
-         +\varmathstrut at dp\varmathstrut at dim
-         -\varmathstrut at dim
+   \dp\xmathstrut at box\dimexpr\dp\xmathstrut at box
+         +\xmathstrut at dp\xmathstrut at dim
+         -\xmathstrut at dim
          \relax
-   \box\varmathstrut at box}
+   \box\xmathstrut at box}
 
 %    \end{macrocode}
 %





More information about the latex3-commits mailing list.