summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/mdframed/ltxmdf.cls
blob: d52123efd057f6c6a8af09cf4d8f729fb4413236 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
%% documentclass only for the documentation of mdframed
%% This documentclass isn't maintanened or efficient for writing
%%
%%
%% Copyright (c) 2010 Marco Daniel
%%
%% This package may be distributed under the terms of the LaTeX Project
%% Public License, as described in lppl.txt in the base LaTeX distribution.
%% Either version 1.0 or, at your option, any later version.

%%$Id: ltxmdf.cls 220 2011-11-13 17:39:13Z marco $
%%$Rev: 220 $
%%$Author: marco $
%%$Date: 2011-11-13 18:39:13 +0100 (So, 13. Nov 2011) $

%% Allgemeine Angaben
\def\md@maindate@svn$#1: #2 #3 #4-#5-#6 #7 #8${#4/#5/#6\space }
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{ltxmdf}[\md@maindate@svn$Id: ltxmdf.cls 220 2011-11-13 17:39:13Z marco $ ltxmdf]
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrartcl}}
\ProcessOptions\relax
\LoadClass{scrartcl}
\RequirePackage{etoolbox}
%Required Packages no font / no language
\RequirePackage[nofancy,draft,notoday]{svninfo}
\RequirePackage[left=2.5cm,right=2.5cm,top=3cm,bottom=3cm]{geometry}
\RequirePackage[T1]{fontenc}
\RequirePackage{microtype}
\RequirePackage[french=quotes]{csquotes}
\RequirePackage{xspace}
\begingroup
  \text@command\relax
  \global\let\xspace@check@icr\check@icr
\endgroup
\xspaceaddexceptions{\xspace@check@icr}
\RequirePackage{multicol}\columnseprule0.4pt
\RequirePackage{scrpage2}
\RequirePackage{listings}
\RequirePackage[inline]{enumitem}
\RequirePackage{amsmath}
\RequirePackage[amsmath]{ntheorem}
\RequirePackage{array,booktabs}
\RequirePackage{xcolor,tikz}
\RequirePackage{graphicx}
\AtEndPreamble{%
  \RequirePackage{hyperref}
    \hypersetup{%
        breaklinks=true,
        pdftitle={Documenation of mdframed},%
        pdfauthor={Marco Daniel},%
        colorlinks=true,%
        linkcolor=titleblue,
        urlcolor=cyan,
        bookmarksdepth=4,
    }
}

