summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-08-13 22:19:43 +0000
committerKarl Berry <karl@freefriends.org>2011-08-13 22:19:43 +0000
commitd429ad262261b593689d81ac6db8bdaf16c6b2b2 (patch)
tree16722bab0f431e76ac520bb97b5e018b6a94b1b5 /Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty
parent5730d1c679f7a725b75ce80066cc6a6987aee888 (diff)
adjustbox (13aug11)
git-svn-id: svn://tug.org/texlive/trunk@23541 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.sty113
1 files changed, 113 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty b/Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty
new file mode 100644
index 00000000000..47e512f3aba
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty
@@ -0,0 +1,113 @@
+%%
+%% This is file `adjcalc.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% adjustbox.dtx (with options: `adjcalc')
+%%
+%% Copyright (C) 2011 by Martin Scharrer <martin@scharrer-online.de>
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008/05/04 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Martin Scharrer.
+%%
+%% This work consists of the files adjustbox.dtx and adjustbox.ins
+%% and the derived files adjustbox.sty, adjcalc.sty, adjpgf.def and
+%% adjgrfx.sty.
+%%
+\begingroup
+\def\@tempa{adjcalc}
+\expandafter
+\endgroup
+\ifx\@tempa\@currname
+ \ProvidesPackage{adjcalc}[2011/08/07 v1.0 Provides advanced setlength with multiple back-ends (calc, etex, pgfmath)]
+ \RequirePackage{xkeyval}
+\fi
+\AtEndOfPackage{\adjcalc@atend}
+\def\adjcalc@atend{%
+\begingroup
+\expandafter\ifx\csname eTeXversion\endcsname\relax
+ \endgroup
+ \RequirePackage{calc}%
+ \adjcalc@calc
+ \def\adjcalc@etex{\PackageError{adjcalc}{e-TeX not available for current compiler!}}%
+\else
+ \endgroup
+ \adjcalc@etex
+\fi
+}
+\def\adjcalc@pgfmath{\AtEndOfPackage{\RequirePackage{pgf}}\def\adjcalc@atend{\adjcalc@pgfmath}}
+\def\adjcalc@etex{\def\adjcalc@atend{\adjcalc@etex}}
+\def\adjcalc@calc{\AtEndOfPackage{\RequirePackage{calc}}\def\adjcalc@atend{\adjcalc@calc}}
+\def\adjcalc@overwrite{\AtEndOfPackage{\adjcalc@overwrite}}
+\DeclareOptionX<adjbox>{pgfmath}{\adjcalc@pgfmath}
+\DeclareOptionX<adjbox>{etex}{\adjcalc@etex}
+\DeclareOptionX<adjbox>{calc}{\adjcalc@calc}
+\DeclareOptionX<adjbox>{none}{\let\adjcalc@atend\relax\def\adjsetlength{\setlength}\let\adjcalc@overwrite\relax}
+\DeclareOptionX<adjbox>{overwrite}{\adjcalc@overwrite}
+\ProcessOptionsX*<adjbox>
+\disable@keys{adjbox}{none}
+\def\adjcalc@etex{%
+ \protected\def\adjsetlength##1##2{%
+ ##1=\glueexpr(##2)\relax
+ }%
+ \protected\def\adjaddtolength##1##2{%
+ \advance##1 by \glueexpr(##2)\relax
+ }%
+ \protected\def\adjsetcounter##1##2{%
+ \@ifundefined{c@##1}%
+ {\@nocounterr{##1}}%
+ {\global\csname c@##1\endcsname\numexpr(##2)\relax}%
+ }%
+ \protected\def\adjaddtocounter##1##2{%
+ \@ifundefined{c@##1}%
+ {\@nocounterr{##1}}%
+ {\global\advance\csname c@##1\endcsname\numexpr(##2)\relax}%
+ }%
+ \def\adjbox@default##1##2{%
+ \@defaultunits##1=\glueexpr##2 \adjbox@defaultunit\relax\@nnil
+ }%
+}
+\def\adjcalc@calc{%
+ \DeclareRobustCommand\adjsetlength{\calc@assign@skip}%
+ \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@checkdefault##1\@nnil##2##3{%
+ \ifx\relax##1\relax\else
+ \calc@assign@skip{##2}{##3}%
+ \fi
+ }%
+}
+\def\adjcalc@pgfmath{%
+ \DeclareRobustCommand\adjsetlength{\pgfmathsetlength}%
+ \DeclareRobustCommand\adjaddtolength{\pgfmathaddtolength}%
+ \DeclareRobustCommand\adjsetcounter{\pgfmathsetcounter}%
+ \DeclareRobustCommand\adjaddtocounter{\pgfmathaddtocounter}%
+ \def\adjbox@default##1##2{%
+ \edef\pgfmathresultunitscale{1\adjbox@defaultunit}%
+ \let\pgfmathpostparse\pgfmathscaleresult
+ \pgfmathparse{##2}%
+ ##1=\pgfmathresult pt\relax
+ }%
+}
+\def\adjcalc@overwrite{%
+ \let\setlength\adjsetlength
+ \let\addtolength\adjaddtolength
+ \let\setcounter\adjsetcounter
+ \let\addtocounter\adjaddtocounter
+}
+\endinput
+%%
+%% End of file `adjcalc.sty'.