summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-11-14 23:44:26 +0000
committerKarl Berry <karl@freefriends.org>2011-11-14 23:44:26 +0000
commit4fc49c242f83529cc0f73af5ec5265d0d8a76ed3 (patch)
tree439424ce260d651c98e02d2256425058f8b6a2a9 /Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty
parent55fa819ec3e5163054416e4a891add5908160987 (diff)
adjustbox (14nov11)
git-svn-id: svn://tug.org/texlive/trunk@24593 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty')
-rw-r--r--Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty24
1 files changed, 24 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty b/Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty
index d8bfb5db589..0fc7a627de3 100644
--- a/Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty
+++ b/Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty
@@ -56,12 +56,36 @@
\DeclareRobustCommand\adjaddtolength[1]{\calc@assign@skip{\advance ##1}}%
\DeclareRobustCommand\adjsetcounter[2]{\@ifundefined{c@##1}{\@nocounterr{##1}}{\calc@assign@count{\global\csname c@##1\endcsname}{##2}}}%
\DeclareRobustCommand\adjaddtocounter[2]{\@ifundefined{c@##1}{\@nocounterr{##1}}{\calc@assign@count{\global\advance\csname c@##1\endcsname}{##2}}}%
+ \def\adjbox@default##1##2{%
+ \begingroup
+ \message{^^J\detokenize{##2}^^J}%
+ \def\calc@post@scan####1!{%
+ \def\@tempa{####1}%
+ \ifx\@tempa\@empty
+ \endgroup% to end calc processing
+ % is number only
+ \global\@adjbox@needsdefaulttrue
+ \else
+ \endgroup% to end calc processing
+ % full expression
+ \global\@adjbox@needsdefaultfalse
+ \fi
+ }%
+ \calc@assign@skip{##1}{##2 \adjbox@defaultunit}%
+ \endgroup
+ \if@adjbox@needsdefault
+ ##1=##2 \adjbox@defaultunit\relax
+ \else
+ \calc@assign@skip{##1}{##2}%
+ \fi
+ }%
\def\adjbox@checkdefault##1\@nnil##2##3{%
\ifx\relax##1\relax\else
\calc@assign@skip{##2}{##3}%
\fi
}%
}
+\newif\if@adjbox@needsdefault
\def\adjcalc@pgfmath{%
\DeclareRobustCommand\adjsetlength{\pgfmathsetlength}%
\DeclareRobustCommand\adjaddtolength{\pgfmathaddtolength}%