diff options
author | Karl Berry <karl@freefriends.org> | 2012-03-01 23:43:55 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-03-01 23:43:55 +0000 |
commit | 065ab9074d32d9f3697ae1f24827b48d00b180b9 (patch) | |
tree | ce5aba05243b02d884d6f8ceb178b56523190c42 /Master | |
parent | b4b997286ed025b673f3ba4698d0075952cc7896 (diff) |
tcolorbox 1.10 (1mar12)
git-svn-id: svn://tug.org/texlive/trunk@25548 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/tcolorbox/CHANGES | 10 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/tcolorbox/README | 17 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/tcolorbox/README.TEXLIVE | 1 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/tcolorbox/tcolorbox-example.pdf | bin | 105716 -> 105717 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/tcolorbox/tcolorbox-example.tex | 5 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.pdf | bin | 0 -> 863324 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.tex | 1672 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/tcolorbox/tcbdocumentation.code.tex | 219 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/tcolorbox/tcblistings.code.tex | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/tcolorbox/tcbtheorems.code.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty | 10 | ||||
-rwxr-xr-x | Master/tlpkg/libexec/ctan2tds | 2 |
12 files changed, 1922 insertions, 20 deletions
diff --git a/Master/texmf-dist/doc/latex/tcolorbox/CHANGES b/Master/texmf-dist/doc/latex/tcolorbox/CHANGES index 6ad97cdec71..7234ad1cd4f 100644 --- a/Master/texmf-dist/doc/latex/tcolorbox/CHANGES +++ b/Master/texmf-dist/doc/latex/tcolorbox/CHANGES @@ -1,4 +1,4 @@ -%% The LaTeX package tcolorbox - version 1.02 (2012/02/15) +%% The LaTeX package tcolorbox - version 1.10 (2012/03/01) %% %% ------------------------------------------------------------------------------------------- %% Copyright (c) 2006-2012 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> @@ -28,3 +28,11 @@ version 1.01 (2012/01/26): version 1.02 (2012/02/15) - documentation language changed from German to English - small correction of the theorem title line appearance + +version 1.10 (2012/03/01) +- tcblatex style for listings changed (nolol added) +- improved hyperref support +- new keys parskip and noparskip +- source code of the documentation added +- new library 'documentation' to support LaTeX documentations + with several library commands, environments and keys (see documentation) diff --git a/Master/texmf-dist/doc/latex/tcolorbox/README b/Master/texmf-dist/doc/latex/tcolorbox/README index b7ab210224c..6a1e6fbd554 100644 --- a/Master/texmf-dist/doc/latex/tcolorbox/README +++ b/Master/texmf-dist/doc/latex/tcolorbox/README @@ -1,4 +1,4 @@ -%% The LaTeX package tcolorbox - version 1.02 (2012/02/15) +%% The LaTeX package tcolorbox - version 1.10 (2012/03/01) %% %% ------------------------------------------------------------------------------------------- %% Copyright (c) 2006-2012 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> @@ -30,8 +30,10 @@ Contents of the package 'CHANGES' log of changes (history) 'tcolorbox.sty' LaTeX package file (style file) 'tcblistings.code.tex' LaTeX package file (library of tcolorbox) - 'tcbtheormes.code.tex' LaTeX package file (library of tcolorbox) - 'tcolorbox.pdf' Current documentation for tcolorbox + 'tcbtheorems.code.tex' LaTeX package file (library of tcolorbox) + 'tcbdocumenation.code.tex' LaTeX package file (library of tcolorbox) + 'tcolorbox.pdf' Documentation for tcolorbox + 'tcolorbox.tex' Source code of the documentation 'tcolorbox-example.tex' Example file for package usage 'tcolorbox-example.pdf' Compiled example 'tcolorbox-german.pdf' Outdated documentation in German @@ -41,7 +43,8 @@ Installation Copy the contents of the 'tcolorbox.tds.zip' from CTAN to your local TeX file tree. Alternatively, put the files to their respective locations within the TeX installation: - 'tcolorbox.sty' -> /tex/latex/tcolorbox - 'tcblistings.code.tex' -> /tex/latex/tcolorbox - 'tcbtheormes.code.tex' -> /tex/latex/tcolorbox - all other files -> /doc/latex/tcolorbox + 'tcolorbox.sty' -> /tex/latex/tcolorbox + 'tcblistings.code.tex' -> /tex/latex/tcolorbox + 'tcbtheorems.code.tex' -> /tex/latex/tcolorbox + 'tcbdocumenation.code.tex' -> /tex/latex/tcolorbox + all other files -> /doc/latex/tcolorbox diff --git a/Master/texmf-dist/doc/latex/tcolorbox/README.TEXLIVE b/Master/texmf-dist/doc/latex/tcolorbox/README.TEXLIVE index 7a8aa232472..eb8fb652cb7 100644 --- a/Master/texmf-dist/doc/latex/tcolorbox/README.TEXLIVE +++ b/Master/texmf-dist/doc/latex/tcolorbox/README.TEXLIVE @@ -5,4 +5,3 @@ missing source code. You can find these files on CTAN at If questions or concerns, email tex-live@tug.org. tcolorbox-german.pdf - tcolorbox.pdf diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox-example.pdf b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox-example.pdf Binary files differindex 8a13eca4674..6edcd6357b0 100644 --- a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox-example.pdf +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox-example.pdf diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox-example.tex b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox-example.tex index a267b636fb4..5775b6c380a 100644 --- a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox-example.tex +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox-example.tex @@ -1,4 +1,4 @@ -%% The LaTeX package tcolorbox - version 1.02 (2012/02/15) +%% The LaTeX package tcolorbox - version 1.10 (2012/03/01) %% tcolorbox-example.tex: an example for tcolorbox %% %% ------------------------------------------------------------------------------------------- @@ -20,8 +20,7 @@ \documentclass{article} \usepackage[listings,theorems]{tcolorbox} -\tcbset{before={\par\medskip\pagebreak[0]\noindent},after={\par\medskip}}% - +\tcbset{noparskip} \begin{document} diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.pdf b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.pdf Binary files differnew file mode 100644 index 00000000000..134ac11c8ee --- /dev/null +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.pdf diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.tex b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.tex new file mode 100644 index 00000000000..b7d5422cb86 --- /dev/null +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.tex @@ -0,0 +1,1672 @@ +% \LaTeX-Main\ +%% The LaTeX package tcolorbox - version 1.10 (2012/03/01) +%% tcolorbox.tex: Manual +%% +%% ------------------------------------------------------------------------------------------- +%% Copyright (c) 2006-2012 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% ------------------------------------------------------------------------------------------- +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% 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.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `author-maintained'. +%% +%% This work consists of all files listed in README +%% +\documentclass[a4paper,11pt]{ltxdoc} + +\usepackage[T1]{fontenc} +\usepackage[latin1]{inputenc} +\usepackage[english]{babel} +\usepackage{lmodern,parskip,array,ifthen,calc,makeidx} +\usepackage{amsmath,amssymb} +\usepackage[svgnames,table,hyperref]{xcolor} +\usepackage{tikz} +\usepackage[pdftex,bookmarks,raiselinks,pageanchor,hyperindex,colorlinks]{hyperref} +\urlstyle{sf} + +\usepackage[a4paper,left=2.5cm,right=2.5cm,top=1.5cm,bottom=1.5cm, + marginparsep=5mm,marginparwidth=10mm, + headheight=0mm,headsep=0cm, + footskip=1.5cm,includeheadfoot]{geometry} +\usepackage{fancyhdr} +\fancyhf{} +\fancyfoot[C]{\thepage}% +\renewcommand{\headrulewidth}{0pt} +\renewcommand{\footrulewidth}{0pt} +\pagestyle{fancy} +\tolerance=2000% +\setlength{\emergencystretch}{20pt}% + +\RequirePackage{csquotes} +\RequirePackage[style=numeric-comp,sorting=nyt, + maxnames=8,minnames=8,abbreviate=false,backend=biber]{biblatex} +\DeclareFieldFormat{url}{\newline\url{#1}}% +\DeclareListFormat{language}{}% +\setlength{\bibitemsep}{\smallskipamount} +\addbibresource{\jobname.bib} + +\usepackage[listings,theorems,documentation]{tcolorbox} + +\tcbmakedocSubKey{docTcbKey}{tcb} +\tcbmakedocSubKey{langTcbKey}{tcb/doclang} + +\hypersetup{ + pdftitle={Manual for the tcolorbox package}, + pdfauthor={Thomas F. Sturm}, + pdfsubject={colored boxes}, + pdfkeywords={colored boxes, LaTeX examples, theorems} +} + +\def\version{1.10}% +\def\datum{2012/03/01}% +\makeindex + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{document} +\begin{center} +\vspace*{5mm}\par +{\bfseries\LARGE The \texttt{tcolorbox} package\par} +{\large Manual for version \version\ (\datum)\par}\bigskip +{\large Thomas F.~Sturm% + \footnote{Prof.~Dr.~Dr.~Thomas F.~Sturm, Institut f\"{u}r Mathematik und Informatik, + Universit\"{a}t der Bundeswehr M\"{u}nchen, D-85577 Neubiberg, Germany; + email: \href{mailto:thomas.sturm@unibw.de}{thomas.sturm@unibw.de}} } +\end{center} +\bigskip +\begin{absquote} + \begin{center}\bfseries Abstract\end{center} + |tcolorbox| provides an environment for colored and framed text boxes with a + heading line. Optionally, such a box can be split in an upper and a lower + part. The package |tcolorbox| can be used for the setting of \LaTeX\ examples where + one part of the box displays the source code and the other part shows the + output. Another common use case is the setting of theorems. The package supports + saving and reuse of source code and text parts. +\end{absquote} + + +\tableofcontents + + +\clearpage +\section{Introduction} +The package originates from the first edition of my book +\flqq{\citetitle{sturm:2011b}\frqq~\cite{sturm:2011b} +in about 2006. +For the \LaTeX\ examples and tutorials given there, I wanted to have +accentuated and colored boxes to display source code and +compiled text in combination. +Since, in my opinion, this type of boxes is also quite useful to highlight definitions +and theorems, I applied them for my lecture notes in +mathematics \cite{sturm:2007b,sturm:2008b,sturm:2010a} +as well. +With this package, you are invited to apply these boxes for similar projects. + + +\subsection{Loading the Package} +The base package |tcolorbox| loads the packages +|pgf| \cite{tantau:2010c}, |calc| \cite{thorub:2007a}, and |verbatim| \cite{schoepf:2001a}. +|tcolorbox| itself is loaded in the usual manner in the preamble: +\begin{dispListing} +\usepackage{tcolorbox} +\end{dispListing} +The package takes option keys in the key-value syntax. +Alternatively, you may use these keys later in the preamble with +\refCom{tcbuselibrary} (see there). +For example, the key to typeset listings is: +\begin{dispListing} +\usepackage[listings]{tcolorbox} +\end{dispListing} + + +\subsection{Libraries}\label{sec:bibliothek} +The base package |tcolorbox| is extendable by program libraries. +This is done by usage of option keys while loading the package or inside +the preamble by applying the following macro with the same set of keys. + +\begin{docCommand}{tcbuselibrary}{\marg{key list}} + Loads the libraries given by the \meta{key list}. +\begin{dispListing} +\tcbuselibrary{listings,theorems} +\end{dispListing} +\end{docCommand} + +The following keys are used inside |\tcbuselibrary| respectively +|\usepackage| without the key tree path |/tcb/library/|. + +\begin{docTcbKey}[library]{listings}{}{no value} + Loads the package |listings| \cite{heinz:2007a} and provides additional + macros for typesetting listings which are described in section \ref{sec:listings} + from page \pageref{sec:listings}. +\end{docTcbKey} + +\begin{docTcbKey}[library]{theorems}{}{no value} + Provides additional + macros for typesetting theorems which are described in section \ref{sec:theorems} + from page \pageref{sec:theorems}. +\end{docTcbKey} + +\begin{docTcbKey}[library]{documentation}{}{no value} + Provides additional + macros for typesetting \LaTeX\ documentations + which are described in section \ref{sec:documentation} + from page \pageref{sec:documentation}. +\end{docTcbKey} + + +\clearpage +\section{Macros for Box Creation} + +\subsection{The tcolorbox Environment} +\begin{docEnvironment}{tcolorbox}{\oarg{options}} + This is the main environment to create an accentuated colored text box with + rounded corners and, optionally, two parts. The appearance of this box + is controlled by numerous options. + In the most simple case the source code + +\begin{dispListing} +\begin{tcolorbox} +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispListing} + +creates the following compiled text box: +\begin{tcolorbox} +This is a \textbf{tcolorbox}. +\end{tcolorbox} + +The text content of the box can be divided +in an upper and a lower part +by the command \refCom{tcblower}. Visually, both parts are separated by a line. +For example: + +\begin{dispListing} +\begin{tcolorbox} +This is another \textbf{tcolorbox}. +\tcblower +Here, you see the lower part of the box. +\end{tcolorbox} +\end{dispListing} + +This code gives the following box: +\begin{tcolorbox} +This is another \textbf{tcolorbox}. +\tcblower +Here, you see the lower part of the box. +\end{tcolorbox} + +The \meta{options} control the appearance and several functions of the boxes, +see section \ref{sec:optkeys} for the complete list. +A quick example is given here: + +\begin{dispExample} +\begin{tcolorbox}[colback=red!5,colframe=red!75!black,title=My nice heading] +This is another \textbf{tcolorbox}. +\tcblower +Here, you see the lower part of the box. +\end{tcolorbox} +\end{dispExample} +\end{docEnvironment} + + +\begin{docCommand}{tcblower}{} + Used inside \refEnv{tcolorbox} to separate the upper box part from + the optional lower box part. +\end{docCommand} + +\enlargethispage*{1cm} + +\begin{docCommand}{tcbset}{\marg{options}} + Sets options for every following \refEnv{tcolorbox} inside the current \TeX\ group. + For example, the colors of the boxes may be defined for the whole document by this: +\begin{dispListing} +\tcbset{colback=red!5,colframe=red!75!black} +\end{dispListing} +\end{docCommand} + + +\clearpage +\subsection{Option Keys}\label{sec:optkeys} +For the \meta{options} in \refEnv{tcolorbox} respectively \refCom{tcbset} +the following |pgf| keys can be applied. The key tree path |/tcb/| is not to +be used inside these macros. It is easy to add your own style keys using +the syntax for |pgf| keys, see \cite{tantau:2010c,sturm:2011b} or the examples +starting from page \pageref{sec:latextutorial}. + +\begin{docTcbKey}{title}{=\meta{text}}{no default, initially empty} + Creates a heading line with \meta{text} as content. +\begin{dispExample} +\begin{tcolorbox}[title=My heading line] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{notitle}{}{no value, initially set} + Removes the title line if set before. +\end{docTcbKey} + +\begin{docTcbKey}{width}{=\meta{length}}{no default, initially \cs{linewidth}} + Sets the total width of the colored box to \meta{length}. +\begin{dispExample} +\begin{tcolorbox}[width=\linewidth/2] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{boxrule}{=\meta{length}}{no default, initially \texttt{0.5mm}} + Sets the frame width to \meta{length}. +\begin{dispExample} +\begin{tcolorbox}[boxrule=2mm] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\clearpage +\begin{docTcbKey}{arc}{=\meta{length}}{no default, initially \texttt{1mm}} + Sets the radius of the four frame arcs to \meta{length}. +\begin{dispExample} +\begin{tcolorbox}[arc=0mm] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\begin{tcolorbox}[arc=4mm] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{boxsep}{=\meta{length}}{no default, initially \texttt{1mm}} + Sets a common padding of \meta{length} between the text content and the + frame of the box. This value is added to the key values of + |left|, |right|, |top|, |bottom|, and |middle| at the appropriate places. +\begin{dispExample} +\begin{tcolorbox}[boxsep=5mm] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{left}{=\meta{length}}{no default, initially \texttt{4mm}} + Sets the left space between text and frame (additional to |boxsep|). +\begin{dispExample} +\begin{tcolorbox}[left=0mm] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{right}{=\meta{length}}{no default, initially \texttt{4mm}} + Sets the right space between text and frame (additional to |boxsep|). +\begin{dispExample} +\begin{tcolorbox}[right=11.7cm] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\clearpage +\begin{docTcbKey}{top}{=\meta{length}}{no default, initially \texttt{2mm}} + Sets the top space between text and frame (additional to |boxsep|). +\begin{dispExample} +\begin{tcolorbox}[top=0mm] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{bottom}{=\meta{length}}{no default, initially \texttt{2mm}} + Sets the bottom space between text and frame (additional to |boxsep|). +\begin{dispExample} +\begin{tcolorbox}[bottom=0mm] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{middle}{=\meta{length}}{no default, initially \texttt{2mm}} + Sets the space between upper and lower text to the separation line + (additional to |boxsep|). +\begin{dispExample} +\begin{tcolorbox}[middle=0mm,boxsep=0mm] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{colback}{=\meta{color}}{no default, initially \texttt{black!5}} + Sets the background \meta{color} of the box. +\begin{dispExample} +\begin{tcolorbox}[colback=white] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\clearpage +\begin{docTcbKey}{colframe}{=\meta{color}}{no default, initially \texttt{black!75}} + Sets the frame \meta{color} of the box. +\begin{dispExample} +\begin{tcolorbox}[colframe=red!50!yellow] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{coltext}{=\meta{color}}{no default, initially \texttt{black}} + Sets the text \meta{color} of the box. +\begin{dispExample} +\begin{tcolorbox}[coltext=yellow,colback=blue!50,colframe=blue] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{coltitle}{=\meta{color}}{no default, initially \texttt{white}} + Sets the title text \meta{color} of the box. +\begin{dispExample} +\begin{tcolorbox}[coltitle=blue!50!black,colframe=blue!25,title=Test] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{fontupper}{=\meta{text}}{no default, initially empty} + Sets \meta{text} before the content of the upper part (e.\,g.\ font settings). +\begin{dispExample} +\begin{tcolorbox}[fontupper=Hello!~\sffamily] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\clearpage +\begin{docTcbKey}{fontlower}{=\meta{text}}{no default, initially empty} + Sets \meta{text} before the content of the lower part (e.\,g.\ font settings). +\begin{dispExample} +\begin{tcolorbox}[fontlower=\sffamily\bfseries] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{fonttitle}{=\meta{text}}{no default, initially empty} + Sets \meta{text} before the content of the title text (e.\,g.\ font settings). +\begin{dispExample} +\begin{tcolorbox}[fonttitle=\sffamily\bfseries\large,title=Hello] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{lowerbox}{=\meta{mode}}{no default, initially \texttt{visible}} + Controls the treatment of the lower part of the box. + Feasible values for \meta{mode} are: + \begin{itemize} + \item |visible|: usual type setting of the lower part, + \item |invisible|: empty space instead of the lower part contents, + \item |ignored|: the lower part is not used (here). + \end{itemize} + The last two values are usually applied in connection with |savelowerto|. +\begin{dispExample} +\begin{tcolorbox}[lowerbox=invisible] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part (but invisible). +\end{tcolorbox} + +\begin{tcolorbox}[lowerbox=ignored] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part (but ignored). +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\clearpage +\begin{docTcbKey}{savelowerto}{=\meta{file name}}{no default, initially empty} + Saves the content of the lower box in a file for an optional later usage. +\begin{dispExample} +\begin{tcolorbox}[lowerbox=invisible,savelowerto=\jobname_bspsave.tex] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part which may be quite complex: +$\displaystyle f(x)=\frac{1+x^2}{1-x^2}$. +\end{tcolorbox} + +Now, we load the saved text:\\ +\input{\jobname_bspsave.tex} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{savedelimiter}{=\meta{name}}{no default, initially \texttt{tcolorbox}} + Used in connection with new environment definitions which extend + |tcolorbox| and use or allow the option |savelowerto|. + To catch the end of the new box environment \meta{name} has to be the name of + this environment. Additionally, the environment definition has to use + |\tcolorbox| instead of + |\begin{tcolorbox}| and |\endtcolorbox| instead of |\end{tcolorbox}|. +\begin{dispExample} +\newenvironment{mybox}[1]{% + \tcolorbox[savedelimiter=mybox, + savelowerto=\jobname_bspsave2.tex, + lowerbox=ignored, + colback=red!5,colframe=red!75!black,fonttitle=\bfseries,title=#1]}% + {\endtcolorbox} + +\begin{mybox}{My Example} +Upper part. +\tcblower +Saved lower part! +\end{mybox} + +Now, the saved part is used: +\begin{tcolorbox}[colback=green!5] +\input{\jobname_bspsave2.tex} +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\clearpage +\begin{docTcbKey}{floatplacement}{=\meta{values}}{no default, initially \texttt{htb}} + Sets \meta{values} as default values for the usage of |float|. + Feasible are the usual parameters for floating objects. +\begin{dispListing} +\begin{tcolorbox}[floatplacement=t,float, + title=Floating box from |floatplacement|] + This floating box is placed at the top of a page. +\end{tcolorbox} +\end{dispListing} +\tcbusetemp +\end{docTcbKey} + + +\begin{docTcbKey}{float}{\colOpt{=\meta{values}}}{default from \texttt{floatplacement}} + Turns the box to a floating object where \meta{values} are the + usual parameters for such floating objects. + If they are not used, the placement uses the default values given by + |floatplacement|. +\begin{dispListing} +\begin{tcolorbox}[float, title=Floating box from |float|] + This box floats to a feasible place automatically. You do not have to + use a numbering for this floating object. +\end{tcolorbox} +\end{dispListing} +\tcbusetemp +\end{docTcbKey} + + +\begin{docTcbKey}{before}{=\meta{macros}}{no default, initially \cs{par}\cs{pagebreak[0]}\cs{noindent}} + Sets the \meta{macros} which are executed before the colored box. + They are not used for floating boxes. +\end{docTcbKey} + +\begin{docTcbKey}{after}{=\meta{macros}}{no default, initially \cs{par}} + Sets the \meta{macros} which are executed after the colored box. + They are not used for floating boxes. +\end{docTcbKey} + +\begin{docTcbKey}{parskip}{}{style, no value} + Sets the keys |before| and |after| to their default values. + This is recommended, if the package |parskip| is used and there is no better + idea for |before| and |after|. +\end{docTcbKey} + +\begin{docTcbKey}{noparskip}{}{style, no value} + Sets the keys |before| and |after| to values which are + recommended, if the package |parskip| is \emph{not} used and there is no better + idea for |before| and |after|. +\begin{dispListing} +\tcbset{noparskip/.style={before={\par\smallskip\pagebreak[0]\noindent}, + after={\par\smallskip}}} +\end{dispListing} +\end{docTcbKey} + +\begin{docTcbKey}{tempfile}{=\meta{file name}}{no default, initially \cs{jobname.tcbtemp}} + Sets \meta{file name} as name for the temporary file which is used inside + \refEnv{tcbwritetemp} and \refCom{tcbusetemp} implicitely. +\end{docTcbKey} + + + +\clearpage +\section{Saving and Loading of Verbatim Texts} +The following macros are slightly modified versions of the original macros +from the known packages |moreverb| and |verbatim|. +They are used implicitly inside of a |tcolorbox| environment, +but they can be used outside also. +\enlargethispage*{1.5cm} + +\begin{docEnvironment}{tcbverbatimwrite}{\marg{file name}} + Saves the \meta{environment content} to a file named by \meta{file name}. + \TeX\ macros inside the environment are not expanded. +\begin{dispExample} +\begin{tcbverbatimwrite}{\jobname_verbexp.tex} + This text is saved \textit{as is}. +\end{tcbverbatimwrite} + +Now, we are using the file:\par +\input{\jobname_verbexp.tex} +\end{dispExample} + +This environment may be used inside an own environment. Note, that inside +the environment definition |\tcbverbatimwrite| has to be used instead of +|\begin{tcbverbatimwrite}| and |\endtcbverbatimwrite| instead of |\end{tcbverbatimwrite}|. +\begin{dispExample} +\newenvironment{myverbatim}{% + \begingroup\tcbverbatimwrite{\jobname_myverb.tex}}% + {\endtcbverbatimwrite\endgroup} + +\begin{myverbatim} + This is the text which is saved by my own environment. +\end{myverbatim} + +Now, we are using the file:\par +\input{\jobname_myverb.tex} +\end{dispExample} +\end{docEnvironment} + +\begin{docEnvironment}{tcbwritetemp}{} + Has the same function as \refEnv{tcbverbatimwrite}, but uses the key value + of |tempfile| for the file name. +\begin{dispExample} +\begin{tcbwritetemp} + This text is saved \textit{as is}. +\end{tcbwritetemp} + +Now, we are using the file:\par +\tcbusetemp +\end{dispExample} +\end{docEnvironment} + + +\begin{docCommand}{tcbusetemp}{} + Loads the current temporary file which was saved by \refEnv{tcbwritetemp}. +\end{docCommand} + + + +\clearpage +\section{Library 'listings'}\label{sec:listings} +The library is loaded by a package option or inside the preamble by: +\begin{dispListing} +\tcbuselibrary{listings} +\end{dispListing} +This also loads the package |listings| \cite{heinz:2007a}. + +\subsection{Macros of the Library} + +\begin{docEnvironment}{tcblisting}{\marg{options}} + Creates a colored box based on a \refEnv{tcolorbox}. + Controlled by the given \meta{options}, the + environment content is typesetted normally and/or as a listing. + Furthermore, the \meta{options} control appearance and functions of + the |tcolorbox|. + By default, the listing is interpreted as a \LaTeX\ listing. +\begin{dispExample} +\begin{tcblisting}{colback=red!5,colframe=red!75!black} +This is a \LaTeX\ example which displays the text as source code +and in compiled form. +\end{tcblisting} +\end{dispExample} +\begin{dispExample} +\begin{tcblisting}{colback=yellow!5,colframe=yellow!50!black,listing only, + title=This is source code in another language (XML), fonttitle=\bfseries, + listing options={language=XML,columns=fullflexible,keywordstyle=\color{red}}} +<?xml version="1.0"?> +<project name="Package tcolorbox" default="documentation" basedir="."> + <description> + Apache Ant build file (http://ant.apache.org/) + </description> +</project> +\end{tcblisting} +\end{dispExample} +\end{docEnvironment} + + +\clearpage +\begin{docEnvironment}{tcboutputlisting}{} + Saves the environment content to a file which is named by the key value of + |listing file|. Later, this file can be loaded by + |\tcbinputlisting| or |\tcbuselistingtext| or |\tcbuselistinglisting|. +\begin{dispExample} +\begin{tcboutputlisting} +This \textbf{text} is written to a standardized file for later usage. +\end{tcboutputlisting} +\end{dispExample} +\end{docEnvironment} + + +\begin{docCommand}{tcbinputlisting}{\marg{options}} + Creates a colored boxed based on a |tcolorbox|. The text content is read + from a file named by the key value of |listing file|. Apart from that, + the function is equal to that of \refEnv{tcblisting}. +\begin{dispExample} +\tcbinputlisting{colback=red!5,colframe=red!75!black,text only} +\tcbinputlisting{colback=green!5,colframe=green!75!black,listing only} +\end{dispExample} +\end{docCommand} + + +\begin{docCommand}{tcbuselistingtext}{} + Loads text from a file named by the key value of |listing file|. +\begin{dispExample} +\tcbuselistingtext +\end{dispExample} +\end{docCommand} + + +\begin{docCommand}{tcbuselistinglisting}{} + Typesets text as listing from a file named by the key value of |listing file|. +\begin{dispExample} +\tcbuselistinglisting +\end{dispExample} +\end{docCommand} + + +\begin{docCommand}{tcbusetemplisting}{} + Typesets text as listing from a temporary file which was written by + \refEnv{tcbwritetemp}. +\end{docCommand} + + +\clearpage +\subsection{Option Keys of the Library} +For the \meta{options} in \refEnv{tcblisting} respectively \refCom{tcbinputlisting} +the following |pgf| keys can be applied. The key tree path |/tcb/| is not to +be used inside these macros. + +\begin{docTcbKey}{listing file}{=\meta{file name}}{no default, initially \cs{jobname.listing}} + Sets the \meta{file name} of the file which is used to save listings. +\end{docTcbKey} + +\begin{docTcbKey}{listing options}{=\meta{key list}}{no default, initially |style=tcblatex|} + Sets the options from the package |listings| \cite{heinz:2007a} + which are used during typesetting of the listing. + For \LaTeX\ listings, there is a predefined |listings| style named |tcblatex| + which can be used. +\begin{dispExample} +\begin{tcblisting}{colback=red!5,colframe=red!25,left=6mm, +listing options={style=tcblatex,numbers=left,numberstyle=\tiny\color{red!75!black}}} +This is a \LaTeX\ example which displays the text as source code +and in compiled form. Additionally, we use line numbers here. +\end{tcblisting} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{listing style}{=\meta{style}}{no default, initially |tcblatex|} + Abbreviation for |listing options={style=...}|. This key sets a \meta{style} + for the |listings| package, see \cite{heinz:2007a}. + For \LaTeX, there is a predefined style named |tcblatex|. +\begin{dispExample} +\begin{tcblisting}{colback=red!5,colframe=red!75!black, +listing style=tcblatex} +Here, we use the predefined style. +\end{tcblisting} +\end{dispExample} +\end{docTcbKey} + +\clearpage +\begin{docTcbKey}{listing and text}{}{no value, initially set} + Typesets the environment content as listing in the upper part and + as compiled text in the lower part. +\begin{dispExample} +\begin{tcblisting}{colback=red!5,colframe=red!75!black,listing and text} +This is a \LaTeX\ example. +\end{tcblisting} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{text and listing}{}{no value} + Typesets the environment content as compiled text in the upper part and + as listing in the lower part. +\begin{dispExample} +\begin{tcblisting}{colback=red!5,colframe=red!75!black,text and listing} +This is a \LaTeX\ example. +\end{tcblisting} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{listing only}{}{no value} + Typesets the environment content as listing. +\begin{dispExample} +\begin{tcblisting}{colback=red!5,colframe=red!75!black,listing only} +This is a \LaTeX\ example. +\end{tcblisting} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{text only}{}{no value} + Typesets the environment content as compiled text. +\begin{dispExample} +\begin{tcblisting}{colback=red!5,colframe=red!75!black,text only} +This is a \LaTeX\ example. +\end{tcblisting} +\end{dispExample} +\end{docTcbKey} + + + +\clearpage +\subsection{Creation of \LaTeX\ Tutorials}\label{sec:latextutorial} +The following source code gives a guideline for the creation of \LaTeX\ tutorials. +In the next section, a framework for \LaTeX\ exercises is described. +All examples shall be numbered optionally. + +Firstly, some additional |tcb| keys are defined for the appearance and automatic +numbering. + +\begin{dispListing} +\newcounter{texexp} + +\tcbset{ + texexp/.style={colframe=red!50!yellow!50!black, colback=red!50!yellow!5!white, + coltitle=red!50!yellow!3!white, + fonttitle=\small\sffamily\bfseries, fontupper=\small, fontlower=\small}, + example/.code 2 args={\refstepcounter{texexp}\label{#2}% + \pgfkeysalso{texexp,title={Example \thetexexp: #1}}}, +} +\end{dispListing} +\tcbusetemp + + +\begin{dispExample} +\begin{tcblisting}{texexp} +This is a \LaTeX\ example which displays the text as source code +and in compiled form. +\end{tcblisting} +\end{dispExample} + + +\begin{dispExample} +\begin{tcblisting}{example={Direct application of \texttt{example}}{firstExample}} +Here, we use Example \ref{firstExample} with a title line. +\end{tcblisting} +\end{dispExample} + +For the next examples, two environments +|texexp| and |texexptitled| +are defined for abbreviation. + +\begin{dispListing} +\newenvironment{texexp}[1]{\tcblisting{texexp,#1}}{\endtcblisting} + +\newenvironment{texexptitled}[3][]{\tcblisting{example={#2}{#3},#1}}{\endtcblisting} +\end{dispListing} +\tcbusetemp + +For special cases, |tcolorbox| with the key +|texexp| can be used instead of these two environments. + +Now, we have a flexible box for \LaTeX\ examples which is demonstrated in +the following. + +\begin{dispExample} +\begin{texexp}{} +This is a \LaTeX\ example which displays the text as source code +and in compiled form. +\end{texexp} +\end{dispExample} + + +\begin{dispExample} +\begin{texexp}{text and listing} +This is a \LaTeX\ example which displays the text as source code +and in compiled form. +\end{texexp} +\end{dispExample} + + +\begin{dispExample} +\begin{texexp}{listing only} +This is a \LaTeX\ example which displays the text as source code only. +\end{texexp} +\end{dispExample} + + +\begin{dispExample} +\begin{texexp}{text only} +This is a \LaTeX\ example which displays the text in compiled form only. +\end{texexp} +\end{dispExample} + + +\begin{dispExample} +\begin{texexptitled}{An Example with a Heading}{heading1} +This is a \LaTeX\ example with a numbered heading line +which can be referred to. +\end{texexptitled} +Here, we see Example \ref{heading1}. +\end{dispExample} + + +\begin{dispExample} +\begin{texexptitled}[listing only]{Another Example with a Heading}{heading2} +The keys can be used in combination. Here, an example with a heading line +and source code only is given. +\end{texexptitled} +Here, we see Example \ref{heading2}. +\end{dispExample} + + +\begin{dispListing} +\begin{texexptitled}[float]{A floating Example with a Heading}{heading3} +This is another \LaTeX\ example with numbered heading line. +But now, the box is a floating object. +\end{texexptitled} +\end{dispListing} +\tcbusetemp + +\begin{dispExample} +The floating box of the last example is seen as Example \ref{heading3} +on page \pageref{heading3}. +\end{dispExample} + + +\begin{dispExample} +\begin{tcolorbox}[example={Direct application of the style |texexp|}{texexpbox1}] +\begin{lstlisting}[style=tcblatex] +Some \LaTeX\ source code. +\end{lstlisting} +\tcblower +For special cases, the environment |tcolorbox| with style +|example| can be used directly. As one can see, the upper and the lower +part of the box can be used uncoupled also. +\end{tcolorbox} +\end{dispExample} + + +\subsection{Creation of \LaTeX\ Exercises} +In the following, a guideline is given for the creation of \LaTeX\ exercises +with solutions. These solutions are saved to disk for application at a place of +choice. +Therefore, all used exercises are logged to a file |\jobname.sol| for automatic +processing. The solution contents themselves are saved to a subdirectory named +|solutions|. + +\begin{dispListing} +\newcounter{texercise} + +\newwrite\solout +\def\openoutsol{\immediate\openout\solout\jobname.sol} +\def\solfile#1{solutions/texercise#1.tex} +\def\writesol#1{\immediate\write\solout{\noexpand\processsol{\thetexercise}{#1}}}% +\def\closeoutsol{\immediate\closeout\solout} +\def\inputsol{\IfFileExists{\jobname.sol}{\input{\jobname.sol}}{}} +\end{dispListing} +\tcbusetemp + +\begin{itemize} +\item Before the first exercise is given, + |\openoutsol| has to be called to start logging. +\item The solution is given as content of a \refEnv{tcboutputlisting} + environment. Note, that you can use this content also inside the + exercise with \refCom{tcbuselistingtext} in compiled form. +\item After the last exercise is given (and before using the solutions), + |\closeoutsol| has to be called to stop logging. +\item The solutions are loaded by |\inputsol|. +\end{itemize} + +Inside the excercise text, there may be text parts which are needed as +\LaTeX\ source code and as compiled text as well. These parts can be +saved by \refEnv{tcbwritetemp} and used in compiled form by \refCom{tcbusetemp} +or as source code by \refCom{tcbusetemplisting}. + +At first, we generate some new keys. Since exercises und solutions should +be numbered, we force to use a label \meta{marker} while using the style |texercise|. +Automatically, the label |exe:|\meta{marker} is used to mark the exercise +and the label |sol:|\meta{marker} is used to mark the solution. + +\begin{dispListing} +\tcbset{ +texercisestyle/.style={arc=0.5mm, colframe=blue!25!yellow!90!white, + colback=blue!25!yellow!5!white, coltitle=blue!25!yellow!40!black, + fonttitle=\small\sffamily\bfseries, fontupper=\small, fontlower=\small}, +texercise/.code={\refstepcounter{texercise}\label{exe:#1}\writesol{#1}% + \pgfkeysalso{texercisestyle, + listing file={\solfile\thetexercise}, + title={Exercise \arabic{texercise}\hfill\mdseries Solution on page \pageref{sol:#1}} + }} +} +\end{dispListing} +\tcbusetemp + +With these preparations, the kernel environment |texercise| for our +exercises is created quickly: + +\begin{dispListing} +\newenvironment{texercise}[2][]{% + \tcolorbox[texercise=#2,savedelimiter=texercise,#1]}% + {\endtcolorbox} +\end{dispListing} +\tcbusetemp + +The following examples demonstrate the application. +\openoutsol + + +\begin{dispExample} +\begin{texercise}{tabular_example} +\textit{Create the following table:}\par\smallskip% +\begin{tcboutputlisting} +\begin{tabular}{|p{3cm}|p{3cm}|p{3cm}|p{3cm}|}\hline +\multicolumn{4}{|c|}{\bfseries\itshape Das alte Italien}\\\hline +\multicolumn{2}{|c|}{\bfseries Antike} & +\multicolumn{2}{c|}{\bfseries Mittelalter}\\\hline +\multicolumn{1}{|c|}{\itshape Republik}& +\multicolumn{1}{c|}{\itshape Kaiserreich}& +\multicolumn{1}{c|}{\itshape Franken}& +\multicolumn{1}{c|}{\itshape Teilstaaten}\\\hline +In den Zeiten der r\"{o}mischen Republik standen dem Staat jeweils zwei +Konsuln vor, deren Machtbefugnisse identisch waren. & +Das r\"{o}mische Kaiserreich wurde von einem Alleinherrscher, dem Kaiser, +regiert. +& In der V\"{o}lkerwanderungszeit \"{u}bernahmen die Goten und sp\"{a}ter die +Franken die Vorherrschaft. +& Im sp\"{a}teren Mittelalter regierten F\"{u}rsten einen Fleckenteppich +von Einzelstaaten.\\\hline +\end{tabular} +\end{tcboutputlisting} +\tcbuselistingtext% +\end{texercise} +\end{dispExample} + + +\begin{dispExample} +\begin{texercise}{macro_oneparam} +\begin{tcboutputlisting} +\newcommand{\headingline}[1]{% + \begin{center}\Large\bfseries #1\end{center}} +\end{tcboutputlisting} +\tcbuselistingtext% + +Create a new macro \verb+\headingline+ which produces the +following output:\par\smallskip +\begin{tcbwritetemp} +\headingline{Very important heading} +\end{tcbwritetemp} +\tcbusetemplisting\tcbusetemp% +\end{texercise} +\end{dispExample} + + + +\begin{dispExample} +\begin{texercise}{macro_twoparam} +\begin{tcboutputlisting} +\newcommand{\minitable}[2]{% + \begin{center}\begin{tabular}{p{10cm}}\hline% + \multicolumn{1}{c}{\bfseries#1}\\\hline% + #2\\\hline% + \end{tabular}\end{center}} +\end{tcboutputlisting} +\tcbuselistingtext% +Create a new macro \verb+\minitable+ which produces the +following output:\par\smallskip +\begin{tcbwritetemp} +\minitable{My heading}{In this tiny tabular, there is only a heading + and some text below which has a width of ten centimeters.} +\end{tcbwritetemp} +\tcbusetemplisting\par\smallskip\tcbusetemp% +\end{texercise} +\end{dispExample} + + +\begin{dispExample} +\begin{texercise}{macro_threeparam} +\begin{tcboutputlisting} +\newcommand{\synop}[3]{% + \begin{tabular}{@{}p{(\linewidth-\tabcolsep*2-\arrayrulewidth)/2}|% + p{(\linewidth-\tabcolsep*2-\arrayrulewidth)/2}@{}}\hline + \multicolumn{2}{c}{\bfseries #1}\\\hline + \multicolumn{1}{c|}{\itshape English}& + \multicolumn{1}{c}{\itshape German}\\\hline + #2 & #3 + \end{tabular}} +\end{tcboutputlisting} +\tcbuselistingtext% +Create a new macro \verb+\synop+ which typesets a synoptic text according +to the following example. Base your macro on a tabular which takes the +total line width.\par\smallskip +\begin{tcbwritetemp} +\synop{Neil Armstrong}% +{That's one small step for a man, one giant leap for mankind.}% +{Das ist ein kleiner Schritt f\"{u}r einen Mann, + ein riesiger Sprung f\"{u}r die Menschheit.} +\end{tcbwritetemp} +\tcbusetemplisting\par\smallskip\tcbusetemp% +\end{texercise} +\end{dispExample} + + + +\closeoutsol +\subsection{Solutions for the given \LaTeX\ Exercises} + +For all solutions, a macro |\processsol| was written to the file |\jobname.sol|. +Now, we need a definition for this macro to use the solutions. + +\begin{dispListing} +\newcommand{\processsol}[2]{% + \tcbinputlisting{texercisestyle,listing only, + title={Solution for Exercise \ref{exe:#2} on page \pageref{exe:#2}\label{sol:#2}}, + listing file={\solfile#1}% + }} +\end{dispListing} +\tcbusetemp + +The loading of all solutions is done by: + +\begin{dispListing} +\inputsol +\end{dispListing} + +With this, we get: + +\tcbusetemp + + +\clearpage +\section{Library 'theorems'}\label{sec:theorems} +The library is loaded by a package option or inside the preamble by: +\begin{dispListing} +\tcbuselibrary{theorems} +\end{dispListing} + +\subsection{Macros of the Library} + +\begin{docCommand}{tcbmaketheorem}{\marg{name}\marg{display name}\marg{options}\marg{counter}\marg{prefix}} + Creates a new environment \meta{name} based on |tcolorbox| to frame a + (mathematical) theorem. The \meta{display name} is used in the title line + with a number, e.\,g. \mbox{\flqq Theorem 5.1\frqq}. + The \meta{options} are given to the underlying |tcolorbox| to control + the appearance. + The \meta{counter} is used for automatic numbering. + The new environment \meta{name} takes one optional and two mandatory + parameters. The optional parameter supplements the options and should be + used only in rare cases. + The first mandatory parameter is the title text for the theorem and + the second mandatory parameter is a \meta{marker}. The theorem is + automatically labeled with \meta{prefix}|:|\meta{marker}. +\begin{dispExample} +\tcbmaketheorem{theo}{My Theorem}{colback=green!5,colframe=green!35!black, + fonttitle=\bfseries}{texercise}{th} + +\begin{theo}{This is my title}{theoexample} + This is the text of the theorem. As can be seen, the counter \texttt{texercise} + is reused. The theorem is numbered with \ref{th:theoexample} and is + given on page \pageref{th:theoexample}. +\end{theo} +\end{dispExample} +\end{docCommand} + +% + +\subsection{Option Keys of the Library} +\enlargethispage*{1cm} + +\begin{docTcbKey}{theorem}{=\marg{display name}\marg{counter}\marg{title}\marg{marker}}{no default} + This key is internally used by \refCom{tcbmaketheorem}, but can be used + directly in a |tcolorbox| for a more flexible approach. + The \meta{display name} is used together with the increased \meta{counter} value + and the \meta{title} for the title line of the box. Additionally, a + |\label| with the given \meta{marker} is created. +\begin{dispExample} +\begin{tcolorbox}[colback=green!10,colframe=green!50!black,arc=4mm, + theorem={Test}{texercise}{Direct usage}{myMarker}] +Here, we see the test \ref{myMarker}. +\end{tcolorbox} +\end{dispExample} +For a common appearance inside the document, the key |theorem| should not be +used directly as in the example above, but as part of a new environment +created by hand or using \refCom{tcbmaketheorem}. +\end{docTcbKey} + +% + +\subsection{Examples for Definitions and Theorems} +In the following, the application of \refCom{tcbmaketheorem} +to highlight mathematical definitions, theorems, or the like is demonstrated. + +At first, additional |tcb| keys are created for the appearance of +the colored boxes. It is assumed that theorems and corollaries should be +identically colored. +All following environments are numbered with a common counter, but this +can be changed easily. Here, the counter output is supplemented by +the section number. + +\begin{dispListing} +\newcounter{mytheorem}[section] +\def\themytheorem{\thesection.\arabic{mytheorem}} + +\tcbset{ + defstyle/.style={fonttitle=\bfseries\upshape, fontupper=\slshape, + arc=0mm, colback=blue!5,colframe=blue!75!black}, + theostyle/.style={fonttitle=\bfseries\upshape, fontupper=\slshape, + colback=red!10,colframe=red!75!black}, +} +\end{dispListing} +\tcbusetemp + +By \refCom{tcbmaketheorem}, commonly numbered theorem environments are +created now. |defstyle| and |theostyle| are used for the appearance. + +\begin{dispListing} +\tcbmaketheorem{Definition}{Definition}{defstyle}{mytheorem}{def} +\tcbmaketheorem{Theorem}{Theorem}{theostyle}{mytheorem}{theo} +\tcbmaketheorem{Corollary}{Corollary}{theostyle}{mytheorem}{cor} +\end{dispListing} +\tcbusetemp + +Now, everything is prepared for the following examples. + +\begin{dispExample} +The following theorem is numbered as Theorem \ref{theo:diffbarstetig} and +referenced with the marker \texttt{theo:diffbarstetig}.\bigskip + +\begin{Theorem}{Differenzierbarkeit bedingt Stetigkeit, wobei diese Benennung + zu Testzwecken ungew\"{o}hnlich lang ist}{diffbarstetig}% + Eine Funktion $f:I\to\mathbb{R}$ ist in $x_0\in I$ stetig, wenn $f$ in + $x_0$ differenzierbar ist. +\end{Theorem} +\end{dispExample} + + +\begin{dispExample} +The following definition is numbered as Definition \ref{def:diffbarkeit} and +referenced with the marker \texttt{def:diffbarkeit}.\bigskip + +\begin{Definition}{Differenzierbarkeit}{diffbarkeit} + Eine Funktion $f:~I\to\mathbb{R}$ auf einem Intervall $I$ hei\ss{}t in + $x_0\in I$ differenzierbar oder linear approximierbar, + wenn der Grenzwert + \begin{equation*} + \lim\limits_{x\to x_0}\frac{f(x)-f(x_0)}{x-x_0}= + \lim\limits_{h\to 0}\frac{f(x_0+h)-f(x_0)}{h} + \end{equation*} + existiert. Bei Existenz hei\ss{}t dieser Grenzwert Ableitung + oder Differentialquotient von $f$ in $x_0$ und man + schreibt f\"{u}r ihn + \begin{equation*} + f'(x_0)\quad\text{oder}\quad\frac{df}{dx}(x_0). + \end{equation*} +\end{Definition} +\end{dispExample} + + +\begin{dispExample} +The following corollary is numbered as Corollary \ref{cor:nullstellen} and +referenced with the marker \texttt{cor:nullstellen}.\bigskip + +\begin{Corollary}{Nullstellenexistenz}{nullstellen} + Ist $f:[a,b]\to\mathbb{R}$ stetig und haben $f(a)$ und $f(b)$ entgegengesetzte + Vorzeichen, also $f(a)f(b)<0$, so besitzt $f$ eine Nullstelle $x_0\in]a,b[$, + also $f(x_0)=0$. +\end{Corollary} +\end{dispExample} + + +\begin{dispExample} +\begin{Theorem}[boxrule=2mm]{Hinreichende Bedingung + f\"{u}r Wendepunkte}{wendehinreichend}% + $f$ sei eine auf einem Intervall $]a,b[$ dreimal stetig differenzierbare Funktion. + Ist $f''(x_0)=0$ in $x_0\in]a,b[$ und $f'''(x_0)\ne 0$, so ist + $(x_0,f(x_0))$ ein Wendepunkt von $f$. +\end{Theorem} +\end{dispExample} + + + +\clearpage +\section{Library 'documentation'}\label{sec:documentation} +This library has the single purpose to support \LaTeX\ package documentations +like this one. Actually, the visual nature follows the approach from +Till Tantau's |pgf| \cite{tantau:2010c} documentation. +Typically, this library is assumed to be used in conjunction with the +class |ltxdoc| or alike. + +The library is loaded by a package option or inside the preamble by: +\begin{dispListing} + \tcbuselibrary{documentation} +\end{dispListing} +This also loads the library 'listings', see section \ref{sec:listings}, +and a bunch of packages, namely +|doc|, |pifont|, |marvosym|, |hyperref|, and |makeidx|. + + +\subsection{Macros of the Library} + +\begin{docEnvironment}{docCommand}{\marg{name}\marg{parameters}} + Documents a \LaTeX\ macro with given \meta{name} where \meta{name} is + written without backslash. This macro takes mandatory or optional \meta{parameters}. + It is automatically indexed and can be referenced with + \refCom{refCom}\marg{name}. +\begin{dispExample} +\begin{docCommand}{foomakedocSubKey}{\marg{name}\marg{key path}} + Creates a new environment \meta{name} based on \refEnv{docKey} for the + documentation of keys with the given \meta{key path}. +\end{docCommand} +\end{dispExample} +\end{docEnvironment} + + +{\let\xdocEnvironment\docEnvironment +\let\endxdocEnvironment\enddocEnvironment +\begin{xdocEnvironment}{docEnvironment}{\marg{name}\marg{parameters}} + Documents a \LaTeX\ environment with given \meta{name}. + This environment takes mandatory or optional \meta{parameters}. + It is automatically indexed and can be referenced with + \refCom{refEnv}\marg{name}. +\begin{dispExample} +\begin{docEnvironment}{foocolorbox}{\oarg{options}} + This is the main environment to create an accentuated colored text box with + rounded corners and, optionally, two parts. +\end{docEnvironment} +\end{dispExample} +\end{xdocEnvironment}} + +\clearpage +\begin{docEnvironment}{docKey}{\oarg{key path}\marg{name}\marg{parameters}\marg{description}} + Documents a key with given \meta{name} and an optional \meta{key path}. + This key takes mandatory or optional \meta{parameters} as value + with a short \meta{description}. + It is automatically indexed and can be referenced with + \refCom{refKey}\marg{name}. +\begin{dispExample} +\begin{docKey}[foo]{footitle}{=\meta{text}}{no default, initially empty} + Creates a heading line with \meta{text} as content. +\end{docKey} +\end{dispExample} +\end{docEnvironment} + + +\begin{docCommand}{docColor}{\marg{name}} + Documents a color with given \meta{name}. The color is automatically indexed. +\begin{dispExample} +The color \docColor{foocolor} is available. +\end{dispExample} +\end{docCommand} + + +\begin{docCommand}{cs}{\marg{name}} + Macro from |ltxdoc| \cite{carlisle:2007a} to typeset a command word \meta{name} + where the backslash is prefixed. The library overwrites the original macro. +\begin{dispExample} +This is a \cs{foocommand}. +\end{dispExample} +\end{docCommand} + +\begin{docCommand}{meta}{\marg{text}} + Macro from |doc| \cite{mittelbach:2011a} to typeset a meta \meta{text}. +\begin{dispExample} +This is a \meta{text}. +\end{dispExample} +\end{docCommand} + +\begin{docCommand}{marg}{\marg{text}} + Macro from |ltxdoc| \cite{carlisle:2007a} to typeset a \meta{text} with + curly brackets as a mandatory argument. The library overwrites the original macro. +\begin{dispExample} +This is a mandatory \marg{argument}. +\end{dispExample} +\end{docCommand} + +\begin{docCommand}{oarg}{\marg{text}} + Macro from |ltxdoc| \cite{carlisle:2007a} to typeset a \meta{text} with + square brackets as an optional argument. The library overwrites the original macro. +\begin{dispExample} +This is an optional \oarg{argument}. +\end{dispExample} +\end{docCommand} + + +\clearpage +{\let\xdispExample\dispExample + \let\endxdispExample\enddispExample +\begin{docEnvironment}{dispExample}{} + Creates a colored box based on a \refEnv{tcolorbox}. + It displays the environment content as source code in the upper part + and as compiled text in the lower part of the box. + The appearance is controlled by \refKey{/tcb/documentation listing style} + and the style \refKey{/tcb/docexample}. It may be + changed by redefining this style. +\begin{xdispExample} +\begin{dispExample} +This is a \LaTeX\ example. +\end{dispExample} +\end{xdispExample} +\end{docEnvironment}} + + +\begin{docEnvironment}{dispListing}{} + Creates a colored box based on a \refEnv{tcolorbox}. + It displays the environment content as source code. + The appearance is controlled by \refKey{/tcb/documentation listing style} + and the style \refKey{/tcb/docexample}. It may be + changed by redefining this style. +\begin{dispExample} +\begin{dispListing} +This is a \LaTeX\ example. +\end{dispListing} +\end{dispExample} +\end{docEnvironment} + +\begin{docEnvironment}{absquote}{} + Used to typeset an abstract as quoted and small text. +\begin{dispExample} +\begin{absquote} +|tcolorbox| provides an environment for colored and framed text boxes with a +heading line. Optionally, such a box can be split in an upper and a lower part. +\end{absquote} +\end{dispExample} +\end{docEnvironment} + +\clearpage +\begin{docCommand}{tcbmakedocSubKey}{\marg{name}\marg{key path}} + Creates a new environment \meta{name} based on \refEnv{docKey} for the + documentation of keys with the given \meta{key path} as default. + The new environment \meta{name} takes the same para\-meters as \refEnv{docKey} itself. +\begin{dispExample} +\tcbmakedocSubKey{docFooKey}{foo} + +\begin{docFooKey}{foodummy}{=\meta{nothing}}{no default, initially empty} +Some key. +\end{docFooKey} +\end{dispExample} +\end{docCommand} + + +\begin{docCommand}{refCom}{\marg{name}} + References a documented \LaTeX\ macro with given \meta{name} where \meta{name} is + written without backslash. +\begin{dispExample} +We have created \refCom{foomakedocSubKey} as an example. +\end{dispExample} +\end{docCommand} + +\begin{docCommand}{refEnv}{\marg{name}} + References a documented \LaTeX\ environment with given \meta{name}. +\begin{dispExample} +We have created \refEnv{foocolorbox} as an example. +\end{dispExample} +\end{docCommand} + +\begin{docCommand}{refKey}{\marg{name}} + References a documented key with given \meta{name} where \meta{name} + is the full path name of the key. +\begin{dispExample} +We have created \refKey{/foo/footitle} as an example. +\end{dispExample} +\end{docCommand} + + +\begin{docCommand}{colDef}{\marg{text}} +Sets \meta{text} with the definition color, see \refKey{/tcb/color definition}. +\begin{dispExample} +This is my \colDef{text}. +\end{dispExample} +\end{docCommand} + +\begin{docCommand}{colOpt}{\marg{text}} + Sets \meta{text} with the option color, see \refKey{/tcb/color option}. +\begin{dispExample} +This is my \colOpt{text}. +\end{dispExample} +\end{docCommand} + + + +\subsection{Option Keys of the Library} + +\begin{docTcbKey}{docexample}{}{style, no value} + Sets the style for \refEnv{dispExample} and \refEnv{dispListing} + with the colors |ExampleBack| and |ExampleFrame|. + To change the appearance of the examples, this style could be + redefined. +\end{docTcbKey} + +\begin{docTcbKey}{documentation listing style}{=\meta{listing style}}{no default, initially |tcbdocumentation|} + Sets a \meta{listing style} for the |listings| package \cite{heinz:2007a}. + It is used inside \refEnv{dispExample} and \refEnv{dispListing} to typeset + the listings. Note that this is not identical to the key + \refKey{/tcb/listing style} which is used for 'normal' listings. +\end{docTcbKey} + + +\begin{docTcbKey}{color definition}{=\meta{color}}{no default, initially |Definition|} + Sets the highlight color used by macro and key definitions. +\end{docTcbKey} + +\begin{docTcbKey}{color option}{=\meta{color}}{no default, initially |Option|} + Sets the color used for optional arguments. +\end{docTcbKey} + +\begin{docTcbKey}{color hyperlink}{=\meta{color}}{no default, initially |Hyperlink|} + Sets the color for all hyper-links, i.\,e. all internal and external links. +\end{docTcbKey} + +\begin{docTcbKey}{before example}{=\meta{macros}}{no default, initially \cs{par}\cs{smallskip}} + Sets the \meta{macros} which are executed before \refEnv{dispExample} and \refEnv{dispListing} + additional to \refKey{/tcb/before}. +\end{docTcbKey} + +\begin{docTcbKey}{after example}{=\meta{macros}}{no default, initially empty} + Sets the \meta{macros} which are executed after \refEnv{dispExample} and \refEnv{dispListing} + additional to \refKey{/tcb/after}. +\end{docTcbKey} + +\begin{docTcbKey}{index actual}{=\meta{character}}{no default, initially |@|} + Sets the character for 'actual' in automatic indexing. +\end{docTcbKey} + +\begin{docTcbKey}{index quote}{=\meta{character}}{no default, initially |"|} + Sets the character for 'quote' in automatic indexing. +\end{docTcbKey} + +\begin{docTcbKey}{index level}{=\meta{character}}{no default, initially |!|} + Sets the character for 'level' in automatic indexing. +\end{docTcbKey} + +\begin{docTcbKey}{index default settings}{}{style, no value} + Sets the |makeindex| default values for + \refKey{/tcb/index actual}, + \refKey{/tcb/index quote}, and + \refKey{/tcb/index level}. +\end{docTcbKey} + +\begin{docTcbKey}{index german settings}{}{style, no value} + Sets the |makeindex| values recommended for German language texts. + This is identical to setting the following: +\begin{dispListing} +\tcbset{index actual={=},index quote={!},index level={>}} +\end{dispListing} +\end{docTcbKey} + +\clearpage +The following keys are provided for language specific settings. +The English language is predefined. + +\begin{docTcbKey}{english language}{}{style, no value} + Sets all language specific settings to English. +\end{docTcbKey} + +\begin{langTcbKey}{color}{=\meta{text}}{no default, initially |color|} + Text used in the index for colors. +\end{langTcbKey} + +\begin{langTcbKey}{colors}{=\meta{text}}{no default, initially |Colors|} + Heading text in the index for colors. +\end{langTcbKey} + +\begin{langTcbKey}{environment content}{=\meta{text}}{no default, initially |environment content|} + Text used in \refEnv{docEnvironment}. +\end{langTcbKey} + +\begin{langTcbKey}{environment}{=\meta{text}}{no default, initially |environment|} + Text used in the index for environments. +\end{langTcbKey} + +\begin{langTcbKey}{environments}{=\meta{text}}{no default, initially |Environments|} + Heading text in the index for environments. +\end{langTcbKey} + +\begin{langTcbKey}{key}{=\meta{text}}{no default, initially |key|} + Text used in the index for keys. +\end{langTcbKey} + +\begin{langTcbKey}{index}{=\meta{text}}{no default, initially |Index|} + Heading text for the index. +\end{langTcbKey} + +\begin{langTcbKey}{pageshort}{=\meta{text}}{no default, initially |P.|} + Short text for page references. +\end{langTcbKey} + + +\subsection{Predefined Colors of the Library} +The following colors are predefined. They are used as default colors +in some library commands. + +\def\dispColor#1{\docColor{#1}~\tikz[baseline=1mm]\path[fill=#1,draw] (0,0) rectangle (0.4,0.4);~} + +\dispColor{Option}, +\dispColor{Definition}, +\dispColor{ExampleFrame}, +\dispColor{ExampleBack}, +\dispColor{Hyperlink}. + + +% Actually, it is not a good idea to include the references like this! +% Do not follow this bad example ... +\begin{tcbverbatimwrite}{\jobname.bib} +@manual{heinz:2007a, + author = {Carsten Heinz and Brooks Moses}, + title = {The Listings Package}, + url = {http://mirror.ctan.org/macros/latex/contrib/listings/listings.pdf}, + note = {Version 1.4}, + month = feb, + year = 2007, + language = {english} +} + +@manual{schoepf:2001a, + author = {Rainer Sch{\"o}pf and Bernd Raichle and Chris Rowley}, + title = {A New Implementation of {\LaTeX}'s verbatim and verbatim* Environments}, + url = {http://mirror.ctan.org/macros/latex/required/tools/verbatim.pdf}, + date = {2001-03-12}, +} + +@techreport{sturm:2007b, + author = {Thomas F. Sturm}, + title = {Mathematik 1 (B.Eng.)}, + type = {Vorlesungs-Skriptum}, + institution = {Universit{\"a}t der Bundeswehr M{\"u}nchen}, + address = {Neubiberg}, + url = {http://www.unibw.de/bw/Fakultat/we2/Sturm}, + year = 2007, + language = {german} +} + +@techreport{sturm:2008b, + author = {Thomas F. Sturm}, + title = {Mathematik 2 (B.Eng.)}, + type = {Vorlesungs-Skriptum}, + institution = {Universit{\"a}t der Bundeswehr M{\"u}nchen}, + address = {Neubiberg}, + url = {http://www.unibw.de/bw/Fakultat/we2/Sturm}, + year = 2008, + language = {german} +} + +@techreport{sturm:2010a, + author = {Thomas F. Sturm}, + title = {H{\"o}here Mathematik: Fortgeschrittene mathematische Methoden (M.Eng.)}, + type = {Vorlesungs-Skriptum}, + institution = {Universit{\"a}t der Bundeswehr M{\"u}nchen}, + address = {Neubiberg}, + url = {http://www.unibw.de/bw/Fakultat/we2/Sturm}, + year = 2010, + language = {german} +} + +@book{sturm:2011b, + author = {Thomas F. Sturm}, + title = {\LaTeX\ -- Einf{\"u}hrung in das Textsatzsystem}, + publisher = {Regionales Rechenzentrum f{\"u}r Niedersachsen (RRZN)}, + address = {Hannover}, + edition = 8, + series = {RRZN-Handb{\"u}cher}, + url = {http://www.rrzn.uni-hannover.de/buecher.html}, + month = sep, + year = 2011, + language = {german} +} + +@manual{tantau:2010c, + author = {Till Tantau}, + title = {The TikZ and PGF Packages}, + subtitle = {Manual for version 2.10}, + url = {http://mirror.ctan.org/graphics/pgf/base/doc/generic/pgf/pgfmanual.pdf}, + date = {2010-10-25}, +} + +@manual{thorub:2007a, + author = {Kresten Krab Thorub and Frank Jensen and Chris Rowley}, + title = {The calc package -- Infix notation arithmetic in \LaTeX}, + url = {http://mirror.ctan.org/macros/latex/required/tools/}, + day = 22, + month = aug, + year = 2007, + language = {english} +} + +@manual{carlisle:2007a, + author = {David Carlisle}, + title = {The file ltxdoc.dtx for use with \LaTeXe}, + url = {http://mirror.ctan.org/macros/latex/base/ltxdoc.dtx}, + date = {2007-11-11} +} + +@manual{mittelbach:2011a, + author = {Frank Mittelbach}, + title = {The doc and shortvrb Packages}, + url = {http://mirror.ctan.org/macros/latex/base/doc.dtx}, + date = {2011-06-30} +} + +\end{tcbverbatimwrite} + +\clearpage +\printbibliography[heading=bibintoc] + +\printindex + +\end{document} diff --git a/Master/texmf-dist/tex/latex/tcolorbox/tcbdocumentation.code.tex b/Master/texmf-dist/tex/latex/tcolorbox/tcbdocumentation.code.tex new file mode 100644 index 00000000000..e66e5143807 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tcolorbox/tcbdocumentation.code.tex @@ -0,0 +1,219 @@ +%% The LaTeX package tcolorbox - version 1.10 (2012/03/01) +%% tcbdocumentation.code.tex: Code for LaTeX documentations +%% +%% ------------------------------------------------------------------------------------------- +%% Copyright (c) 2012 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% ------------------------------------------------------------------------------------------- +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% 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.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `author-maintained'. +%% +%% This work consists of all files listed in README +%% +\makeatletter +\def\tcblibrary@documentation@loaded{} + +\tcbuselibrary{listings} + +\RequirePackage{doc}[2010/02/04] +\RequirePackage{pifont}[2005/04/12] +\RequirePackage{marvosym}[2011/07/20] +\RequirePackage{hyperref}[2012/02/06] +\RequirePackage{makeidx}[2000/03/29] + +\definecolor{Option}{rgb}{0.118,0.546,0.222} +\definecolor{Definition}{rgb}{0.784,0.06,0.176} +\definecolor{ExampleFrame}{rgb}{0.628,0.705,0.942} +\definecolor{ExampleBack}{rgb}{0.963,0.971,0.994} +\definecolor{Hyperlink}{rgb}{0.281,0.275,0.485} + +\def\colDef#1{\textcolor{\kvtcb@coldef}{#1}} +\def\colOpt#1{\textcolor{\kvtcb@colopt}{#1}} + +\lstdefinestyle{tcbdocumentation}{language={[LaTeX]TeX}, + aboveskip={0\p@ \@plus 6\p@}, + belowskip={0\p@ \@plus 6\p@}, + columns=fullflexible, + keepspaces=true, + breaklines=true, + prebreak={\Righttorque}, + postbreak={\space\Lefttorque}, + breakatwhitespace=true, + basicstyle=\ttfamily\footnotesize, + extendedchars=true, + moredelim={[is][\itshape\rmfamily]{§}{§}}, + nolol} + +% The following macros are taken from ltxdoc +\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}} +\def\marg#1{% + {\ttfamily\char`\{}\meta{#1}{\ttfamily\char`\}}} +\def\oarg#1{% + \colOpt{{\ttfamily[}\meta{#1}{\ttfamily]}}} + +% language specific texts +\tcbset{ + doclang/.cd, + color/.store in=\kvtcb@text@color, + colors/.store in=\kvtcb@text@colors, + environment content/.store in=\kvtcb@text@envcontent, + environment/.store in=\kvtcb@text@env, + environments/.store in=\kvtcb@text@envs, + key/.store in=\kvtcb@text@key, + index/.store in=\kvtcb@text@index, + pageshort/.store in=\kvtcb@text@pageshort, +} + +% documentation options +\tcbset{ + documentation listing style/.store in=\kvtcb@doclstsytle, + color option/.store in=\kvtcb@colopt, + color definition/.store in=\kvtcb@coldef, + color hyperlink/.store in=\kvtcb@colhyper, + color frame/.store in=\kvtcb@colhyper, + color hyperlink/.store in=\kvtcb@colhyper, + before example/.store in=\kvtcb@beforeexample, + after example/.store in=\kvtcb@afterexample, + index actual/.store in=\idx@actual, + index quote/.store in=\idx@quote, + index level/.store in=\idx@level, +} + +% styles +\tcbset{ + docexample/.style={colframe=ExampleFrame,colback=ExampleBack,fontlower=\footnotesize}, + index default settings/.style={index actual={@},index quote={"},index level={!}}, + index german settings/.style={index actual={=},index quote={!},index level={>}}, + english language/.code={\tcbset{doclang/.cd, + color=color, + colors=Colors, + environment content=environment content, + environment=environment, + environments=Environments, + key=key, + index=Index, + pageshort={P.}}}, +} + +% presets +\tcbset{ + english language, + documentation listing style=tcbdocumentation, + index default settings, + color option=Option, + color definition=Definition, + color hyperlink=Hyperlink, + before example=\par\smallskip, + after example=, +} + +\AtBeginDocument{\hypersetup{ + citecolor=\kvtcb@colhyper, + linkcolor=\kvtcb@colhyper, + urlcolor=\kvtcb@colhyper, + filecolor=\kvtcb@colhyper, + menucolor=\kvtcb@colhyper +}} + +% tcolorbox specific macros +\def\tcb@doc@usetemplisting{\lstinputlisting[style=\kvtcb@doclstsytle]{\kvtcb@tempfile}} + +\let\dispExample\tcbwritetemp + +\def\enddispExample{% + \endtcbwritetemp% + \kvtcb@beforeexample\begin{tcolorbox}[docexample]% + \tcb@doc@usetemplisting% + \tcblower% + \tcbusetemp% + \end{tcolorbox}\kvtcb@afterexample% +} + +\let\dispListing\tcbwritetemp + +\def\enddispListing{% + \endtcbwritetemp% + \kvtcb@beforeexample\begin{tcolorbox}[docexample]% + \tcb@doc@usetemplisting% + \end{tcolorbox}\kvtcb@afterexample% +} + +% index auxiliary macros +\def\index@Col#1{\index{#1\idx@actual\texttt{#1} \kvtcb@text@color}\index{\kvtcb@text@colors\idx@level#1\idx@actual\texttt{#1}}} +\def\index@Com#1{\index{#1\idx@actual\cs{#1}}} +\def\index@Env#1{\index{#1\idx@actual\texttt{#1} \kvtcb@text@env}\index{\kvtcb@text@envs\idx@level#1\idx@actual\texttt{#1}}} +\def\index@Key#1{\index{#1\idx@actual\texttt{#1} \kvtcb@text@key}}% +\def\index@KeyPath#1#2{\index@Key{#2}\index{#1\idx@actual\texttt{/#1/}\idx@level#2\idx@actual\texttt{#2}}}% + +\def\disp@com#1{\colDef{\ttfamily\bfseries#1}} + +\def\brackets#1{{\ttfamily\char`\{}#1{\ttfamily\char`\}}} + +\newenvironment{manual@entry}{\list{}{\leftmargin=2em\itemindent-\leftmargin\def\makelabel##1{\hss##1}}}{\endlist} + +\def\manual@top#1{\itemsep=0pt\parskip=0pt\item\strut{#1}\par\topsep=0pt} + +% main documentation environments +\newenvironment{docCommand}[2]{\begin{manual@entry}% + \hypertarget{com:#1}{\manual@top{\disp@com{\cs{#1}}\index@Com{#1}\protected@edef\@currentlabel{\noexpand\cs{#1}}\label{com:#1}#2}}}% + {\end{manual@entry}} + +\newenvironment{docEnvironment}[2]{\begin{manual@entry}% + \hypertarget{env:#1}{\manual@top{\cs{begin}\brackets{\disp@com{#1}}\index@Env{#1}\protected@edef\@currentlabel{#1}\label{env:#1}#2}}% + \manual@top{~~\meta{\kvtcb@text@envcontent}}% + \manual@top{\cs{end}\brackets{\disp@com{#1}}}}% + {\end{manual@entry}} + +\newenvironment{docKey}[4][\@empty]{\begin{manual@entry}% + \ifx#1\@empty% + \hypertarget{key:#2}{\manual@top{\disp@com{#2}\index@Key{#2}\protected@edef\@currentlabel{#2}\label{key:#2}#3\hfill(#4)}} + \else\hypertarget{key:/#1/#2}{\manual@top{\disp@com{/#1/#2}\index@KeyPath{#1}{#2}\protected@edef\@currentlabel{/#1/#2}\label{key:/#1/#2}#3\hfill(#4)}}\fi}% + {\end{manual@entry}} + +\def\tcbmakedocSubKey#1#2{% + \newenvironment{#1}[4][\@empty]{% + \ifx##1\@empty\def\tcb@key@path{#2}\else\def\tcb@key@path{#2/##1}\fi% + \begin{docKey}[\tcb@key@path]{##2}{##3}{##4}}% + {\end{docKey}}% +} + +\def\docColor#1{\disp@com{#1}\index@Col{#1}}% + +\def\ref@doc#1{\hyperlink{#1}{\texttt{\ref*{#1}}\textsuperscript{\ding{213}\,\kvtcb@text@pageshort\,\pageref*{#1}}}} + +\def\refCom#1{\ref@doc{com:#1}} +\def\refEnv#1{\ref@doc{env:#1}} +\def\refKey#1{\ref@doc{key:#1}} + +\newenvironment{absquote} + {\list{}{\leftmargin2cm\rightmargin\leftmargin}% + \item\relax\footnotesize} + {\endlist} + +%--- index macros taken from pgfmanual-en-macros +\def\index@prologue{\section*{\kvtcb@text@index}\addcontentsline{toc}{section}{\kvtcb@text@index}% + \par\noindent% +} +\c@IndexColumns=2 + \def\theindex{\@restonecoltrue + \columnseprule \z@ \columnsep 29\p@ + \twocolumn[\index@prologue]% + \parindent -30pt% + \columnsep 15pt% + \parskip 0pt plus 1pt% + \leftskip 30pt% + \rightskip 0pt plus 2cm% + \small% + \def\@idxitem{\par}% + \let\item\@idxitem\ignorespaces} + \def\endtheindex{\onecolumn} +\def\noindexing{\let\index=\@gobble} + + diff --git a/Master/texmf-dist/tex/latex/tcolorbox/tcblistings.code.tex b/Master/texmf-dist/tex/latex/tcolorbox/tcblistings.code.tex index aad137eda3d..6f0653f9c82 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 1.02 (2012/02/15) +%% The LaTeX package tcolorbox - version 1.10 (2012/03/01) %% tcblistings.code.tex: Code for colorboxes with listings %% %% ------------------------------------------------------------------------------------------- @@ -26,7 +26,7 @@ aboveskip={0\p@ \@plus 6\p@}, belowskip={0\p@ \@plus 6\p@}, columns=fullflexible, keepspaces=true, breaklines=true, breakatwhitespace=true, - basicstyle=\ttfamily\small, extendedchars=true + basicstyle=\ttfamily\small, extendedchars=true, nolol } \def\tcbuselistingtext{\input{\kvtcb@listingfile}}% diff --git a/Master/texmf-dist/tex/latex/tcolorbox/tcbtheorems.code.tex b/Master/texmf-dist/tex/latex/tcolorbox/tcbtheorems.code.tex index 7ab67ecfc2a..864e30f103d 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 1.02 (2012/02/15) +%% The LaTeX package tcolorbox - version 1.10 (2012/03/01) %% tcbtheorems.code.tex: Code for theorems in colorboxes %% %% ------------------------------------------------------------------------------------------- diff --git a/Master/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty b/Master/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty index 155e5a22a78..2929cf75e57 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 1.02 (2012/02/15) +%% The LaTeX package tcolorbox - version 1.10 (2012/03/01) %% tcolorbox.sty: Text color boxes %% %% ------------------------------------------------------------------------------------------- @@ -18,7 +18,7 @@ %% This work consists of all files listed in README %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{tcolorbox}[2012/02/15 version 1.02 text color boxes] +\ProvidesPackage{tcolorbox}[2012/03/01 version 1.10 text color boxes] \RequirePackage{pgf}[2008/01/15] \RequirePackage{calc}[2007/08/22] @@ -74,14 +74,15 @@ lowerbox/visible/.code={\tcb@lowerignoredfalse\tcb@lowervisibletrue}, lowerbox/invisible/.code={\tcb@lowerignoredfalse\tcb@lowervisiblefalse}, lowerbox/ignored/.code={\tcb@lowerignoredtrue\tcb@lowervisiblefalse}, + parskip/.style={before={\par\pagebreak[0]\noindent},after={\par}}, + noparskip/.style={before={\par\smallskip\pagebreak[0]\noindent},after={\par\smallskip}}, } \tcbset{notitle,width=\linewidth,boxsep=1mm,boxrule=0.5mm, left=4mm,right=4mm,top=2mm,bottom=2mm,middle=2mm,arc=1mm,lowerbox=visible, colback=black!5,colframe=black!75,coltext=black,coltitle=white, fonttitle=,fontupper=,fontlower=,floatplacement=htb,nofloat,savelowerto=, - before={\par\pagebreak[0]\noindent},after={\par}, - savedelimiter={tcolorbox},tempfile={\jobname.tcbtemp}}% + parskip,savedelimiter={tcolorbox},tempfile={\jobname.tcbtemp}}% % lrbox with integrated minipage @@ -291,6 +292,7 @@ \tcb@add@library{listings}{tcblistings.code.tex} \tcb@add@library{theorems}{tcbtheorems.code.tex} +\tcb@add@library{documentation}{tcbdocumentation.code.tex} \ProcessOptions* \edef\tcb@temp{\noexpand\tcbuselibrary{\tcb@optionlist}} diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index f1cb3d97f4f..7514baa0d24 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -2215,7 +2215,7 @@ $standardclean = '\.head|\.tmp|\.dvi|\.log|\.out|\.aux|\.toc|\.lof|\.lot' 'stubs' => 'stubs.pdf', # no source 'susy' => 'susy.pdf', # no source 'swimgraf' => 'swimgraf.pdf', # no source - 'tcolorbox' => 'tcolorbox(-german)?.pdf', # no source + 'tcolorbox' => 'tcolorbox-german.pdf', # no source 'toptesi' => 'logo.*', # legalities unknown 'tree-dvips' => 'avm.*', # author no response 'xskak' => 'xskak.pdf', # no source |