summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/mdframed/mdframed-example-texsx.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/mdframed/mdframed-example-texsx.tex')
-rw-r--r--Master/texmf-dist/doc/latex/mdframed/mdframed-example-texsx.tex168
1 files changed, 65 insertions, 103 deletions
diff --git a/Master/texmf-dist/doc/latex/mdframed/mdframed-example-texsx.tex b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-texsx.tex
index b486389e415..6f34f23d9a6 100644
--- a/Master/texmf-dist/doc/latex/mdframed/mdframed-example-texsx.tex
+++ b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-texsx.tex
@@ -1,14 +1,34 @@
+
\setcounter{errorcontextlines}{999}
\documentclass[parskip=false,english,11pt,lipsum=true]{ltxmdf}
-\usepackage{showexpl}
-\lstset{style=lstltxmdf,explpreset={pos=b,rframe={}},}
\usepackage{tikz}
\usetikzlibrary{calc,arrows,shadings,shadows}
\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}}
@@ -45,8 +65,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:
@@ -54,14 +74,13 @@ 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
@@ -90,24 +109,24 @@ With the new command \Cmd{surroundwithmdframed} you can use
\surroundwithmdframed{listings}
\end{tltxmdfexample}
+\clearpage
\Examplesec{Package multicol}
How I wrote in \enquote{Known Problems} you can't combine \Pack{multicol} with
\Pack{mdframed}. In a simple way without any breaks you can use:
-\begin{LTXexample}[morekeywords={multicols}]
-\begin{multicols}{2}
-\lipsum[1]
-\begin{mdframed}
-\ExampleText
-\end{mdframed}
-\lipsum[2]
-\end{multicols}
-\end{LTXexample}
+
+\begin{tltxmdfexample*}[morekeywords={multicols}]
+ \begin{multicols}{2}
+ \lipsum[1]
+ \begin{mdframed}
+ \ExampleText
+ \end{mdframed}
+ \lipsum[2]
+ \end{multicols}
+\end{tltxmdfexample*}
+
\clearpage
\twocolumn[\Examplesec{Working in twocolumn mode}]
-\begin{tltxmdfexample}
-\twocolumn[%
- \Examplesec{Working in
- twocolumn mode}]
+\begin{tltxmdfexample*}[moretexcs={Examplesec}]
\lipsum[1]\lipsum[2]
\begin{mdframed}[%
leftmargin=10pt,%
@@ -117,19 +136,12 @@ How I wrote in \enquote{Known Problems} you can't combine \Pack{multicol} with
\ExampleText
\end{mdframed}
\lipsum[2]
-\end{tltxmdfexample}
-\lipsum[1]\lipsum[2]
-\begin{mdframed}[leftmargin=10pt,%
- rightmargin=10pt,%
- linecolor=red,
- backgroundcolor=yellow]
-\ExampleText
-\end{mdframed}
-\lipsum[2]
+\end{tltxmdfexample*}
+
\clearpage
\onecolumn
\Examplesec{Working inside enumerate}
-\begin{LTXexample}[morekeywords={enumerate}]
+\begin{tltxmdfexample*}[morekeywords={enumerate}]
Text Text Text Text Text Text Text Text
\begin{enumerate}
\item in the following \ldots
@@ -139,10 +151,10 @@ Text Text Text Text Text Text Text Text
\item \lipsum[2]
\end{enumerate}
Text Text Text Text Text Text
-\end{LTXexample}
-\clearpage
+\end{tltxmdfexample*}
+
\Examplesec{Position a specific symbol at a line}
-\begin{LTXexample}
+\begin{tltxmdfexample*}
\tikzset{
warningsymbol/.style={
rectangle,draw=red,
@@ -172,11 +184,10 @@ Text Text Text Text Text Text
\begin{mdframed}[style=warning]
\ExampleText
\end{mdframed}
-\end{LTXexample}
+\end{tltxmdfexample*}
-\clearpage
\Examplesec{digression-environement inspired by Tobias Weh}
-\begin{lstlisting}[morekeywords={%
+\begin{tltxmdfexample*}[morekeywords={%
font,anchor,let,in,arrow,round,cap,controls,coordinate,%
excursus,head,arrows,calc,line,width,and,to,digressionarrows,%
base,west},%
@@ -232,70 +243,21 @@ Text Text Text Text Text Text
\begin{mdframed}[style=digressionarrows]
\ExampleText
\end{mdframed}
-\end{lstlisting}
-
-\tikzset{
- excursus arrow/.style={%
- line width=2pt,
- draw=gray!40,
- rounded corners=2ex,
- },
- excursus head/.style={
- fill=white,
- font=\bfseries\sffamily,
- text=gray!80,
- anchor=base west,
- },
-}
-\mdfdefinestyle{digressionarrows}{%
- singleextra={%
- \path let \p1=(P), \p2=(O) in (\x2,\y1) coordinate (Q);
- \path let \p1=(Q), \p2=(O) in (\x1,{(\y1-\y2)/2}) coordinate (M);
- \path [excursus arrow, round cap-to]
- ($(O)+(5em,0ex)$) -| (M) |- %
- ($(Q)+(12em,0ex)$) .. controls +(0:16em) and +(185:6em) .. %
- ++(23em,2ex);
- \node [excursus head] at ($(Q)+(2.5em,-0.75pt)$) {Digression};},
- firstextra={%
- \path let \p1=(P), \p2=(O) in (\x2,\y1) coordinate (Q);
- \path [excursus arrow,-to]
- (O) |- %
- ($(Q)+(12em,0ex)$) .. controls +(0:16em) and +(185:6em) .. %
- ++(23em,2ex);
- \node [excursus head] at ($(Q)+(2.5em,-2pt)$) {Digression};},
- secondextra={%
- \path let \p1=(P), \p2=(O) in (\x2,\y1) coordinate (Q);
- \path [excursus arrow,round cap-]
- ($(O)+(5em,0ex)$) -| (Q);},
- middleextra={%
- \path let \p1=(P), \p2=(O) in (\x2,\y1) coordinate (Q);
- \path [excursus arrow]
- (O) -- (Q);},
- middlelinewidth=2.5em,middlelinecolor=white,
- hidealllines=true,topline=true,
- innertopmargin=0.5ex,
- innerbottommargin=2.5ex,
- innerrightmargin=2pt,
- innerleftmargin=2ex,
- skipabove=0.87\baselineskip,
- skipbelow=0.62\baselineskip,
-}
-
-\begin{mdframed}[style=digressionarrows]
- \ExampleText
-\end{mdframed}
+\end{tltxmdfexample*}
\Examplesec{Theorem style shading background}
-\begin{LTXexample}[morekeywords={top,bottom,Theorem,shadow,alternativtheorem}]
+\begin{tltxmdfexample*}[morekeywords={top,bottom,Theorem,shadow,alternativtheorem}]
\mdtheorem[%
- apptotikzsetting={\tikzset{mdfbackground/.append style =%
- {top color=yellow!40!white,
- bottom color=yellow!80!black},
- mdfframetitlebackground/.append style =%
- {top color=purple!40!white,
- bottom color=purple!80!black}
- }%
- },
+ apptotikzsetting={%
+ \tikzset{mdfbackground/.append style ={%
+ top color=yellow!40!white,
+ bottom color=yellow!80!black},
+ mdfframetitlebackground/.append style={
+ top color=purple!40!white,
+ bottom color=purple!80!black
+ }
+ }%
+ },
,roundcorner=10pt,middlelinewidth=2pt,
shadow=true,frametitlerule=true,frametitlerulewidth=4pt,
innertopmargin=10pt,%
@@ -303,6 +265,6 @@ Text Text Text Text Text Text
\begin{alternativtheorem}[Inhomogeneous linear]
\ExampleText
\end{alternativtheorem}
-\end{LTXexample}
+\end{tltxmdfexample*}
\end{document}
\endinput