diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/mdframed/mdframed-example-default.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/mdframed/mdframed-example-default.tex | 250 |
1 files changed, 250 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/mdframed/mdframed-example-default.tex b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-default.tex new file mode 100644 index 00000000000..82209c353ea --- /dev/null +++ b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-default.tex @@ -0,0 +1,250 @@ +%Documenation of the package mdframed +%%$Id: mdframed-example-default.tex 221 2011-11-13 18:03:29Z marco $ +\setcounter{errorcontextlines}{999} +\documentclass[parskip=false,english,11pt]{ltxmdf} +\svnInfo $Id: mdframed-example-default.tex 221 2011-11-13 18:03:29Z marco $ +\usepackage{babel} +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage[T1,altbullet]{lucidabr} +\usepackage[scaled=0.82]{beramono} + +\usepackage[]{showexpl} +\lstset{style=lstmdframed,explpreset={pos=b,rframe={}},} + +\newcommand\Loadedframemethod{default} +\usepackage[framemethod=\Loadedframemethod]{mdframed} + +\title{The \mdname package} +\subtitle{Examples for \mdoption{framemethod=\Loadedframemethod}} +\author{\href{mailto:marco.daniel@mada-nada.de}{Marco Daniel}} +\version{\mdversion} +\date{\svnToday} +\introduction{In this document I collect various examples for \mdoption{framemethod=\Loadedframemethod}. +Some presented examples are more or less exorbitant.} + + +\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. +} + + +\newcounter{examplecount} +\setcounter{examplecount}{0} +\renewcommand\thesubsection{} +\newcommand\Examplesec[1]{% +\stepcounter{examplecount}% +\subsection{Example~\arabic{examplecount}~--~#1\relax}% +} + +\begin{document} +\maketitle +\section{Loading} +In the preamble only the package \mdname width the option \mdoption{framemethod=\Loadedframemethod} is loaded. All other modifications will be done by \mdcommand{mdfdefinestyle} or \mdcommand{mdfsetup}. + +{\large\color{red!50!black} +\NOTE Every \mdcommand{global} inside the examples is necessary to work with the package \mdpack{showexpl}.} + +\section{Examples} +All examples have the following settings: + +\begin{mdexample} +\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. +} +\end{mdexample} +\clearpage +\Examplesec{very simple} +\begin{LTXexample} +\global\mdfdefinestyle{exampledefault}{% + linecolor=red,linewidth=3pt,% + leftmargin=1cm,rightmargin=1cm +} +\begin{mdframed}[style=exampledefault] +\ExampleText +\end{mdframed} +\end{LTXexample} + + +\Examplesec{hidden line + frame title} +\begin{LTXexample} +\global\mdfapptodefinestyle{exampledefault}{% + topline=false,rightline=false,bottomline=false} +\begin{mdframed}[style=exampledefault,frametitle={Inhomogeneous linear}] +\ExampleText +\end{mdframed} +\end{LTXexample} +\clearpage +\Examplesec{colored frame title} +\begin{LTXexample} +\renewcommand\mdframedtitleenv[1]{% + \colorbox{green}{% + \parbox{\linewidth}{\centering\bfseries #1}}% + \par\kern.5\baselineskip\noindent% + } +\global\mdfapptodefinestyle{exampledefault}{% + rightline=true} +\begin{mdframed}[style=exampledefault,frametitle={Inhomogeneous linear}] +\ExampleText +\end{mdframed} +\end{LTXexample} + +\Examplesec{framed picture which is centered} +\begin{LTXexample} +\begin{mdframed}[userdefinedwidth=6cm,align=center, + linecolor=blue,linewidth=4pt] +\includegraphics[width=\linewidth]{donald-duck} +\end{mdframed} +\end{LTXexample} + +\Examplesec{theorem with separate header and the help of TikZ (complex)} +\begin{mdexample} +\makeatletter +\newcounter{theo}[section] +\newcommand*\newmdframedtitleenv[1]{% + \@afterindentfalse + {\parindent \z@ + \setlength{\parfillskip}{\z@ plus 1fil}% + \mdraggedtitle\nobreak% + \makebox[\linewidth][l]{% + \hspace*{-1\mdf@innerleftmargin@length}% + \rlap{\color{white}% + \hspace*{-1\mdf@middlelinewidth@length}% + \rule[\mdf@middlelinewidth@length]% + {\dimexpr\linewidth+1\mdf@innerleftmargin@length% + +\mdf@innerrightmargin@length + +2\mdf@middlelinewidth@length\relax}% + {\dimexpr\ht\strutbox+.3333em\relax}% + }% + \rlap{\color{blue!20}% + \rule{\dimexpr\linewidth+\mdf@innerleftmargin@length% + +\mdf@innerrightmargin@length\relax}% + {\mdf@middlelinewidth@length}}% + \hspace*{-1\mdf@middlelinewidth@length}% + \tikz[remember picture,baseline]% + \node[,draw = none, text = black,fill = blue!20,]% + {\mdf@frametitlefont\strut Theorem~\thetheo#1};\relax% + }% + \par\kern.5\baselineskip}% + \@afterheading} +\newenvironment{theo}[1][]{% + \let\mdframedtitleenv\newmdframedtitleenv% + \stepcounter{theo}% + \ifstrempty{#1}% + {\mdfsetup{frametitle={\strut}}}% + {\mdfsetup{frametitle={:~#1}}}% + \begin{mdframed}[innertopmargin=0pt,linecolor=blue!20,% + linewidth=2pt,topline=false,]% + }{\end{mdframed}} +\begin{theo}[Inhomogeneous Linear] +\ExampleText +\end{theo} + +\begin{theo} +\ExampleText +\end{theo} +\end{mdexample} +\makeatletter +\newcounter{theo}[section] +\newcommand*\newmdframedtitleenv[1]{% + \@afterindentfalse + {\parindent \z@ + \setlength{\parfillskip}{\z@ plus 1fil}% + \mdraggedtitle\nobreak% + \makebox[\linewidth][l]{% + \hspace*{-1\mdf@innerleftmargin@length}% + \rlap{\color{white}% + \hspace*{-1\mdf@middlelinewidth@length}% + \rule[\mdf@middlelinewidth@length]% + {\dimexpr\linewidth+1\mdf@innerleftmargin@length% + +\mdf@innerrightmargin@length + +2\mdf@middlelinewidth@length\relax}% + {\dimexpr\ht\strutbox+.3333em\relax}% + }% + \rlap{\color{blue!20}% + \rule{\dimexpr\linewidth+\mdf@innerleftmargin@length% + +\mdf@innerrightmargin@length\relax}% + {\mdf@middlelinewidth@length}}% + \hspace*{-1\mdf@middlelinewidth@length}% + \tikz[remember picture,baseline]% + \node[,draw = none, text = black,fill = blue!20,]% + {\mdf@frametitlefont\strut Theorem~\thetheo#1};\relax% + }% + \par\kern.5\baselineskip}% + \@afterheading} +\newenvironment{theo}[1][]{% + \let\mdframedtitleenv\newmdframedtitleenv% + \stepcounter{theo}% + \ifstrempty{#1}% + {\mdfsetup{frametitle={\strut}}}% + {\mdfsetup{frametitle={:~#1}}}% + \begin{mdframed}[innertopmargin=0pt,linecolor=blue!20,% + linewidth=2pt,topline=false,]% + }{\end{mdframed}} +\begin{theo}[Inhomogeneous Linear] +\ExampleText +\end{theo} + +\begin{theo} +\ExampleText +\end{theo} + +\clearpage +\Examplesec{hide only a part of a line} +The example below is inspired by the following post on StackExchange \href{http://tex.stackexchange.com/questions/24101/theorem-decorations-that-stay-with-theorem-environment}{Theorem decorations that stay with theorem environment} +\begin{LTXexample} +\makeatletter +\newlength{\interruptlength} +\setlength{\interruptlength}{2.5ex} +\newrobustcmd\overlaplines{% + \appto\md@frame@leftline@single{% + \llap{\color{white}% + \rule[\dimexpr-\mdfboundingboxdepth% + \ifbool{mdf@bottomline}{-\mdf@middlelinewidth@length}{}% + +\interruptlength\relax]% + {\mdf@middlelinewidth@length}% + {\dimexpr\mdfboundingboxtotalheight% + +\ifbool{mdf@bottomline}{\mdf@middlelinewidth@length}{0pt} + +\ifbool{mdf@topline}{\mdf@middlelinewidth@length}{0pt}% + -2\interruptlength\relax}% + }% + }% + \appto\md@frame@rightline@single{% + \rlap{\color{white}% + \hspace*{\mdfboundingboxwidth}% + \hspace*{\mdf@innerrightmargin@length}% + \rule[\dimexpr-\mdfboundingboxdepth% + \ifbool{mdf@bottomline}{-\mdf@middlelinewidth@length}{} + +\interruptlength\relax]% + {\mdf@middlelinewidth@length}% + {\dimexpr\mdfboundingboxtotalheight% + +\ifbool{mdf@bottomline}{\mdf@middlelinewidth@length}{0pt}% + +\ifbool{mdf@topline}{\mdf@middlelinewidth@length}{0pt} + -2\interruptlength\relax}% + }% + } +} +\makeatother +\overlaplines + + +\begin{mdframed}[linecolor=blue,linewidth=2pt] +\ExampleText +\end{mdframed} +\end{LTXexample} +\end{document} |