summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/scalerel/scalerel.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/scalerel/scalerel.sty')
-rw-r--r--Master/texmf-dist/tex/latex/scalerel/scalerel.sty48
1 files changed, 29 insertions, 19 deletions
diff --git a/Master/texmf-dist/tex/latex/scalerel/scalerel.sty b/Master/texmf-dist/tex/latex/scalerel/scalerel.sty
index cdc424ed316..397f6be945e 100644
--- a/Master/texmf-dist/tex/latex/scalerel/scalerel.sty
+++ b/Master/texmf-dist/tex/latex/scalerel/scalerel.sty
@@ -1,5 +1,5 @@
\ProvidesPackage{scalerel}
-[2014/03/10 v1.6
+[2015/02/18 v1.7
Routines for constrained scaling and stretching of objects,
relative to a reference object or in absolute terms]
%
@@ -35,6 +35,16 @@
% 0.5ex/pt in \scriptscriptstyle).
% -Revised/shortened/improved \Isnextbyte.
% -Replaced ifthen package calls with etoolbox calls.
+% V1.7 -Note that the V1.5 implementation with \mathchoice seemed to
+% have made the use of \ignoremathstyle and \discernmathstyle
+% vestigial. Thus, \ignoremathstyle was revised to be used
+% for the purpose of streamlining package efficiency when
+% only textstyle (or displaystyle with \ignoremathstyle[D])
+% processing is required.
+% -Fixed use of dot {.} as null argument in \scaleleftright{}{}{}
+% and \stretchleftright{}{}{}, which had been causing overflow.
+% -Made \hstretch and \vstretch routines more efficient, using
+% optional arguments of \scalebox, instead of \scalerel.
\usepackage{calc}
\usepackage{graphicx}
@@ -118,24 +128,20 @@
}%
}
-\def\bl@nk{\rule{-.01ex}{1ex}}
-
\newcommand\scaleleftright[4][99in]{%
- \if.#2\def\leftarg{\bl@nk}\else\def\leftarg{#2}\fi%
- \if.#4\def\rightarg{\bl@nk}\else\def\rightarg{#4}\fi%
- \scalerel[#1]{\leftarg}{#3}\scalerel*[#1]{\rightarg}{#3}%
+ \ifx.#2#3\else\scalerel[#1]{#2}{#3}\fi%
+ \ifx.#4\else\scalerel*[#1]{#4}{#3}\fi%
}
\newcommand\stretchleftright[4][10000]{%
- \if.#2\def\leftarg{\bl@nk}\else\def\leftarg{#2}\fi%
- \if.#4\def\rightarg{\bl@nk}\else\def\rightarg{#4}\fi%
- \stretchrel[#1]{\leftarg}{#3}\stretchrel*[#1]{\rightarg}{#3}%
+ \ifx.#2#3\else\stretchrel[#1]{#2}{#3}\fi%
+ \ifx.#4\else\stretchrel*[#1]{#4}{#3}\fi%
}
\newcommand\hstretch[2]{%
- \ThisStyle{\stretchrel*{\scalebox{#1}{\@obj{#2}}}{#2}}}
+ \ThisStyle{\scalebox{#1}[1]{\@obj{#2}}}}
\newcommand\vstretch[2]{%
- \ThisStyle{\stretchrel*{#2}{\scalebox{#1}{\@obj{#2}}}}}
+ \ThisStyle{\scalebox{1}[#1]{\@obj{#2}}}}
\newcommand\scaleobj[2]{%
\ThisStyle{\scalebox{#1}{\@obj{#2}}}}
@@ -157,14 +163,6 @@
\fi%
}
-\let\sv@obj\@obj
-
-\newcommand\discernmathstyle{\let\@obj\sv@obj}
-
-% \ignoremathstyle WOULD BE USED RARELY, ONLY IF ONE WANTED TO USE
-% DOLLAR ($) DELIMITERS IN THE *MIDDLE* OF A scalerel ARGUMENT
-\newcommand\ignoremathstyle{\renewcommand\@obj[1]{$##1$}}
-
\def\@mstyleD{\displaystyle}
\def\@mstyleT{\textstyle}
\def\@mstyleS{\scriptstyle}
@@ -188,6 +186,18 @@
}
%
+\let\sv@ThisStyle\ThisStyle
+
+\newcommand\discernmathstyle{\let\ThisStyle\sv@ThisStyle}
+
+% \ignoremathstyle WOULD BE USED TO SPEED UP DEEPLY NESTED
+% ROUTINES OF scalerel PACKAGE, WHEN LIMITED TO textstyle MATH
+\newcommand\ignoremathstyle[1][T]{%
+ \renewcommand\ThisStyle[1]{%
+ \edef\m@switch{#1}\LMex=1ex\relax\LMpt=1pt\relax%
+ \ifmmode\def\@mmode{T}\else\def\@mmode{F}\fi##1}%
+}
+
% THIS CAN REPLACE \isnextbyte IN STRINGSTRINGS PACKAGE
% BECAUSE IT WORKS ON CHARS THAT CAN'T BE \edef'ED (\dag, ETC.)
\newcommand\Isnextbyte[3][v]{%