summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/mdframed/mdframed-example-tikz.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/mdframed/mdframed-example-tikz.tex')
-rw-r--r--Master/texmf-dist/doc/latex/mdframed/mdframed-example-tikz.tex145
1 files changed, 56 insertions, 89 deletions
diff --git a/Master/texmf-dist/doc/latex/mdframed/mdframed-example-tikz.tex b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-tikz.tex
index fcb53648071..64462bf143f 100644
--- a/Master/texmf-dist/doc/latex/mdframed/mdframed-example-tikz.tex
+++ b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-tikz.tex
@@ -1,12 +1,31 @@
+
\setcounter{errorcontextlines}{999}
\documentclass[parskip=false,english,11pt]{ltxmdf}
-\usepackage{showexpl}
-\lstset{style=lstltxmdf,explpreset={pos=b,rframe={}},}
-
\newcommand\Loadedframemethod{TikZ}
\usepackage[framemethod=\Loadedframemethod]{mdframed}
+\surroundwithmdframed[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,%
+ roundcorner=10pt,innertopmargin=0pt,%
+ leftmargin=1cm,rightmargin=1cm,%
+ innerleftmargin=-15pt,innerrightmargin=-15pt,%
+ ignorelastdescenders,%
+ settings={\lstset{resetmargins}},%
+ skipbelow=\topskip,skipabove=\topskip,%
+ innerbottommargin=0pt,backgroundcolor=gray!10]%
+ {tltxmdfexample}
+
+\newmdenv[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,%
+ roundcorner=10pt,innertopmargin=0pt,%
+ leftmargin=1cm,rightmargin=1cm,%
+ innerleftmargin=-15pt,innerrightmargin=-15pt,%
+ ignorelastdescenders,%
+ settings={\lstset{resetmargins}},%
+ skipbelow=\topskip,skipabove=\topskip,%
+ innerbottommargin=0pt,backgroundcolor=gray!10]%
+ {tltxmdfhighlight}
+\def\highlightinputenv{tltxmdfhighlight}
+
\title{The \Pack{mdframed} package}
\subtitle{Examples for \Opt{framemethod=\Loadedframemethod}}
\author{\href{mailto:marco.daniel@mada-nada.de}{Marco Daniel}}
@@ -43,8 +62,8 @@ In the preamble only the package \Pack{mdframed} width the option
done by \Cmd{mdfdefinestyle} or \Cmd{mdfsetup}.
{\large\color{red!50!black}
-\NOTE Every \Cmd{global} inside the examples is necessary to work with the
-package \Pack{showexpl}.}
+\NOTE Every \Cmd{global} inside the examples is necessary to work with my own
+created environment \Env{tltxmdfexample*}.}
\section{Examples}
All examples have the following settings:
@@ -52,19 +71,19 @@ All examples have the following settings:
\begin{tltxmdfexample}
\mdfsetup{skipabove=\topskip,skipbelow=\topskip}
\newrobustcmd\ExampleText{%
-An \textit{inhomogeneous linear} differential equation
-has the form
-\begin{align}
-L[v ] = f,
-\end{align}
-where $L$ is a linear differential operator, $v$ is
-the dependent variable, and $f$ is a given non-zero
-function of the independent variables alone.
+ An \textit{inhomogeneous linear} differential equation has the form
+ \begin{align}
+ L[v ] = f,
+ \end{align}
+ where $L$ is a linear differential operator, $v$ is the dependent
+ variable, and $f$ is a given non-zero function of the independent
+ variables alone.
}
\end{tltxmdfexample}
+
\clearpage
\Examplesec{round corner}
-\begin{LTXexample}
+\begin{tltxmdfexample*}
\global\mdfdefinestyle{exampledefault}{%
outerlinewidth=5pt,innerlinewidth=0pt,
outerlinecolor=red,roundcorner=5pt
@@ -72,29 +91,30 @@ function of the independent variables alone.
\begin{mdframed}[style=exampledefault]
\ExampleText
\end{mdframed}
-\end{LTXexample}
+\end{tltxmdfexample*}
\Examplesec{hidden line + frame title}
-\begin{LTXexample}
+\begin{tltxmdfexample*}
\global\mdfapptodefinestyle{exampledefault}{%
topline=false,leftline=false,}
\begin{mdframed}[style=exampledefault,frametitle={Inhomogeneous linear}]
\ExampleText
\end{mdframed}
-\end{LTXexample}
-\clearpage
+\end{tltxmdfexample*}
+
\Examplesec{framed picture which is centered}
-\begin{LTXexample}
+\begin{tltxmdfexample*}
\begin{mdframed}[userdefinedwidth=6cm,align=center,
linecolor=blue,middlelinewidth=4pt,roundcorner=5pt]
-\IfFileExists{donald-duck.jpg}%
- {\includegraphics[width=\linewidth]{donald-duck}}%
+\textit{CTAN lion drawing by Duane Bibby; thanks to \url{www.ctan.org}}
+\IfFileExists{ctan-lion.png}%
+ {\includegraphics[width=\linewidth]{ctan-lion.png}}%
{\rule{\linewidth}{4cm}}%
\end{mdframed}
-\end{LTXexample}
+\end{tltxmdfexample*}
\Examplesec{Gimmick}
-\begin{LTXexample}[morekeywords={line,width,dash,dashed,pattern}]
+\begin{tltxmdfexample*}[morekeywords={line,width,dash,dashed,pattern}]
\mdfsetup{splitbottomskip=0.8cm,splittopskip=0cm,
innerrightmargin=2cm,innertopmargin=1cm,%
innerlinewidth=2pt,outerlinewidth=2pt,
@@ -107,15 +127,15 @@ function of the independent variables alone.
\begin{mdframed}
\ExampleText
\end{mdframed}
-\end{LTXexample}
+\end{tltxmdfexample*}
\clearpage
\Examplesec{complex example with TikZ}
-\begin{tltxmdfexample}[morekeywords={mdf}]
-\tikzstyle{titregris} =
- [draw=gray, thick, fill=white, shading = exersicetitle, %
- text=gray, rectangle, rounded corners, right,minimum height=.7cm]
+\begin{tltxmdfexample*}[morekeywords={mdf}]
+\tikzset{titregris/.style =
+ {draw=gray, thick, fill=white, shading = exersicetitle, %
+ text=gray, rectangle, rounded corners, right,minimum height=.7cm}}
\pgfdeclarehorizontalshading{exersicebackground}{100bp}
{color(0bp)=(green!40); color(100bp)=(black!5)}
\pgfdeclarehorizontalshading{exersicetitle}{100bp}
@@ -141,73 +161,19 @@ function of the independent variables alone.
settings={\global\stepcounter{exercise}},
singleextra={%
\node[titregris,xshift=1cm] at (P-|O) %
- {~\mdf@frametitlefont{\theexercise}~};
+ {~\mdf@frametitlefont{\theexercise}\hbox{~}};
\ifdefempty{\mdf@@exercisepoints}%
{}%
{\node[titregris,left,xshift=-1cm] at (P)%
- {~\mdf@frametitlefont{\mdf@@exercisepoints points}~};}%
+ {~\mdf@frametitlefont{\mdf@@exercisepoints points}\hbox{~}};}%
},
firstextra={%
\node[titregris,xshift=1cm] at (P-|O) %
- {~\mdf@frametitlefont{\theexercise}~};
+ {~\mdf@frametitlefont{\theexercise}\hbox{~}};
\ifdefempty{\mdf@@exercisepoints}%
{}%
{\node[titregris,left,xshift=-1cm] at (P)%
- {~\mdf@frametitlefont{\mdf@@exercisepoints points}~};}%
- },
-}
-\makeatother
-
-\begin{mdframed}[style=exercisestyle]
-\ExampleText
-\end{mdframed}
-
-\begin{mdframed}[style=exercisestyle,exercisepoints=10]
-\ExampleText
-\end{mdframed}
-\end{tltxmdfexample}
-
-\tikzstyle{titregris} =
- [draw=gray, thick, fill=white, shading = exersicetitle, %
- text=gray, rectangle, rounded corners, right,minimum height=.7cm]
-\pgfdeclarehorizontalshading{exersicebackground}{100bp}
- {color(0bp)=(green!40); color(100bp)=(black!5)}
-\pgfdeclarehorizontalshading{exersicetitle}{100bp}
- {color(0bp)=(red!40);color(100bp)=(black!5)}
-\newcounter{exercise}
-\renewcommand*\theexercise{Exercise~n\arabic{exercise}}
-\makeatletter
-\def\mdf@@exercisepoints{}%new mdframed key:
-\define@key{mdf}{exercisepoints}{%
- \def\mdf@@exercisepoints{#1}
-}
-\mdfdefinestyle{exercisestyle}{%
- outerlinewidth=1em,outerlinecolor=white,%
- leftmargin=-1em,rightmargin=-1em,%
- middlelinewidth=1.2pt,roundcorner=5pt,linecolor=gray,
- apptotikzsetting={\tikzset{mdfbackground/.append style ={%
- shading = exersicebackground}}},
- innertopmargin=1.2\baselineskip,
- skipabove={\dimexpr0.5\baselineskip+\topskip\relax},
- skipbelow={-1em},
- needspace=3\baselineskip,
- frametitlefont=\sffamily\bfseries,
- settings={\global\stepcounter{exercise}},
- singleextra={%
- \node[titregris,xshift=1cm] at (P-|O) %
- {~\mdf@frametitlefont{\theexercise}~};
- \ifdefempty{\mdf@@exercisepoints}%
- {}%
- {\node[titregris,left,xshift=-1cm] at (P)%
- {~\mdf@frametitlefont{\mdf@@exercisepoints points}~};}%
- },
- firstextra={%
- \node[titregris,xshift=1cm] at (P-|O) %
- {~\mdf@frametitlefont{\theexercise}~};
- \ifdefempty{\mdf@@exercisepoints}%
- {}%
- {\node[titregris,left,xshift=-1cm] at (P)%
- {~\mdf@frametitlefont{\mdf@@exercisepoints points}~};}%
+ {~\mdf@frametitlefont{\mdf@@exercisepoints points}\hbox{~}};}%
},
}
\makeatother
@@ -219,10 +185,11 @@ function of the independent variables alone.
\begin{mdframed}[style=exercisestyle,exercisepoints=10]
\ExampleText
\end{mdframed}
+\end{tltxmdfexample*}
\clearpage
\Examplesec{Theorem environments}
-\begin{LTXexample}[morekeywords={theoremstyle,definition}]
+\begin{tltxmdfexample*}[morekeywords={theoremstyle,definition}]
\mdfdefinestyle{theoremstyle}{%
linecolor=red,middlelinewidth=2pt,%
frametitlerule=true,%
@@ -239,7 +206,7 @@ function of the independent variables alone.
\begin{definition*}[Inhomogeneous linear]
\ExampleText
\end{definition*}
-\end{LTXexample}
-
+\end{tltxmdfexample*}
\end{document}
\endinput
+