From c5c6b35b4250a3d62b639f7ca13f6111193abf0c Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 12 Jan 2012 23:19:23 +0000 Subject: mdframed (10jan12) git-svn-id: svn://tug.org/texlive/trunk@25091 c570f23f-e606-0410-a88d-b1316a301751 --- .../latex/mdframed/mdframed-example-default.tex | 197 +++++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 Master/texmf-dist/doc/latex/mdframed/mdframed-example-default.tex (limited to 'Master/texmf-dist/doc/latex/mdframed/mdframed-example-default.tex') 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..3af557c0741 --- /dev/null +++ b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-default.tex @@ -0,0 +1,197 @@ +%%$Id: mdframed.dtx 320 2012-01-09 18:44:33Z marco $ +\setcounter{errorcontextlines}{999} +\documentclass[parskip=false,english,11pt]{ltxmdf} +\ltxmdfsetifoot $Id: mdframed.dtx 320 2012-01-09 18:44:33Z marco $ + +\usepackage{showexpl} +\lstset{style=lstltxmdf,explpreset={pos=b,rframe={}},} + +\newcommand\Loadedframemethod{default} +\usepackage[framemethod=\Loadedframemethod]{mdframed} + +\title{The \Pack{mdframed} package} +\subtitle{Examples for \Opt{framemethod=\Loadedframemethod}} +\author{\href{mailto:marco.daniel@mada-nada.de}{Marco Daniel}} +\version{\mdversion} +\introduction{In this document I collect various examples for \Opt{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 \Pack{mdframed} width the option \Opt{framemethod=\Loadedframemethod} is loaded. All other modifications will be 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}.} + +\section{Examples} +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. +} +\end{tltxmdfexample} +\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=true,bottomline=false} +\begin{mdframed}[style=exampledefault,frametitle={Inhomogeneous linear}] +\ExampleText +\end{mdframed} +\end{LTXexample} +\clearpage + +\Examplesec{colored frame title} +\begin{LTXexample} + +\global\mdfapptodefinestyle{exampledefault}{% + rightline=true,innerleftmargin=10,innerrightmargin=10, + frametitlerule=true,frametitlerulecolor=green, + frametitlebackgroundcolor=yellow, + frametitlerulewidth=2pt} +\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} + +\clearpage +\Examplesec{Theorem environments} +\begin{LTXexample} +\mdfdefinestyle{theoremstyle}{% + linecolor=red,linewidth=2pt,% + frametitlerule=true,% + frametitlebackgroundcolor=gray!20, + innertopmargin=\topskip, + } +\mdtheorem[style=theoremstyle]{definition}{Definition} +\begin{definition} +\ExampleText +\end{definition} +\begin{definition}[Inhomogeneous linear] +\ExampleText +\end{definition} +\begin{definition*}[Inhomogeneous linear] +\ExampleText +\end{definition*} +\end{LTXexample} + +\clearpage +\Examplesec{theorem with separate header and the help of TikZ (complex)} +\begin{LTXexample} +\newcounter{theo}[section] +\newenvironment{theo}[1][]{% + \stepcounter{theo}% + \ifstrempty{#1}% + {\mdfsetup{% + frametitle={% + \tikz[baseline=(current bounding box.east),outer sep=0pt] + \node[anchor=east,rectangle,fill=blue!20] + {\strut Theorem~\thetheo};}} + }% + {\mdfsetup{% + frametitle={% + \tikz[baseline=(current bounding box.east),outer sep=0pt] + \node[anchor=east,rectangle,fill=blue!20] + {\strut Theorem~\thetheo:~#1};}}% + }% + \mdfsetup{innertopmargin=10pt,linecolor=blue!20,% + linewidth=2pt,topline=true, + frametitleaboveskip=\dimexpr-\ht\strutbox\relax,} + \begin{mdframed}[]\relax% + }{\end{mdframed}} +\begin{theo}[Inhomogeneous Linear] +\ExampleText +\end{theo} + +\begin{theo} +\ExampleText +\end{theo} +\end{LTXexample} + +\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\mdf@frame@leftline@single{% + \llap{\color{white}% + \rule[\dimexpr-\mdfboundingboxdepth+\interruptlength\relax]% + {\mdf@middlelinewidth@length}% + {\dimexpr\mdfboundingboxtotalheight% + \ifbool{mdf@topline}{+\mdf@middlelinewidth@length}{} + -2\interruptlength\relax}% + }% + }% + \appto\mdf@frame@rightline@single{% + \rlap{\color{white}% + \hspace*{\mdfboundingboxwidth}% + \hspace*{\mdf@innerrightmargin@length}% + \rule[\dimexpr-\mdfboundingboxdepth% + +\interruptlength\relax]% + {\mdf@middlelinewidth@length}% + {\dimexpr\mdfboundingboxtotalheight% + +\ifbool{mdf@topline}{\mdf@middlelinewidth@length}{0pt} + -2\interruptlength\relax}% + }% + }% +} +\makeatother +\overlaplines + +\begin{mdframed}[linecolor=blue,linewidth=8pt] +\ExampleText +\end{mdframed} +\end{LTXexample} +\end{document} + \endinput -- cgit v1.2.3