[latex3-commits] [git/LaTeX3-latex3-mathtools] master: added \varmathstrut, still need an example (a203eaa)
daleif
daleif at math.au.dk
Thu Mar 5 18:57:35 CET 2020
Repository : https://github.com/latex3/mathtools
On branch : master
Link : https://github.com/latex3/mathtools/commit/a203eaa4fa6e1796da13105831d00ddd430da46c
>---------------------------------------------------------------
commit a203eaa4fa6e1796da13105831d00ddd430da46c
Author: daleif <daleif at math.au.dk>
Date: Thu Mar 5 18:57:35 2020 +0100
added \varmathstrut, still need an example
>---------------------------------------------------------------
a203eaa4fa6e1796da13105831d00ddd430da46c
mathtools.dtx | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 80 insertions(+)
diff --git a/mathtools.dtx b/mathtools.dtx
index 32ab8c5..ece7f2f 100644
--- a/mathtools.dtx
+++ b/mathtools.dtx
@@ -2725,6 +2725,60 @@ colorlinks,
%
%
%
+% \section{New additions}
+%
+% \subsection{Variable math strut}
+%
+% \begin{codesyntax}
+% \SpecialUsageIndex{\varmathstrut}\cs{varmathstrut}\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.
+%
+% \emph{example missing}
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
%
%
%
@@ -6316,6 +6370,32 @@ colorlinks,
% \end{macrocode}
% \end{macro}
%
+% \section{Additional features 2020–}
+%
+%
+% \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}}%
+}
+\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
+ \relax
+ \dp\varmathstrut at box\dimexpr\dp\varmathstrut at box
+ +\varmathstrut at dp\varmathstrut at dim
+ -\varmathstrut at dim
+ \relax
+ \box\varmathstrut at box}
+
+% \end{macrocode}
+%
% This is the end of the \pkg{mathtools} package.
% \begin{macrocode}
%</package>
More information about the latex3-commits
mailing list.