%Kopf- und Fusszeilen
\clearscrheadfoot
\pagestyle{scrheadings}
\automark[subsection]{section}
\renewcommand{\sectionmark}[1]{\markboth{\sectionmarkformat #1}{}}%
\renewcommand{\subsectionmark}[1]{\markright{\subsectionmarkformat #1}} %nur Titel ohne Nr.
\ihead{\rightmark}
\ohead{\leftmark}
\ofoot{\pagemark} 
\ifoot{\svnId}


%Tikz und Farbe
\usetikzlibrary{calc,backgrounds,arrows,matrix}
\colorlet{titleblue}{blue!30!black}

\lstset{keywordstyle=\bfseries}
\lstdefinestyle{lstmdframed}{%
     basicstyle=\small\ttfamily,
     language={[LaTeX]TeX},
     basicstyle=\small,%
     xleftmargin=20pt,%
     xrightmargin=20pt,%
     frame=single,%
     rulecolor=\color{titleblue},%
     framesep=5pt,%
     framerule=1pt,%
     texcsstyle=*\color{red!50!black}\bfseries,
     moretexcs=intertext,
     keywordstyle=\color{blue!60!black}\bfseries,%
     columns=fixed,%
     fontadjust=true,%
     basewidth=0.65em,%
     breakatwhitespace=true,
     morekeywords=[2]{@length},
     keywordstyle=[2]\color{red!50!black}\bfseries,
     morekeywords={outerlinewidth,leftmargin,rightmargin,backgroundcolor,%
                   outerlinecolor,innertopmargin,splittopskip,skipbelow,%
                   skipabove,ntheorem,theorem,lemma,mdframed,linecolor,%
                   frametitle,infobox,innerlinewidth,roundcorner,leftline,topline,%
                   splitbottomskip,middlelinewidth,middlelinecolor,tikzsetting,%
                   rightline,bottomline,innerrightmargin,style,linewidth,lem,section,%
                   definedstyle,mdfapptodefinestyle,needspace,mdf@globalstyle@cnt,framemethod,%
                   ExampleText,titregris,draw,gray,thick,fill,white,shading,exersicetitle,
                   exersicebackground,color,green,black,exercise,exercisepoints,
                   text,rectangle,rounded,corners,right,minimum,height,xshift,at,
                   exercisestyle,settings,frametitlefont},%
     moretexcs={newmdtheoremenv,newmdenv,theoremstyle,mdfsetup,@length,%
                   md@putbox@single,@tempboxa,mdf@,%
                   mdf@linewidth,mdf@leftmargin@length,interruptlength,%
                   setlength,newrobustcmd,overlaplines,appto,md@frame@leftline@singe,%
                   color,md@frame@leftline@single,mdf@innerbottommargin@length,%
                   mdf@middlelinewidth@length,mdfboundingboxheight,%
                   md@frame@rightline@single,mdfboundingboxwidth,%
                   mdf@innerrightmargin@length,mdfdefinestyle,mdfapptodefinestyle,defcounter,
                   tikzstyle,pgfdeclarehorizontalshading,theexercise,mdf@@exercisepoints,
                   define@key,renewrobustcmd,mdfcreateextratikz,node,ifdefempty,
                   mdf@frametitlefont,dimexpr,mdframedtitleenv,ifstrempty},%
}


\lstnewenvironment{mdexample}[1][]
  {\lstset{style=lstmdframed,#1}}%
  {}

%table of contens anpassen:
\renewcommand\tableofcontents{%
\setcounter{tocdepth}{2}%
 \begin{multicols}{2}[\centering\textbf{\sffamily\Large\contentsname}]
        \@starttoc{toc}
 \end{multicols}
}


%Anweisung zur Darstellung
\newcommand*\mdoption[1]{\textsf{\color{titleblue}#1}}
\newcommand*\mdname{\textsf{mdframed}\xspace}
\newcommand*\mdpack[1]{\texttt{#1}\xspace}
\newcommand*\mdsetting[1]{\textsf{#1}\xspace}
\newcommand*\mdcommand[1]{\texttt{\textbackslash #1}\xspace}

\newcommand*\mdDescribeMacro[2][]{\par\kern\baselineskip%
                                   \noindent\makebox[0pt][l]{\kern-2em%
                                   \textsf{\bfseries\color{titleblue}#2}%
                                   }\hfill\mbox{\mdDefault{#1}}\par\kern.5ex\noindent\ignorespaces}
\newcommand*{\mdDefault}[1]{%
 \ifx\relax#1\relax\else{\small\mdsetting{default=#1}}\fi}

\newcommand*\mdDescribeCmd[2][]{\par\kern\baselineskip%
                                   \noindent\makebox[0pt][l]{\kern-2em%
                                   \textsf{\bfseries\color{titleblue}\textbackslash #2}%
                                   }{#1}\hfill\mbox{\mdDefault{#1}}\par\kern.5ex\noindent\ignorespaces}


\newcommand\NOTE{\minisec{Note}}

\newcommand\limitation[1][TikZ]{\newline{\small This works only with \mdoption{framemethod=#1}.}}

%%Maketitle angepasst:
\def\title#1{\def\@title{#1}}
\def\subtitle#1{\def\@subtitle{#1}}
\def\author#1{\def\@author{#1}}
\def\version#1{\def\@version{#1}}
\def\date#1{\def\@date{#1}}
\long\def\introduction#1{\def\@introduction{#1}}

\def\maketitle{%
 \clearpage
 \thispagestyle{empty}
 \begingroup
  \begingroup
    \parindent\z@
    \centering
     \color{titleblue}\Large\bfseries\sffamily\@title
     \par\kern.5\baselineskip
     \normalfont\large\normalcolor\@subtitle
     \par\kern.5\baselineskip
     \null\quad\@author\hfill\@version\hfill\@date\quad\null
  \endgroup
     \par\kern.5\baselineskip
  \begin{abstract}
     \@introduction
  \end{abstract}
     \par\kern.2\baselineskip
  \pdfbookmark[1]{\contentsname}{tocbook}
  \tableofcontents
 \endgroup
}