summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-03-29 23:21:50 +0000
committerKarl Berry <karl@freefriends.org>2012-03-29 23:21:50 +0000
commit5c6d650e167218f3dcde8e6d2312a9e61143f906 (patch)
treebc00ef979d928906a4e8a957db611334c61b6977 /Master/texmf-dist
parent81f21c18fe5c725775e3943edab6555ccfae3b79 (diff)
new latex package coolthms (29mar12)
git-svn-id: svn://tug.org/texlive/trunk@25781 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/coolthms/README17
-rw-r--r--Master/texmf-dist/doc/latex/coolthms/coolthms.pdfbin0 -> 91297 bytes
-rw-r--r--Master/texmf-dist/source/latex/coolthms/coolthms.dtx485
-rw-r--r--Master/texmf-dist/source/latex/coolthms/coolthms.ins4
-rw-r--r--Master/texmf-dist/tex/latex/coolthms/coolthms.sty129
5 files changed, 635 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/coolthms/README b/Master/texmf-dist/doc/latex/coolthms/README
new file mode 100644
index 00000000000..10a3065a199
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/coolthms/README
@@ -0,0 +1,17 @@
+coolthms: a LaTeX package for referencing list items nested in theorem-like environments including some theorem markup options
+
+Copyright (C) 2011--2012 Jonathan Zachhuber, Michael Fütterer
+E-mail: jonathan.zachhuber@gmail.com, michaelfuetterer@gmail.com
+
+Files:
+coolthms.ins Batch file, run through LaTeX
+coolthms.dtx Docstrip archive, run through (Xe)LaTeX
+coolthms.sty LaTeX package, generated by coolthms.ins from coolthms.dtx
+coolthms.pdf Package documentation; can also be generated from coolthms.dtx
+README This file
+
+This material is subject to the LaTeX Project Public License. See
+http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html for the
+details of that license.
+
+For more information on the package, see the documentation in coolthms.pdf. \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/coolthms/coolthms.pdf b/Master/texmf-dist/doc/latex/coolthms/coolthms.pdf
new file mode 100644
index 00000000000..5396fe3e718
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/coolthms/coolthms.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/coolthms/coolthms.dtx b/Master/texmf-dist/source/latex/coolthms/coolthms.dtx
new file mode 100644
index 00000000000..185bc2262a4
--- /dev/null
+++ b/Master/texmf-dist/source/latex/coolthms/coolthms.dtx
@@ -0,0 +1,485 @@
+% \iffalse meta-coment:
+%
+% The coolthms package
+%
+% \fi
+%
+% ^^A Driver stuff:
+% \iffalse not to be used in package ....
+%<*driver>
+\documentclass[a4paper]{ltxdoc}
+\usepackage{ifxetex}
+\usepackage{hypdoc}
+\ifxetex
+ \usepackage[no-math]{fontspec}
+ \usepackage{polyglossia}
+ \setmainfont[Mapping=tex-text,Numbers=OldStyle]{Linux Libertine O}
+ \setsansfont[Mapping=tex-text,Numbers=OldStyle]{Linux Biolinum O}
+ \setdefaultlanguage{english}
+\else
+ \usepackage[utf8]{inputenc}
+ \usepackage[T1]{fontenc}
+ \usepackage[english]{babel}
+\fi
+\usepackage{etoolbox}
+\usepackage{textcomp}
+\usepackage{enumitem}
+\usepackage{csquotes}
+\usepackage{fancyvrb}
+\usepackage{coolthms}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\begin{document}
+ \DocInput{coolthms.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \iffalse package preamble
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{coolthms}[2012/03/29 v1.0 Theorem markup and advanced referencing]
+% \fi
+%
+% \MakeShortVerb{\"}
+%
+% \newcommand{\ctp}{\texttt{coolthms}}
+% \newenvironment{syntax}{\medskip\hspace*{1em}}{\par\medskip}
+% \setenumerate[1]{leftmargin=*,labelindent=\parindent,label=(\alph*)}
+% \setenumerate[2]{leftmargin=*,labelindent=\parindent,label=(\roman*),ref=\theenumi~(\roman*)}
+% \AfterEndEnvironment{verbatim}{\vspace*{-11pt}}
+%
+% \GetFileInfo{coolthms.sty}
+%
+% \VerbatimFootnotes
+%
+% \title{The \ctp{} Package}
+% \author{Jonathan Zachhuber\thanks{\url{jonathan.zachhuber@gmail.com}} \and Michael Fütterer\thanks{\url{michaelfuetterer@gmail.com}}}
+% \date{Version \fileversion, \filedate}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package makes it possible to directly reference "\item"s
+% in theorem-like environments using the "ntheorem" and "cleveref" packages.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Overview}
+%
+% Especially when typesetting lecture notes, one encounters
+% situations such as\\[3pt]
+% "\begin{theorem}\label{thm1}"\\
+% "\begin{enumerate}"\\
+% \hspace*{10pt}"\item\label{1.1}" First point.\\
+% \hspace*{10pt}"\item\label{1.2}" Second point.\\
+% "\end{enumerate}"\\"\end{theorem}"\\[3pt]
+% and would subsequently like to write something like "\ref{1.1}"
+% to get something of the form `Theorem 1 (a)'.
+%
+% This, however, is not possible. Of course, one could retreat to
+% writing something like "\ref{thm1}~\ref{1.1}", but this is no satisfactory solution.
+%
+% \DescribeMacro{\Label}
+% The \ctp{} package therefore provides the "\Label" command to create a special kind of label that internally saves the name and number of a possible "theorem"-like environment enclosing it.
+%
+% In our above example, one could now write\\[3pt]
+% "\begin{theorem}\label{thm1}"\\
+% "\begin{enumerate}"\\
+% \hspace*{10pt}"\item\Label{1.1}" First point.\\
+% \hspace*{10pt}"\item\Label{1.2}" Second point.\\
+% "\end{enumerate}"\\"\end{theorem}"\\[3pt]
+% and then "\cref{1.1}" provides the desired result. See \cref{examples} for some concrete examples.
+%
+% \DescribeMacro{\definetheorem}
+% For this to work, one needs to define the theorem-like environments with the new "\definetheorem" command. This is simply an extension of "ntheorem"'s "\newtheorem" command.
+%
+% \section{Usage}
+%
+% The \ctp{} package only defines three useful commands and uses one from the "cleveref" package.
+%
+% \DescribeMacro{\definetheorem} The "\definetheorem" command expands "ntheorem"'s "\newtheorem" by saving information later to be used in generating the labels. The syntax is as follows:
+%
+% \begin{syntax}"\definetheorem["\meta{counter1}"]{"\meta{env name}"}["\meta{thm plural name}"]"\\
+% \hspace*{.3\textwidth}"{"\meta{thm name}"}["\meta{counter2}"]"\end{syntax}
+%
+% \noindent This command defines \emph{two} environments, \meta{env name} and "n"\meta{env name}. The first one is for numbered theorems, the second one is an unnumbered version. The displayed name of the theorem is \meta{thm name}. You can optionally give the plural form \meta{thm plural name}, which will be used if several theorems of this type are referenced at any one time.
+%
+% The counter arguments are similar to those of "\newtheorem". The \meta{counter1} is the counter that is used for this type of theorem. The package creates a dummy counter, named "thmcnt", and this is the default value of \meta{counter1}. Hence, the default setting is for all different types of theorems to be numbered consecutively. If you want to number some type of theorem seperately, you should specify a new counter name via the optional argument \meta{counter1}; if the counter does not exist, it will be created. You can also provide the counter of another theorem environment, to group several types of theorem together.
+%
+% The \meta{counter2} is a counter that resets \meta{counter1} every time it is incremented. It has the default value "section" so the theorems are numbered within a section and \meta{counter1} is reset to $0$ whenever a new section starts. If you want a theorem type to be numbered document-wide without the counter being reset at any time, you should give an empty (i.e. no) \meta{counter2} argument.
+%
+% The default numbering of the theorem environment is \meta{counter2}.\meta{counter1}. See \cref{examples} for concrete examples.
+%
+% \DescribeMacro{\theoremmarkup} "\theoremmarkup" is a command for formating theorems. Similar to the corresponding
+% commands from "ntheorem", it is called \emph{before} defining theorems with "\definetheorem", affecting the appereance of all
+% theorems defined afterwards until it is called again. Details can be found in \cref{format}.
+%
+% \DescribeMacro{\Label} The "\Label" command replaces (or re-implements) the `conventional' "\label" command and is to be used \emph{only} inside theorem-like environments (which were previously defined with "\definetheorem"!). The "\label" command can (and should) of course still be used, if no special behaviour is desired\footnote{Actually, if you use the "Label" command inside an unnested theorem environment, or for the theorem itself, it will simply display the theorem number twice as the counter is used both in the reference name and, of course, the reference counter. See \cref{implementation}.}. The syntax is exactly the same as for "\label":
+%
+% \begin{syntax}"\Label"\marg{label name}\end{syntax}
+%
+% \DescribeMacro{\cref}
+% The labels thus defined should then be referenced with:
+%
+% \begin{syntax}"\cref"\marg{label name}\end{syntax}
+%
+% \noindent This is the "cleveref" `version' of "\ref" and is being used here without being altered in any way.
+%
+% The package can be called with several options, which are described in the table below.
+%
+% \medskip
+%
+% \noindent
+% \begin{tabular}{p{.25\textwidth} p{.15\textwidth} p{.5\textwidth}}
+% \hline
+% Option & Default value & Description\\
+% \hline\hline
+% "indent" & "0em" & The space every theorem's \emph{content} will be indented. \\
+% "separator" & ":" & The punctuation sign that will be printed after the caption. \\
+% "proofname" & "\proofname" & The caption for proofs. \\
+% "proofsymbol" & "$\Box$" & The symbol that will be printed at the end of proofs. \\
+% "proofcaptionstyle" & "\it" & The font shape in which the caption for proofs (as given in "proofname") is printed. \\
+% "proofindent" & "0em" & The space proofs will be indented. \\
+% "minskip" & "0pt" & The minimal theorem pre- and post skip amount. \\
+% "maxskip" & "6pt" & The maximal theorem pre- and post skip amount. \\
+% \hline
+% \end{tabular}
+%
+% \medskip
+%
+% Note that the "\proofname" macro is defined by "babel" or "polyglossia" and is a language-specific string containing the proof name. If none of these package is loaded, we define "\proofname" just as \enquote{Proof} and use that as a default value.
+%
+%
+% \section{Formatting Details}\label{format}
+%
+% \DescribeMacro{\theoremmarkup} The "\theoremmarkup" command is used to describe how your theorems will be formatted. It should be
+% called prior to any "\definetheorem" command. All theorems you define afterwards with "\definetheorem" will be formatted in
+% the way you have set with "\theoremmarkup", until you invoke "\theoremmarkup" again to change these values. The syntax is:
+%
+% \begin{syntax}"\theoremmarkup"\oarg{header font}\oarg{body font}\oarg{symbol}\\
+% \hspace*{.3\textwidth}\oarg{indentation}\oarg{separator}\oarg{numbering}\end{syntax}
+%
+% \noindent All these parameters are optional and have the following default values:
+%
+% \medskip
+%
+% \begin{center}
+% \begin{tabular}{p{.2\textwidth} p{.5\textwidth}}
+% \hline
+% Option & Default value \\
+% \hline\hline
+% "header font" & "\bf" \\
+% "body font" & "\normalfont" \\
+% "symbol" & "\relax" \\
+% "intendation" & the value of the package option "indent" \\
+% "separator" & ":" \\
+% "numbering" & "arabic" \\
+% \hline
+% \end{tabular}
+% \end{center}
+%
+% \medskip
+%
+% \noindent For more detailed information about these parameters, see the documentation of the "ntheorem" package.
+%
+% \DescribeMacro{\theoremstyle\{mitnummern\}}
+% \DescribeMacro{\theoremstyle\{keinenummern\}}
+% \DescribeMacro{\theoremstyle\{unserbeweis\}}
+% The package also provides (and uses with "\definetheorem") three new theorem styles. They provide a numbered and an unnumbered
+% theorem style, as well as one intended for proofs. They respect "ntheorem"'s "\theoremheaderfont" but put the optional title
+% addon in parentheses and "\normalfont". See \cref{implementation} for details.
+%
+% \DescribeEnv{proof}
+% The package also defines a theorem environment intended for proofs, which is called "proof".
+%
+% \DescribeMacro{\sectionname}
+% While the "babel" and "polyglossia" packages define language specific commands for the word \enquote{chapter} ("\chaptername"), they include no "\sectionname". The package therefore defines "\sectionname", however at the moment it is left blank in all languages but German (\enquote{Abschnitt}) and English (\enquote{section}), see \cref{implementation}.
+%
+% \section{Examples}\label{examples}
+%
+% We define a theorem enviroment "thm" with caption \enquote{Theorem}:
+%
+% \begin{verbatim}
+% \definetheorem{thm}{Theorem}
+% \end{verbatim}
+% \definetheorem{thm}{Theorem}
+%
+% Now we use this environment to typeset a theorem:
+%
+% \begin{verbatim}
+% \begin{thm}\label{testthm}
+% This is a theorem.
+% \end{thm}
+% \end{verbatim}
+% \begin{thm}\label{testthm}
+% This is a theorem.
+% \end{thm}
+% Notice that here we use the conventional "\label" command, as we are not in a nested situation.
+%
+% Now we'll define -- and then use -- a more fancy theorem environment, "fancythm". Before doing that, we invoke "\theoremmarkup":
+% \begin{verbatim}
+% \theoremmarkup[\sc][\it][\textleaf][3em][.][Roman]
+% \definetheorem{fncythm}{Fancy Theorem}
+% \begin{fncythm}[Title]
+% The \ctp{} package is a very useful package for typesetting theorems.
+% This theorem is a long one, and we can see that its content is indented.
+% We furthermore have an enumerated list of claims.
+% \begin{enumerate}
+% \item\Label{claim1} Claim 1
+% \item\Label{claim2} Claim 2
+% \end{enumerate}
+% \end{fncythm}
+% \end{verbatim}
+% Thus the header font will be small caps, the body font will be italic, each fancy theorem will be ended by a leaf symbol, its content will be indented "3em", the punctuation sign after its caption will be a period, and the numbering will be Roman. Note that -- by default -- we use the same numbering as \cref{testthm}\footnote{This is just "\cref{testthm}".}. And indeed:
+%
+% \theoremmarkup[\sc][\it][\textleaf][3em][.][Roman]
+% \definetheorem{fncythm}{Fancy Theorem}
+% \begin{fncythm}[Title]
+% The \ctp{} package is a very useful package for typesetting theorems.
+% This theorem is a long one, and we can see that its content is indented.
+% We furthermore have an enumerated list of claims.
+% \begin{enumerate}
+% \item\Label{claim1} Claim 1
+% \item\Label{claim2} Claim 2
+% \end{enumerate}
+% \end{fncythm}
+%
+% Finally, by writing "\cref{claim1}", we get what we wanted: \cref{claim1}.
+%
+% This even works for nested "enumerate"s. However, we recommend using the "enumitem" package to improve the appeareance of the reference. For example, when we define
+% \begin{verbatim}
+% \usepackage{enumitem}
+% \setenumerate[1]{leftmargin=*,labelindent=\parindent,label=(\alph*)}
+% \setenumerate[2]{leftmargin=*,labelindent=\parindent,label=(\roman*),%
+% ref=\theenumi~(\roman*)}
+% \end{verbatim}
+% and we have a theorem
+% \begin{verbatim}
+% \begin{thm}
+% Test theorem.
+% \begin{enumerate}
+% \item First point.
+% \begin{enumerate}
+% \item First sub-point.
+% \item\Label{testlabel} Second sub-point.
+% \end{enumerate}
+% \item Second point.
+% \end{enumerate}
+% \end{thm}
+% \end{verbatim}
+% \begin{thm}
+% Test theorem.
+% \begin{enumerate}
+% \item First point.
+% \begin{enumerate}
+% \item First sub-point.
+% \item\Label{testlabel} Second sub-point.
+% \end{enumerate}
+% \item Second point.
+% \end{enumerate}
+% \end{thm}
+% then writing "\cref{testlabel}" correctly yields \cref{testlabel}.
+%
+% \section{Interaction with other packages}
+%
+% To achieve its goals, "coolthms" relies on several other packages, some of which are quite picky. Most notably, we use the "cleveref" package, which likes to be loaded at quite a late point in the document head (please refer to "cleveref"'s package documentation for a detailed account of its interaction with other packages).
+%
+% In general, you will be on the safe side if "coolthms" is the last package you load. If you want to use the language-specific "\sectionname" commands, you should definitely load it \emph{after} "babel" or "polyglossia", otherwise they will have no effect.
+%
+% Since we use the "ntheorem" package, "coolthms" \emph{must} be loaded \emph{after} "amsmath", if this is used. The package works with and without "amsmath", though.
+%
+% \section{Implementation}\label{implementation}
+%
+% First we load the packages we'll be needing.
+%
+% Before loading the amssymb package, we need to undefine some commands to avoid errors.
+% \begin{macrocode}
+\let\Finv\@undefined
+\let\Game\@undefined
+\let\beth\@undefined
+\let\gimel\@undefined
+\let\daleth\@undefined
+\RequirePackage{amssymb}
+% \end{macrocode}
+% "hyperref" support is always good when linking stuff, we need lots of little "etoolbox" macros and "xargs" as well as "kvoptions" for our argument and option processing.
+% \begin{macrocode}
+\RequirePackage{hyperref}
+\RequirePackage{etoolbox}
+\RequirePackage{ifthen}
+\RequirePackage{xargs}
+\RequirePackage{kvoptions}
+% \end{macrocode}
+% We then check if "amsmath" has been loaded, so we know if to invoke the "amsmath" option in "ntheorem".
+% \begin{macrocode}
+\@ifpackageloaded{amsmath}
+ {\RequirePackage[thmmarks,amsmath,hyperref]{ntheorem}}
+ {\RequirePackage[thmmarks,hyperref]{ntheorem}}
+% \end{macrocode}
+% Note that the "cleveref" package must be loaded \emph{after} the "ntheorem" package.
+% \begin{macrocode}
+\RequirePackage{cleveref}
+% \end{macrocode}
+%% \begin{macro}{\ctp@hashchar}
+% In order to write a verbatim `hash' sign into our files later, it's practical to write the "\catcode" change into a small macro:
+% \begin{macrocode}
+\begingroup
+\catcode`\#=12
+\gdef\ctp@hashchar{#}%
+\endgroup
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\proofname}
+% We provide options for the proofname, the theorem separator, the proof end symbol and the amount to indent theorem content. The default value of "proofname" should be "\proofname", which is set by "babel" or "polyglossia". If the command is not defined, we simply define it as \enquote{Proof}.
+% \begin{macrocode}
+\@ifundefined{proofname}{\newcommand{\proofname}{Proof}}{}
+\DeclareStringOption[\proofname]{proofname}
+\DeclareStringOption[$\Box$]{proofsymbol}
+\DeclareStringOption[\it]{proofcaptionstyle}
+\DeclareStringOption[0em]{proofindent}
+\DeclareStringOption[:]{separator}
+\DeclareStringOption[0em]{indent}
+\DeclareStringOption[0pt]{minskip}
+\DeclareStringOption[6pt]{maxskip}
+\DeclareLocalOptions{separator,indent,minskip,maxskip%
+ proofname,proofsymbol,proofcaptionstyle,proofindent}
+\ProcessKeyvalOptions*
+% \end{macrocode}
+% \end{macro}
+% Now we need to define various (an unnumbered, a numbered and a third one for proofs) "theoremstyle"s\footnote{Here we use the "ntheorem" package.} we will be using:
+% \begin{macrocode}
+\newtheoremstyle{keinenummern}%
+ {\item[\hskip\labelsep\theorem@headerfont ##1\theorem@separator]}%
+ {\item[\hskip\labelsep\theorem@headerfont ##1\ %
+ {\normalfont(##3)}\theorem@separator]}
+\newtheoremstyle{mitnummern}%
+ {\item[\hskip\labelsep\theorem@headerfont ##1\ ##2\theorem@separator]}%
+ {\item[\hskip\labelsep\theorem@headerfont ##1\ ##2\ %
+ {\normalfont(##3)}\theorem@separator]}
+\newtheoremstyle{unserbeweis}%
+ {\item[{\hskip\labelsep\theorem@headerfont ##1\theorem@separator}]}%
+ {\item[\hskip\labelsep{\theorem@headerfont ##3\theorem@separator}]}
+% \end{macrocode}
+%
+% If there are no chapters (e.g. article class), we should manually create that counter and set it to 1, as we need that in the name of our label:
+% \begin{macrocode}
+\@ifundefined{c@chapter}{%
+ \newcounter{chapter}%
+ \setcounter{chapter}{1}%
+}{}%
+% \end{macrocode}
+% \begin{macro}{\definetheorem}
+% Now comes the real work: the "\definetheorem" command. "\definetheorem" takes five arguments and passes them to "ntheorem"'s "\newtheorem" in a slightly altered order. We then create a numbered theorem style by name of "#2" and an unnumbered style by name of "n#2". This is necessary as the starred versions have a different meaning in the "ntheorem" package.
+%
+% The optional arguments are first checked (i.e. nothing happens if they are not set) and then passed to "\newtheorem" to create the dummy counters that will later be used for numbering the environments.
+%
+% \begin{macrocode}
+\newcommandx*{\definetheorem}[5][1=thmcnt,3=,5=section]{
+ \@ifundefined{c@#1}{
+ \@ifundefined{c@#5}{
+ \newtheorem{#1}{#1}
+ }{
+ \newtheorem{#1}{#1}[#5]
+ }
+ }{}
+ \theoremstyle{mitnummern}
+ \newtheorem{#2}[#1]{#4}
+ \theoremstyle{keinenummern}
+ \newtheorem{n#2}[#1]{#4}
+% \end{macrocode}
+% When simply referring to the environment (i.e. something from a "\label", not "\Label" command!), we want the reference to
+% consist of `\meta{theorem name} \meta{theorem number}' and all of it should be a hyperlink. "\crefname" takes three arguments: The name of the theorem environment, the singular and plural form of the theorem name. These are stored in "#2", "#4" and "#3", respectively. If no plural form is given, i.e. "#3" is undefined, we simply replace it with its singular form ("#4"):
+% \begin{macrocode}
+ \ifblank{#3}{
+ \crefname{#2}{#4}{#4}
+ }{
+ \crefname{#2}{#4}{#3}
+ }
+ \crefformat{#2}{##2#4~##1##3}
+% \end{macrocode}
+% In the unnumbered version we need to subtract $1$ from the counter, as it is nonetheless incremented.
+% \begin{macrocode}
+ \BeforeBeginEnvironment{n#2}{\addtocounter{#1}{-1}}
+% \end{macrocode}
+% \begin{macro}{\ctp@labelcode}
+% Now, every time we call our new theorem environment, we want to create a new \emph{unique} label ("\ctp@labelcode"), which we can then use as the label of the nested "enumerate" environments. However, at this point the counter "#1" has not been incremented yet, so we need to do (and later undo) this.
+% \begin{macrocode}
+ \BeforeBeginEnvironment{#2}{%
+ \addtocounter{#1}{1}%
+ \edef\ctp@labelcode%
+ {ctp@#2@\roman{chapter}@\roman{section}@\arabic{#1}}\relax%
+% \end{macrocode}
+% \end{macro}
+% We then write all this information (including the \emph{format} of the label) to the "aux" file so that it is available at the next run of \LaTeX.
+% \begin{macrocode}
+ \immediate\write\@auxout{\string\crefname{\ctp@labelcode}%
+ {#4\noexpand~\csname the#1\endcsname}%
+ {#4 plural\noexpand~\csname the#1\endcsname}}\relax%
+ \immediate\write\@auxout{\string\crefformat{\ctp@labelcode}%
+ {\string##2#4\noexpand~\csname the#1\endcsname\noexpand~%
+ \ctp@hashchar1\ctp@hashchar3}}\relax%
+% \end{macrocode}
+% \begin{macro}{\Label}
+% We finally (re)define the "\Label" command. All it does is call the classic "\label" command (from "cleveref") with our unique label name as identifier:
+% \begin{macrocode}
+ \edef\Label##1{\noexpand\label[\ctp@labelcode]{##1}}%
+% \end{macrocode}
+% \end{macro}
+% Now we're done, all we need to do is correct "#1".
+% \begin{macrocode}
+ \addtocounter{#1}{-1} %
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\theoremmarkup}
+% Now we define the "\theoremmarkup" command, which is described above.
+% \begin{macrocode}
+\newcommandx*{\theoremmarkup}[6][1=\bf,2=\normalfont,3=\relax,%
+ 4=\coolthms@indent,5=\coolthms@separator,6=arabic]{
+ \theoremheaderfont{\hspace*{-#4}#1}
+ \theorembodyfont{#2}
+ \theoremsymbol{#3}
+ \theoremindent#4\relax
+ \theoremseparator{#5}
+ \theoremnumbering{#6}
+}
+% \end{macrocode}
+% \end{macro}
+% And then we want to adjust the format for the other types of references:
+% \begin{macrocode}
+\crefformat{equation}{#2(#1)#3}
+\crefformat{chapter}{#2\chaptername~#1#3}
+% \end{macrocode}
+% \begin{macro}{\sectionname}
+% Interestingly enough, "\sectionname" is provided neither by "polyglossia" nor "babel", so we add it in the appropriate languages.
+% \begin{macrocode}
+\@ifundefined{sectionname}{\newcommand{\sectionname}{}}{}
+ \gappto\captionsgerman{\renewcommand{\sectionname}{Abschnitt}}%
+ \gappto\captionsenglish{\renewcommand{\sectionname}{section}}
+\crefformat{section}{#2\sectionname~#1#3}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\theorempreskipamount}\begin{macro}{\theorempostskipamount}
+% We set theorem pre- and post skip amounts.
+% \begin{macrocode}
+\theorempreskipamount\coolthms@minskip plus \coolthms@maxskip\relax
+\theorempostskipamount\coolthms@minskip plus \coolthms@maxskip\relax
+% \end{macrocode}
+% \end{macro}\end{macro}
+% This is for proofs:
+% \begin{macrocode}
+\theoremstyle{unserbeweis}
+\theoremmarkup[\coolthms@proofcaptionstyle][\normalfont]%
+ [\coolthms@proofsymbol][\coolthms@proofindent]
+\newtheorem{proof}{\coolthms@proofname}
+% \end{macrocode}
+% At the end we invoke "\theoremmarkup" to set everything back to the default values.
+% \begin{macrocode}
+\theoremmarkup
+% \end{macrocode}
+% \changes{v0.1}{2011/08/09}{Started project}
+% \changes{v1.0}{2012/03/29}{First public version}
+% \PrintChanges
+% \PrintIndex
diff --git a/Master/texmf-dist/source/latex/coolthms/coolthms.ins b/Master/texmf-dist/source/latex/coolthms/coolthms.ins
new file mode 100644
index 00000000000..061e183c8c6
--- /dev/null
+++ b/Master/texmf-dist/source/latex/coolthms/coolthms.ins
@@ -0,0 +1,4 @@
+\input docstrip.tex
+\askforoverwritefalse
+\generate{\file{coolthms.sty}{\from{coolthms.dtx}{}}}
+\end
diff --git a/Master/texmf-dist/tex/latex/coolthms/coolthms.sty b/Master/texmf-dist/tex/latex/coolthms/coolthms.sty
new file mode 100644
index 00000000000..4ed2c6fd0a4
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/coolthms/coolthms.sty
@@ -0,0 +1,129 @@
+%%
+%% This is file `coolthms.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% coolthms.dtx
+%%
+%% IMPORTANT NOTICE:
+%%
+%% For the copyright see the source file.
+%%
+%% Any modified versions of this file must be renamed
+%% with new filenames distinct from coolthms.sty.
+%%
+%% For distribution of the original source see the terms
+%% for copying and modification in the file coolthms.dtx.
+%%
+%% This generated file may be distributed as long as the
+%% original source files, as listed above, are part of the
+%% same distribution. (The sources need not necessarily be
+%% in the same archive or directory.)
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{coolthms}[2012/03/29 v1.0 Theorem markup and advanced referencing]
+\let\Finv\@undefined
+\let\Game\@undefined
+\let\beth\@undefined
+\let\gimel\@undefined
+\let\daleth\@undefined
+\RequirePackage{amssymb}
+\RequirePackage{hyperref}
+\RequirePackage{etoolbox}
+\RequirePackage{ifthen}
+\RequirePackage{xargs}
+\RequirePackage{kvoptions}
+\@ifpackageloaded{amsmath}
+ {\RequirePackage[thmmarks,amsmath,hyperref]{ntheorem}}
+ {\RequirePackage[thmmarks,hyperref]{ntheorem}}
+\RequirePackage{cleveref}
+%% \begin{macro}{\ctp@hashchar}
+\begingroup
+\catcode`\#=12
+\gdef\ctp@hashchar{#}%
+\endgroup
+\@ifundefined{proofname}{\newcommand{\proofname}{Proof}}{}
+\DeclareStringOption[\proofname]{proofname}
+\DeclareStringOption[$\Box$]{proofsymbol}
+\DeclareStringOption[\it]{proofcaptionstyle}
+\DeclareStringOption[0em]{proofindent}
+\DeclareStringOption[:]{separator}
+\DeclareStringOption[0em]{indent}
+\DeclareStringOption[0pt]{minskip}
+\DeclareStringOption[6pt]{maxskip}
+\DeclareLocalOptions{separator,indent,minskip,maxskip%
+ proofname,proofsymbol,proofcaptionstyle,proofindent}
+\ProcessKeyvalOptions*
+\newtheoremstyle{keinenummern}%
+ {\item[\hskip\labelsep\theorem@headerfont ##1\theorem@separator]}%
+ {\item[\hskip\labelsep\theorem@headerfont ##1\ %
+ {\normalfont(##3)}\theorem@separator]}
+\newtheoremstyle{mitnummern}%
+ {\item[\hskip\labelsep\theorem@headerfont ##1\ ##2\theorem@separator]}%
+ {\item[\hskip\labelsep\theorem@headerfont ##1\ ##2\ %
+ {\normalfont(##3)}\theorem@separator]}
+\newtheoremstyle{unserbeweis}%
+ {\item[{\hskip\labelsep\theorem@headerfont ##1\theorem@separator}]}%
+ {\item[\hskip\labelsep{\theorem@headerfont ##3\theorem@separator}]}
+\@ifundefined{c@chapter}{%
+ \newcounter{chapter}%
+ \setcounter{chapter}{1}%
+}{}%
+\newcommandx*{\definetheorem}[5][1=thmcnt,3=,5=section]{
+ \@ifundefined{c@#1}{
+ \@ifundefined{c@#5}{
+ \newtheorem{#1}{#1}
+ }{
+ \newtheorem{#1}{#1}[#5]
+ }
+ }{}
+ \theoremstyle{mitnummern}
+ \newtheorem{#2}[#1]{#4}
+ \theoremstyle{keinenummern}
+ \newtheorem{n#2}[#1]{#4}
+ \ifblank{#3}{
+ \crefname{#2}{#4}{#4}
+ }{
+ \crefname{#2}{#4}{#3}
+ }
+ \crefformat{#2}{##2#4~##1##3}
+ \BeforeBeginEnvironment{n#2}{\addtocounter{#1}{-1}}
+ \BeforeBeginEnvironment{#2}{%
+ \addtocounter{#1}{1}%
+ \edef\ctp@labelcode%
+ {ctp@#2@\roman{chapter}@\roman{section}@\arabic{#1}}\relax%
+ \immediate\write\@auxout{\string\crefname{\ctp@labelcode}%
+ {#4\noexpand~\csname the#1\endcsname}%
+ {#4 plural\noexpand~\csname the#1\endcsname}}\relax%
+ \immediate\write\@auxout{\string\crefformat{\ctp@labelcode}%
+ {\string##2#4\noexpand~\csname the#1\endcsname\noexpand~%
+ \ctp@hashchar1\ctp@hashchar3}}\relax%
+ \edef\Label##1{\noexpand\label[\ctp@labelcode]{##1}}%
+ \addtocounter{#1}{-1} %
+ }%
+}%
+\newcommandx*{\theoremmarkup}[6][1=\bf,2=\normalfont,3=\relax,%
+ 4=\coolthms@indent,5=\coolthms@separator,6=arabic]{
+ \theoremheaderfont{\hspace*{-#4}#1}
+ \theorembodyfont{#2}
+ \theoremsymbol{#3}
+ \theoremindent#4\relax
+ \theoremseparator{#5}
+ \theoremnumbering{#6}
+}
+\crefformat{equation}{#2(#1)#3}
+\crefformat{chapter}{#2\chaptername~#1#3}
+\@ifundefined{sectionname}{\newcommand{\sectionname}{}}{}
+ \gappto\captionsgerman{\renewcommand{\sectionname}{Abschnitt}}%
+ \gappto\captionsenglish{\renewcommand{\sectionname}{section}}
+\crefformat{section}{#2\sectionname~#1#3}
+\theorempreskipamount\coolthms@minskip plus \coolthms@maxskip\relax
+\theorempostskipamount\coolthms@minskip plus \coolthms@maxskip\relax
+\theoremstyle{unserbeweis}
+\theoremmarkup[\coolthms@proofcaptionstyle][\normalfont]%
+ [\coolthms@proofsymbol][\coolthms@proofindent]
+\newtheorem{proof}{\coolthms@proofname}
+\theoremmarkup
+\endinput
+%%
+%% End of file `coolthms.sty'.