Skip to content

Commit

Permalink
Add \redistributestrutht
Browse files Browse the repository at this point in the history
  • Loading branch information
RuixiZhang42 committed Nov 14, 2020
1 parent 417d01b commit f9492a5
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion mtpro2-patch.tex
Original file line number Diff line number Diff line change
Expand Up @@ -509,14 +509,44 @@
{\typeout{Couldn't patch \string\set@fontsize}}%
\patchcmd\set@fontsize
{.3\baselineskip}
{\dimexpr\baselineskip*#2\relax}
{\dimexpr\baselineskip-\baselineskip*#1\relax}
{\typeout{Redistribute strut depth}}
{\typeout{Couldn't patch \string\set@fontsize}}%
\renewcommand*\redistributestruthtdp[2]{%
\typeout{\string\redistributestruthtdp\space has already been
used. So ##1 and ##2 will be gobbled and have no effect.}%
}%
}
\newcommand*\redistributestrutht[1]{%
\new@ifnextchar\bgroup
{\redistributestrutht@t@s{#1}}%
{\redistributestrutht@t@s{#1}{#1}}%
}
\newcommand*\redistributestrutht@t@s[2]{%
\new@ifnextchar\bgroup
{\redistributestrutht@t@s@ss{#1}{#2}}%
{\redistributestrutht@t@s@ss{#1}{#2}{#1}}%
}
\newcommand*\redistributestrutht@t@s@ss[3]{%
\patchcmd\set@fontsize
{.7\baselineskip}
{\dimexpr\baselineskip
*\ifdim\f@size\p@<7\p@ #3\else
\ifdim\f@size\p@<9\p@ #2\else #1\fi\fi\relax}
{\typeout{Redistribute strut height}}
{\typeout{Couldn't patch \string\set@fontsize}}%
\patchcmd\set@fontsize
{.3\baselineskip}
{\dimexpr\baselineskip-\baselineskip
*\ifdim\f@size\p@<7\p@ #3\else
\ifdim\f@size\p@<9\p@ #2\else #1\fi\fi\relax}
{\typeout{Redistribute strut depth}}
{\typeout{Couldn't patch \string\set@fontsize}}%
\renewcommand*\redistributestrutht@t@s@ss[3]{%
\typeout{\string\redistributestrutht\space has already been
used. So ##1 and so on will be gobbled and have no effect.}%
}%
}
% amsmath unfortunately codes \AtBeginDocument{\reset@strutbox@},
% therefore any fix for \strutbox@ using \fontdimen22 must occur
% after this. One must load amsmath prior and we make sure of it.
Expand Down

0 comments on commit f9492a5

Please sign in to comment.