summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty
diff options
context:
space:
mode:
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}%