diff options
author | Karl Berry <karl@freefriends.org> | 2013-05-16 22:27:53 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-05-16 22:27:53 +0000 |
commit | f297f05f92068bd7f54e8ee25ce7b8b8a83c2353 (patch) | |
tree | c63d2d20618d3c3d815c71145639a971d297a618 /Master/texmf-dist/tex/latex/tcolorbox | |
parent | b270fa2262972ce19c18ccd488b85e1f96f9a36d (diff) |
tcolorbox (16may13)
git-svn-id: svn://tug.org/texlive/trunk@30508 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tcolorbox')
8 files changed, 162 insertions, 54 deletions
diff --git a/Master/texmf-dist/tex/latex/tcolorbox/tcbbreakable.code.tex b/Master/texmf-dist/tex/latex/tcolorbox/tcbbreakable.code.tex index 5e1a42ea4cd..b6b98be075f 100644 --- a/Master/texmf-dist/tex/latex/tcolorbox/tcbbreakable.code.tex +++ b/Master/texmf-dist/tex/latex/tcolorbox/tcbbreakable.code.tex @@ -1,4 +1,4 @@ -%% The LaTeX package tcolorbox - version 2.21 (2013/04/23) +%% The LaTeX package tcolorbox - version 2.22 (2013/05/15) %% tcbbreakable.code.tex: Code for breakable colorboxes %% %% ------------------------------------------------------------------------------------------- @@ -34,10 +34,24 @@ \@endpefalse% \begingroup% \csname tcb@parboxrestore@\kvtcv@parbox\endcsname% + \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@% + \let\@footnotetext\@mpfootnotetext% + \@setminipage% \ignorespaces% \let\tcb@drawcolorbox=\tcb@drawcolorbox@standalone% } -\def\endtcb@vbox{\unskip\endgroup} + +\def\endtcb@vbox{% + \par% + \unskip% + \ifvoid\@mpfootins\else% + \vskip\skip\@mpfootins% + \normalcolor% + \footnoterule% + \unvbox\@mpfootins% + \fi% + \@minipagefalse% + \endgroup} % remaining height \def\tcb@comp@h@page{% @@ -52,6 +66,11 @@ \fi% } +\def\tcb@comp@h@total@standalone{% + \tcbdimto\tcb@h@padding{\kvtcb@bbtop@stand+\kvtcb@bbbottom@stand+\kvtcb@top@rule@stand+\kvtcb@bottom@rule@stand+\kvtcb@boxsep*2+\kvtcb@top+\kvtcb@bottom}% + \tcbdimto\tcb@h@total{\tcb@h@before+\tcb@h@after+\tcb@h@padding+\tcb@h@padtitle+\tcb@h@upper+\tcb@h@segment+\tcb@h@lower}% +} + \def\tcb@following@title{% \ifx\kvtcb@followingtitle\@empty% \tcb@hasTitlefalse% @@ -84,9 +103,10 @@ \tcb@comp@h@page% % % height calculation - \tcbdimto\tcb@h@padding{\kvtcb@bbtop@stand+\kvtcb@bbbottom@stand+\kvtcb@top@rule@stand+\kvtcb@bottom@rule@stand+\kvtcb@boxsep*2+\kvtcb@top+\kvtcb@bottom}% + %\tcbdimto\tcb@h@padding{\kvtcb@bbtop@stand+\kvtcb@bbbottom@stand+\kvtcb@top@rule@stand+\kvtcb@bottom@rule@stand+\kvtcb@boxsep*2+\kvtcb@top+\kvtcb@bottom}% % - \tcbdimto\tcb@h@total{\tcb@h@before+\tcb@h@after+\tcb@h@padding+\tcb@h@padtitle+\tcb@h@upper+\tcb@h@segment+\tcb@h@lower}% + %\tcbdimto\tcb@h@total{\tcb@h@before+\tcb@h@after+\tcb@h@padding+\tcb@h@padtitle+\tcb@h@upper+\tcb@h@segment+\tcb@h@lower}% + \tcb@comp@h@total@standalone% % \let\tcb@split@next=\relax% \ifdim\tcb@h@total<\tcb@h@page\relax% no break @@ -111,20 +131,35 @@ \tcb@split@next% } + +\def\tcb@setbox@upper#1#2{% + \setbox\tcb@upperbox=\vbox{\begingroup\color{\kvtcb@colupper}\unvbox#2\endgroup}% + \ifdim\dimexpr\ht\tcb@upperbox+\dp\tcb@upperbox>#1\relax% + \setbox\tcb@upperbox=\vbox to\the\dimexpr#1-\dp\tcb@upperbox\relax {\unvbox\tcb@upperbox}% + \fi% + \tcbdimto\tcb@h@upper{\ht\tcb@upperbox+\dp\tcb@upperbox}% +} + \def\tcb@split@upper@box{% \vfuzz=\maxdimen\vbadness=10000% \setbox\tcb@upperbox=\vsplit\tcb@totalupperbox to\tcb@split@dim% - \setbox\tcb@upperbox=\vbox{\begingroup\color{\kvtcb@colupper}\unvbox\tcb@upperbox\endgroup}% + \tcb@setbox@upper{\tcb@split@dim}{\tcb@upperbox}% \vbadness=\tcb@thevbadness\vfuzz=\tcb@thevfuzz% - \tcbdimto\tcb@h@upper{\ht\tcb@upperbox+\dp\tcb@upperbox}% +} + +\def\tcb@setbox@lower#1#2{% + \setbox\tcb@lowerbox=\vbox{\begingroup\color{\kvtcb@collower}\unvbox#2\endgroup}% + \ifdim\dimexpr\ht\tcb@lowerbox+\dp\tcb@lowerbox>#1\relax% + \setbox\tcb@lowerbox=\vbox to\the\dimexpr#1-\dp\tcb@lowerbox\relax {\unvbox\tcb@lowerbox}% + \fi% + \tcbdimto\tcb@h@lower{\ht\tcb@lowerbox+\dp\tcb@lowerbox}% } \def\tcb@split@lower@box{% \vfuzz=\maxdimen\vbadness=10000% \setbox\tcb@lowerbox=\vsplit\tcb@totallowerbox to\tcb@split@dim% - \setbox\tcb@lowerbox=\vbox{\unvbox\tcb@lowerbox}% + \tcb@setbox@lower{\tcb@split@dim}{\tcb@lowerbox}% \vbadness=\tcb@thevbadness\vfuzz=\tcb@thevfuzz% - \tcbdimto\tcb@h@lower{\ht\tcb@lowerbox+\dp\tcb@lowerbox}% } \def\tcb@split@setstate@first{% @@ -157,6 +192,21 @@ \let\tcb@break@bottomsep=\tcb@zpt% } +\def\tcb@swap#1#2{% + \let\tcb@temp=#1% + \let#1=#2% + \let#2=\tcb@temp% +} + + +\def\tcb@split@force@standalone{% + \tcb@comp@h@total@standalone% + \ifdim\tcb@h@total>\tcb@h@page% + \tcbdimto\kvtcb@bbbottom@stand{\kvtcb@bbbottom@stand+\tcb@h@page-\tcb@h@total}% + \fi% +} + + \def\tcb@split@first{% \setcounter{tcbbreakpart}{1}% \ifx\kvtcb@float\@empty% @@ -194,16 +244,27 @@ \edef\tcb@thevfuzz{\the\vfuzz}% \edef\tcb@thevbadness{\the\vbadness}% % - \setbox\tcb@totalupperbox=\vbox{\unvbox\tcb@upperbox}% - \setbox\tcb@totallowerbox=\vbox{\unvbox\tcb@lowerbox}% + \tcb@swap{\tcb@totalupperbox}{\tcb@upperbox}% + \tcb@swap{\tcb@totallowerbox}{\tcb@lowerbox}% % + \let\tcb@split@next=\relax% \tcbdimto\tcb@split@dim{\tcb@h@page-\tcb@h@before-\tcb@h@padding@first-\tcb@h@padtitle}% \ifdim\tcb@split@dim<\tcb@h@upper\relax% \tcb@split@upper@box% - \tcb@sdraw@U% - \let\tcb@split@next=\tcb@split@USL% + \ifvoid\tcb@totalupperbox% + \iftcb@lowerspace% + \tcb@sdraw@U% + \let\tcb@split@next=\tcb@split@SL% + \else% + \tcb@split@force@standalone% + \tcb@drawcolorbox@standalone% + \fi% + \else% + \tcb@sdraw@U% + \let\tcb@split@next=\tcb@split@USL% + \fi% \else% - \setbox\tcb@upperbox=\vbox{\unvbox\tcb@totalupperbox}% + \tcb@swap{\tcb@totalupperbox}{\tcb@upperbox}% \tcbdimto\tcb@split@dim{\tcb@split@dim-\tcb@h@upper-\tcb@h@segment} \ifdim\tcb@split@dim<\kvtcb@breakminlines\baselineskip\relax% \tcb@sdraw@U% @@ -214,14 +275,27 @@ \fi% \else \tcb@split@lower@box% - \tcb@sdraw@USL% - \let\tcb@split@next=\tcb@split@L% + \ifvoid\tcb@totallowerbox% + \tcb@split@force@standalone% + \tcb@drawcolorbox@standalone% + \else% + \tcb@sdraw@USL% + \let\tcb@split@next=\tcb@split@L% + \fi% \fi% \fi% \tcb@split@next% } +\def\tcb@split@force@last{% + \tcb@split@setstate@last% + \ifdim\tcb@h@total>\tcb@h@page% + \tcbdimto\kvtcb@bbbottom{\kvtcb@bbbottom+\tcb@h@page-\tcb@h@total}% + \fi% +} + + \def\tcb@split@USL{% \stepcounter{tcbbreakpart}% \tcb@following@title% @@ -229,37 +303,53 @@ \tcbdimto\tcb@h@upper{\ht\tcb@totalupperbox+\dp\tcb@totalupperbox}% \tcbdimto\tcb@h@total{\tcb@h@after+\tcb@h@padding@last+\tcb@h@padtitle+\tcb@h@upper+\tcb@h@segment+\tcb@h@lower}% % + \let\tcb@split@next=\relax% \ifdim\tcb@h@total<\tcb@h@page\relax% no break \tcb@split@setstate@last% - \setbox\tcb@upperbox=\vbox{\begingroup\color{\kvtcb@colupper}\unvbox\tcb@totalupperbox\endgroup}% - \setbox\tcb@lowerbox=\vbox{\begingroup\color{\kvtcb@collower}\unvbox\tcb@totallowerbox\endgroup}% + \tcb@setbox@upper{\tcb@h@upper}{\tcb@totalupperbox}% \iftcb@lowerspace% + \tcb@setbox@lower{\tcb@h@lower}{\tcb@totallowerbox}% \tcb@sdraw@USL% \else \tcb@sdraw@U% \fi% - \let\tcb@split@next=\relax% \else \tcb@split@setstate@middle% \tcbdimto\tcb@split@dim{\tcb@h@page-\tcb@h@padding@middle-\tcb@h@padtitle}% \ifdim\tcb@split@dim<\tcb@h@upper\relax% \tcb@split@upper@box% - \tcb@sdraw@U% - \let\tcb@split@next=\tcb@split@USL% - \else% - \setbox\tcb@upperbox=\vbox{\begingroup\color{\kvtcb@colupper}\unvbox\tcb@totalupperbox\endgroup}% - \tcbdimto\tcb@split@dim{\tcb@split@dim-\tcb@h@upper-\tcb@h@segment} - \ifdim\tcb@split@dim<\kvtcb@breakminlines\baselineskip\relax% - \tcb@sdraw@U% + \ifvoid\tcb@totalupperbox% \iftcb@lowerspace% - \let\tcb@split@next=\tcb@split@SL% + \tcb@sdraw@U% + \let\tcb@split@next=\tcb@split@SL% \else% + \tcb@split@force@last% + \tcb@sdraw@U% + \fi% + \else% + \tcb@sdraw@U% \let\tcb@split@next=\tcb@split@USL% + \fi% + \else% + \tcb@setbox@upper{\tcb@h@upper}{\tcb@totalupperbox}% + \iftcb@lowerspace% + \tcbdimto\tcb@split@dim{\tcb@split@dim-\tcb@h@upper-\tcb@h@segment} + \ifdim\tcb@split@dim<\kvtcb@breakminlines\baselineskip\relax% + \tcb@sdraw@U% + \let\tcb@split@next=\tcb@split@SL% + \else + \tcb@split@lower@box% + \ifvoid\tcb@totallowerbox% + \tcb@split@force@last% + \tcb@sdraw@USL% + \else% + \tcb@sdraw@USL% + \let\tcb@split@next=\tcb@split@L% + \fi% \fi% - \else - \tcb@split@lower@box% - \tcb@sdraw@USL% - \let\tcb@split@next=\tcb@split@L% + \else% + \tcb@split@force@last% + \tcb@sdraw@U% \fi% \fi% \fi% @@ -275,17 +365,22 @@ \tcbdimto\tcb@h@lower{\ht\tcb@totallowerbox+\dp\tcb@totallowerbox}% \tcbdimto\tcb@h@total{\tcb@h@after+\tcb@h@padding@last-\kvtcb@top-\kvtcb@boxsep+\tcb@h@padtitle+\tcb@h@segment+\tcb@h@lower}% % + \let\tcb@split@next=\relax% \ifdim\tcb@h@total<\tcb@h@page\relax% no break \tcb@split@setstate@last% - \setbox\tcb@lowerbox=\vbox{\begingroup\color{\kvtcb@collower}\unvbox\tcb@totallowerbox\endgroup}% + \tcb@setbox@lower{\tcb@h@lower}{\tcb@totallowerbox}% \tcb@sdraw@SL% - \let\tcb@split@next=\relax% \else \tcb@split@setstate@middle% \tcbdimto\tcb@split@dim{\tcb@h@page-\tcb@h@padding@middle+\kvtcb@top+\kvtcb@boxsep-\tcb@h@padtitle-\tcb@h@segment}% \tcb@split@lower@box% - \tcb@sdraw@SL% - \let\tcb@split@next=\tcb@split@L% + \ifvoid\tcb@totallowerbox% + \tcb@split@force@last% + \tcb@sdraw@SL% + \else + \tcb@sdraw@SL% + \let\tcb@split@next=\tcb@split@L% + \fi% \fi% \tcb@split@next% } @@ -299,17 +394,22 @@ \tcbdimto\tcb@h@lower{\ht\tcb@totallowerbox+\dp\tcb@totallowerbox}% \tcbdimto\tcb@h@total{\tcb@h@after+\tcb@h@padding@last+\tcb@h@padtitle+\tcb@h@lower}% % + \let\tcb@split@next=\relax% \ifdim\tcb@h@total<\tcb@h@page\relax% no break \tcb@split@setstate@last% - \setbox\tcb@lowerbox=\vbox{\begingroup\color{\kvtcb@collower}\unvbox\tcb@totallowerbox\endgroup}% + \tcb@setbox@lower{\tcb@h@lower}{\tcb@totallowerbox}% \tcb@sdraw@L% - \let\tcb@split@next=\relax% \else \tcb@split@setstate@middle% \tcbdimto\tcb@split@dim{\tcb@h@page-\tcb@h@padding@middle-\tcb@h@padtitle}% \tcb@split@lower@box% - \tcb@sdraw@L% - \let\tcb@split@next=\tcb@split@L% + \ifvoid\tcb@totallowerbox% + \tcb@split@force@last% + \tcb@sdraw@L% + \else + \tcb@sdraw@L% + \let\tcb@split@next=\tcb@split@L% + \fi% \fi% \tcb@split@next% } diff --git a/Master/texmf-dist/tex/latex/tcolorbox/tcbdocumentation.code.tex b/Master/texmf-dist/tex/latex/tcolorbox/tcbdocumentation.code.tex index b14d5f73c5e..7cb9b5cf1d2 100644 --- a/Master/texmf-dist/tex/latex/tcolorbox/tcbdocumentation.code.tex +++ b/Master/texmf-dist/tex/latex/tcolorbox/tcbdocumentation.code.tex @@ -1,4 +1,4 @@ -%% The LaTeX package tcolorbox - version 2.21 (2013/04/23) +%% The LaTeX package tcolorbox - version 2.22 (2013/05/15) %% tcbdocumentation.code.tex: Code for LaTeX documentations %% %% ------------------------------------------------------------------------------------------- diff --git a/Master/texmf-dist/tex/latex/tcolorbox/tcbhooks.code.tex b/Master/texmf-dist/tex/latex/tcolorbox/tcbhooks.code.tex index 1bda22de6c2..3a5dbc4f98f 100644 --- a/Master/texmf-dist/tex/latex/tcolorbox/tcbhooks.code.tex +++ b/Master/texmf-dist/tex/latex/tcolorbox/tcbhooks.code.tex @@ -1,4 +1,4 @@ -%% The LaTeX package tcolorbox - version 2.21 (2013/04/23) +%% The LaTeX package tcolorbox - version 2.22 (2013/05/15) %% tcbhooks.code.tex: Code for adding hooks %% %% ------------------------------------------------------------------------------------------- diff --git a/Master/texmf-dist/tex/latex/tcolorbox/tcblistings.code.tex b/Master/texmf-dist/tex/latex/tcolorbox/tcblistings.code.tex index 3f6dae4c39e..3c12ec06328 100644 --- a/Master/texmf-dist/tex/latex/tcolorbox/tcblistings.code.tex +++ b/Master/texmf-dist/tex/latex/tcolorbox/tcblistings.code.tex @@ -1,4 +1,4 @@ -%% The LaTeX package tcolorbox - version 2.21 (2013/04/23) +%% The LaTeX package tcolorbox - version 2.22 (2013/05/15) %% tcblistings.code.tex: Code for colorboxes with listings %% %% ------------------------------------------------------------------------------------------- diff --git a/Master/texmf-dist/tex/latex/tcolorbox/tcblistingsutf8.code.tex b/Master/texmf-dist/tex/latex/tcolorbox/tcblistingsutf8.code.tex index 617febb25f7..bc2b02ebd0b 100644 --- a/Master/texmf-dist/tex/latex/tcolorbox/tcblistingsutf8.code.tex +++ b/Master/texmf-dist/tex/latex/tcolorbox/tcblistingsutf8.code.tex @@ -1,4 +1,4 @@ -%% The LaTeX package tcolorbox - version 2.21 (2013/04/23) +%% The LaTeX package tcolorbox - version 2.22 (2013/05/15) %% tcblistingsutf8.code.tex: Code for colorboxes with listings in UTF-8 %% %% ------------------------------------------------------------------------------------------- diff --git a/Master/texmf-dist/tex/latex/tcolorbox/tcbskins.code.tex b/Master/texmf-dist/tex/latex/tcolorbox/tcbskins.code.tex index 75a6c71eccc..9c2bf760b1f 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.21 (2013/04/23) +%% The LaTeX package tcolorbox - version 2.22 (2013/05/15) %% tcbskins.code.tex: Code for colorboxes with different skins %% %% ------------------------------------------------------------------------------------------- diff --git a/Master/texmf-dist/tex/latex/tcolorbox/tcbtheorems.code.tex b/Master/texmf-dist/tex/latex/tcolorbox/tcbtheorems.code.tex index da525707d72..4bb334b5d5b 100644 --- a/Master/texmf-dist/tex/latex/tcolorbox/tcbtheorems.code.tex +++ b/Master/texmf-dist/tex/latex/tcolorbox/tcbtheorems.code.tex @@ -1,4 +1,4 @@ -%% The LaTeX package tcolorbox - version 2.21 (2013/04/23) +%% The LaTeX package tcolorbox - version 2.22 (2013/05/15) %% tcbtheorems.code.tex: Code for theorems in colorboxes %% %% ------------------------------------------------------------------------------------------- @@ -57,14 +57,9 @@ } \newcommand{\tcbmaketheorem}[5]{% - \newenvironment{#1}[3][]{% - \tcolorbox[#3,savedelimiter=#1, - theorem={#2}{#4}{##2}{#5:##3}, - ##1]}% - {\endtcolorbox}% + \newtcolorbox{#1}[3][]{#3,theorem={#2}{#4}{##2}{#5:##3},##1}% } -\newcommand{\tcboxmath}[1][]{\tcbox[nobeforeafter,math upper,tcbox raise base,#1]} - -\newcommand{\tcbhighmath}[1][]{\tcboxmath[highlight math,#1]} +\newtcbox{\tcboxmath}[1][]{nobeforeafter,math upper,tcbox raise base,#1} +\newtcbox{\tcbhighmath}[1][]{nobeforeafter,math upper,tcbox raise base,highlight math,#1} diff --git a/Master/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty b/Master/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty index 847f31b842e..8238c1589b5 100644 --- a/Master/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty +++ b/Master/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty @@ -1,4 +1,4 @@ -%% The LaTeX package tcolorbox - version 2.21 (2013/04/23) +%% The LaTeX package tcolorbox - version 2.22 (2013/05/15) %% tcolorbox.sty: Text color boxes %% %% ------------------------------------------------------------------------------------------- @@ -18,7 +18,7 @@ %% This work consists of all files listed in README %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{tcolorbox}[2013/04/23 version 2.21 text color boxes] +\ProvidesPackage{tcolorbox}[2013/05/15 version 2.22 text color boxes] \RequirePackage{pgf}[2008/01/15] \RequirePackage{verbatim}[2003/08/22] @@ -382,6 +382,7 @@ \unskip\tcb@after@box% \end{tcb@savebox}% \tcb@draw@color@box% + \color{.}% hack for some special cases } \let\endtcolorbox=\tcb@endboxanddraw @@ -673,6 +674,18 @@ \long\def\newtcolorbox#1{% \@ifnextchar[{\new@tcolorbox{#1}}{\tcb@newtcolorbox{#1}}} +\long\def\tcb@newtcbox#1#2{\newcommand{#1}{\tcbox[#2]}} + +\long\def\tcb@new@tcbox#1[#2]#3{\newcommand{#1}[#2]{\tcbox[#3]}} + +\long\def\tcb@new@@tcbox#1[#2][#3]#4{\newcommand{#1}[#2][#3]{\tcbox[#4]}} + +\long\def\new@tcbox#1[#2]{% + \@ifnextchar[{\tcb@new@@tcbox{#1}[#2]}{\tcb@new@tcbox{#1}[#2]}} + +\long\def\newtcbox#1{% + \@ifnextchar[{\new@tcbox{#1}}{\tcb@newtcbox{#1}}} + % verbatim output as in 'verbatim' \newwrite\tcb@out |