From 24edadbfd5d45a97ab89a24622b103eb479b7b6d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 10 Mar 2014 20:55:43 +0000 Subject: scalerel (10mar14) git-svn-id: svn://tug.org/texlive/trunk@33145 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/scalerel/scalerel.sty | 52 ++++++++++++----------- 1 file changed, 28 insertions(+), 24 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/scalerel/scalerel.sty b/Master/texmf-dist/tex/latex/scalerel/scalerel.sty index fdc528e917d..cdc424ed316 100644 --- a/Master/texmf-dist/tex/latex/scalerel/scalerel.sty +++ b/Master/texmf-dist/tex/latex/scalerel/scalerel.sty @@ -1,8 +1,7 @@ \ProvidesPackage{scalerel} -[2013/05/16 v1.5 +[2014/03/10 v1.6 Routines for constrained scaling and stretching of objects, relative to a reference object or in absolute terms] -%% Copyright 2013 Steven B. Segletes % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -16,10 +15,10 @@ % % The Current Maintainer of this work is Steven B. Segletes. -% V1.01 Correct typos in documentation -% V1.1 Corrected usepackage dependencies; Significant doc rewrite. -% V1.2 Added \scaleleftright and \stretchleftright; revised docs. -% V1.3 Corrected missing % in stretch routines, added \hstretch and +% V1.01-Correct typos in documentation +% V1.1 -Corrected usepackage dependencies; Significant doc rewrite. +% V1.2 -Added \scaleleftright and \stretchleftright; revised docs. +% V1.3 -Corrected missing % in stretch routines, added \hstretch and % \vstretch commands; fixed version number in .sty file % V1.4 -Auto-detect mathmode and style; use the proper math display % style; Allow \ignoremathstyle and \discernmathstyle to @@ -30,16 +29,26 @@ % using current display style). % V1.5 -Eliminated mathstyle package because of incompatibilites with % many other packages. Implemented \mathchoice approach instead. +% V1.6 -Made available \LMex and \LMpt lengths (Local Math ex and +% Local Math pt), usable inside \ThisStyle arguments (1ex/pt in +% \textstyle and \displaystyle, 0.7ex/pt in \scriptstyle, and +% 0.5ex/pt in \scriptscriptstyle). +% -Revised/shortened/improved \Isnextbyte. +% -Replaced ifthen package calls with etoolbox calls. \usepackage{calc} \usepackage{graphicx} -\usepackage{ifthen} +\usepackage{etoolbox} \global\newlength\thesrwidth \global\newlength\thesrheight \global\newlength\srblobheight \global\newlength\srblobdepth \global\newlength\mnxsrwidth \newsavebox{\prebox} +\newlength\LMex +\newlength\LMpt +\def\scriptstyleScaleFactor{.7} +\def\scriptscriptstyleScaleFactor{.5} \newcommand\scalerel{\@ifstar{\scalerelplain}{\scalerelplus}} @@ -166,33 +175,28 @@ \newcommand\ThisStyle[1]{% \ifmmode% \def\@mmode{T}\mathchoice% - {\edef\m@switch{D}#1}% - {\edef\m@switch{T}#1}% - {\edef\m@switch{S}#1}% - {\edef\m@switch{s}#1}% + {\edef\m@switch{D}\LMex=1ex\relax\LMpt=1pt\relax#1}% + {\edef\m@switch{T}\LMex=1ex\relax\LMpt=1pt\relax#1}% + {\edef\m@switch{S}\LMex=\scriptstyleScaleFactor ex\relax% + \LMpt=\scriptstyleScaleFactor pt\relax#1}% + {\edef\m@switch{s}\LMex=\scriptscriptstyleScaleFactor ex\relax% + \LMpt=\scriptscriptstyleScaleFactor pt\relax#1}% \else% \def\@mmode{F}% - \edef\m@switch{T}#1% + \edef\m@switch{T}\LMex=1ex\relax\LMpt=1pt\relax#1% \fi% } % -%\newcommand\get@mmode{\ifmmode\def\@mmode{T}\else\def\@mmode{F}\fi} -\def\PrimarySignalChar{@} -\def\SecondarySignalChar{`} % THIS CAN REPLACE \isnextbyte IN STRINGSTRINGS PACKAGE % BECAUSE IT WORKS ON CHARS THAT CAN'T BE \edef'ED (\dag, ETC.) \newcommand\Isnextbyte[3][v]{% - \let\SignalChar\PrimarySignalChar% - \protected@edef\@x{\if #2#3\else\SignalChar\fi}% - \protected@edef\@x{\if \SignalChar\@x F\else T\fi}% - \let\SignalChar\SecondarySignalChar% - \protected@edef\@y{\if #2#3\else\SignalChar\fi}% - \protected@edef\@y{\if \SignalChar\@y F\else T\fi}% - \ifthenelse{\equal{\@x\@y}{\@y\@x}}% - {\protected@edef\theresult{\@x}}% - {\protected@edef\theresult{T}}% + \def\SR@Letter@A{#2}% + \SR@nextbyte{\SR@Letter@B}#3\relax\relax\relax% + \ifdefstrequal{\SR@Letter@A}{\SR@Letter@B}% + {\edef\theresult{T}}{\edef\theresult{F}}% \if q#1\else\theresult\fi% } +\def\SR@nextbyte#1#2#3\relax{\def#1{#2}} \endinput -- cgit v1.2.3