From 0b84dfe8877345df35ceb87ec739c298dcc72b92 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 31 Mar 2014 22:28:56 +0000 Subject: tcolorbox (31mar14) git-svn-id: svn://tug.org/texlive/trunk@33340 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/tcolorbox/tcbskins.code.tex | 69 +++++++++++----------- 1 file changed, 36 insertions(+), 33 deletions(-) (limited to 'Master/texmf-dist/tex/latex/tcolorbox/tcbskins.code.tex') diff --git a/Master/texmf-dist/tex/latex/tcolorbox/tcbskins.code.tex b/Master/texmf-dist/tex/latex/tcolorbox/tcbskins.code.tex index 9a234d42a41..49f9ba6c6d0 100644 --- a/Master/texmf-dist/tex/latex/tcolorbox/tcbskins.code.tex +++ b/Master/texmf-dist/tex/latex/tcolorbox/tcbskins.code.tex @@ -1,4 +1,4 @@ -%% The LaTeX package tcolorbox - version 2.72 (2014/03/18) +%% The LaTeX package tcolorbox - version 2.80 (2014/03/31) %% tcbskins.code.tex: Code for colorboxes with different skins %% %% ------------------------------------------------------------------------------------------- @@ -17,7 +17,7 @@ %% %% This work consists of all files listed in README %% -\tcb@set@library@version{2.72} +\tcb@set@library@version{2.80} \RequirePackage{tikz}[2010/10/13] @@ -827,26 +827,33 @@ \def\tcb@setratiorobust#1#2#3{\ifdim\dimexpr#3<1pt\tcb@setratio#1{#2}{1pt}\else\tcb@setratio#1{#2}{#3}\fi} -\def\tcb@comp@wm@stretch{% - \tcb@setratiorobust\tcb@scale@x{\dimexpr\kvtcb@watermark@factor\dimexpr\tcb@innerwidth\relax\relax}{\wd\tcb@waterbox}% - \tcb@setratiorobust\tcb@scale@y{\dimexpr\kvtcb@watermark@factor\dimexpr\tcb@innerheight\relax\relax}{\ht\tcb@waterbox+\dp\tcb@waterbox}% +\def\tcb@comp@waterbox@stretch#1#2#3{% + \tcb@setratiorobust\tcb@scale@x{#1\dimexpr#2}{\wd\tcb@waterbox}% + \tcb@setratiorobust\tcb@scale@y{#1\dimexpr#3}{\ht\tcb@waterbox+\dp\tcb@waterbox}% } -\def\tcb@comp@wm@zoom{% - \tcb@setratiorobust\tcb@scale@x{\dimexpr\kvtcb@watermark@factor\dimexpr\tcb@innerwidth\relax\relax}{\wd\tcb@waterbox}% - \tcb@setratiorobust\tcb@scale@y{\dimexpr\kvtcb@watermark@factor\dimexpr\tcb@innerheight\relax\relax}{\ht\tcb@waterbox+\dp\tcb@waterbox}% +\def\tcb@comp@waterbox@zoom#1#2#3{% + \tcb@comp@waterbox@stretch{#1}{#2}{#3}% \ifdim\dimexpr\tcb@scale@x pt\relax<\dimexpr\tcb@scale@y pt\relax\let\tcb@scale@y=\tcb@scale@x\else\let\tcb@scale@x=\tcb@scale@y\fi% } -\def\tcb@comp@wm@overzoom{% - \tcb@setratiorobust\tcb@scale@x{\dimexpr\kvtcb@watermark@factor\dimexpr\tcb@innerwidth\relax\relax}{\wd\tcb@waterbox}% - \tcb@setratiorobust\tcb@scale@y{\dimexpr\kvtcb@watermark@factor\dimexpr\tcb@innerheight\relax\relax}{\ht\tcb@waterbox+\dp\tcb@waterbox}% +\def\tcb@comp@waterbox@overzoom#1#2#3{% + \tcb@comp@waterbox@stretch{#1}{#2}{#3}% \ifdim\dimexpr\tcb@scale@x pt\relax>\dimexpr\tcb@scale@y pt\relax\let\tcb@scale@y=\tcb@scale@x\else\let\tcb@scale@x=\tcb@scale@y\fi% } +\def\tcb@comp@waterbox@shrink#1#2#3{% + \tcb@comp@waterbox@zoom{#1}{#2}{#3}% + \ifdim\dimexpr\tcb@scale@x pt\relax>1pt\relax% + \edef\tcb@scale@x{1}\edef\tcb@scale@y{1}% + \fi% +} + +\def\tcb@box@scaled@waterbox{\scalebox{\tcb@scale@x}[\tcb@scale@y]{\box\tcb@waterbox}} + \def\tcb@drawspec@watermark@@noclip{% \tcb@comp@wm% - \node[opacity=\kvtcb@watermark@opacity,anchor=center] at (interior) {\scalebox{\tcb@scale@x}[\tcb@scale@y]{\box\tcb@waterbox}};% + \node[opacity=\kvtcb@watermark@opacity,anchor=center] at (interior) {\tcb@box@scaled@waterbox};% } \def\tcb@drawspec@watermark@@clip{% @@ -873,9 +880,11 @@ \tcbset{% watermark opacity/.store in=\kvtcb@watermark@opacity,% watermark color/.store in=\kvtcb@watermark@color,% - watermark zoom/.code={\def\kvtcb@watermark@factor{#1}\let\tcb@comp@wm=\tcb@comp@wm@zoom},% - watermark overzoom/.code={\def\kvtcb@watermark@factor{#1}\let\tcb@comp@wm=\tcb@comp@wm@overzoom},% - watermark stretch/.code={\def\kvtcb@watermark@factor{#1}\let\tcb@comp@wm=\tcb@comp@wm@stretch},% +% + watermark stretch/.code={\def\tcb@comp@wm{\tcb@comp@waterbox@stretch{#1}{\tcb@innerwidth}{\tcb@innerheight}}},% + watermark zoom/.code={\def\tcb@comp@wm{\tcb@comp@waterbox@zoom{#1}{\tcb@innerwidth}{\tcb@innerheight}}},% + watermark overzoom/.code={\def\tcb@comp@wm{\tcb@comp@waterbox@overzoom{#1}{\tcb@innerwidth}{\tcb@innerheight}}},% + watermark shrink/.code={\def\tcb@comp@wm{\tcb@comp@waterbox@shrink{#1}{\tcb@innerwidth}{\tcb@innerheight}}},% % watermark tikz/.style={overlay={\tcb@drawspec@watermark@tikz{#1}}}, watermark tikz on/.style args={#1 is #2}{overlay #1={\tcb@drawspec@watermark@tikz{#2}}},% @@ -933,7 +942,9 @@ \tikzset{% fill image opacity/.store in=\tcb@tikz@fill@graphics@opacity,% - fill image opacity=1.0,% + fill image opacity=1,% + fill image scale/.store in=\tcb@tikz@fill@graphics@scale,% + fill image scale=1,% fill image options/.store in=\tcb@tikz@fill@graphics@options,% fill image options=,% fill plain image/.style={path picture={% @@ -941,35 +952,27 @@ }}, fill stretch image/.style={path picture={% \tcb@process@ppbb@wh% - \node at (path picture bounding box.center) {\expandafter\includegraphics\expandafter[\tcb@tikz@fill@graphics@options,width=\tcb@ppbb@width,height=\tcb@ppbb@height]{#1}}; + \node at (path picture bounding box.center) {\expandafter\includegraphics\expandafter[\tcb@tikz@fill@graphics@options,% + width=\the\dimexpr\tcb@tikz@fill@graphics@scale\dimexpr\tcb@ppbb@width\relax,% + height=\the\dimexpr\tcb@tikz@fill@graphics@scale\dimexpr\tcb@ppbb@height\relax]{#1}}; }}, fill overzoom image/.style={path picture={% \tcb@process@ppbb@wh% \tcb@set@waterbox@to@graphics{#1}% - \tcb@setratiorobust\tcb@scale@x{\tcb@ppbb@width}{\wd\tcb@waterbox}% - \tcb@setratiorobust\tcb@scale@y{\tcb@ppbb@height}{\ht\tcb@waterbox+\dp\tcb@waterbox}% - \ifdim\dimexpr\tcb@scale@x pt\relax>\dimexpr\tcb@scale@y pt\relax\let\tcb@scale@y=\tcb@scale@x\else\let\tcb@scale@x=\tcb@scale@y\fi% - \node at (path picture bounding box.center) {\scalebox{\tcb@scale@x}[\tcb@scale@y]{\box\tcb@waterbox}};% + \tcb@comp@waterbox@overzoom{\tcb@tikz@fill@graphics@scale}{\tcb@ppbb@width}{\tcb@ppbb@height}% + \node at (path picture bounding box.center) {\tcb@box@scaled@waterbox};% }}, fill zoom image/.style={path picture={% \tcb@process@ppbb@wh% \tcb@set@waterbox@to@graphics{#1}% - \tcb@setratiorobust\tcb@scale@x{\tcb@ppbb@width}{\wd\tcb@waterbox}% - \tcb@setratiorobust\tcb@scale@y{\tcb@ppbb@height}{\ht\tcb@waterbox+\dp\tcb@waterbox}% - \ifdim\dimexpr\tcb@scale@x pt\relax<\dimexpr\tcb@scale@y pt\relax\let\tcb@scale@y=\tcb@scale@x\else\let\tcb@scale@x=\tcb@scale@y\fi% - \node at (path picture bounding box.center) {\scalebox{\tcb@scale@x}[\tcb@scale@y]{\box\tcb@waterbox}};% + \tcb@comp@waterbox@zoom{\tcb@tikz@fill@graphics@scale}{\tcb@ppbb@width}{\tcb@ppbb@height}% + \node at (path picture bounding box.center) {\tcb@box@scaled@waterbox};% }}, fill shrink image/.style={path picture={% \tcb@process@ppbb@wh% \tcb@set@waterbox@to@graphics{#1}% - \tcb@setratiorobust\tcb@scale@x{\tcb@ppbb@width}{\wd\tcb@waterbox}% - \tcb@setratiorobust\tcb@scale@y{\tcb@ppbb@height}{\ht\tcb@waterbox+\dp\tcb@waterbox}% - \ifdim\dimexpr\tcb@scale@x pt\relax<\dimexpr\tcb@scale@y pt\relax\let\tcb@scale@y=\tcb@scale@x\else\let\tcb@scale@x=\tcb@scale@y\fi% - \ifdim\dimexpr\tcb@scale@x pt\relax<1pt\relax% - \node at (path picture bounding box.center) {\scalebox{\tcb@scale@x}[\tcb@scale@y]{\box\tcb@waterbox}};% - \else% - \node at (path picture bounding box.center) {\box\tcb@waterbox};% - \fi% + \tcb@comp@waterbox@shrink{\tcb@tikz@fill@graphics@scale}{\tcb@ppbb@width}{\tcb@ppbb@height}% + \node at (path picture bounding box.center) {\tcb@box@scaled@waterbox};% }}, fill tile image/.style={path picture={% \tcb@process@ppbb% -- cgit v1.2.3