diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/mdframed/mdframed-doc-en.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/mdframed/mdframed-doc-en.tex | 559 |
1 files changed, 141 insertions, 418 deletions
diff --git a/Master/texmf-dist/doc/latex/mdframed/mdframed-doc-en.tex b/Master/texmf-dist/doc/latex/mdframed/mdframed-doc-en.tex index a9ea47561df..4c5b0dd74d8 100644 --- a/Master/texmf-dist/doc/latex/mdframed/mdframed-doc-en.tex +++ b/Master/texmf-dist/doc/latex/mdframed/mdframed-doc-en.tex @@ -1,177 +1,42 @@ %Documenation of the package mdframed -%%$Id: mdframed-doc-en.tex 209 2011-10-09 11:53:45Z marco $ -%%$Rev: 209 $ -%%$Author: marco $ -%%$Dater:$ -%% [latex -> ps -> pdf] +%%$Id: mdframed-doc-en.tex 221 2011-11-13 18:03:29Z marco $ \setcounter{errorcontextlines}{999} -\documentclass[english,11pt,]{scrartcl} -%\usepackage{showframe} -\usepackage[nofancy,draft,notoday]{svninfo} -\svnInfo $Id: mdframed-doc-en.tex 209 2011-10-09 11:53:45Z marco $ +\documentclass[parskip=false,english,11pt]{ltxmdf} +\svnInfo $Id: mdframed-doc-en.tex 221 2011-11-13 18:03:29Z marco $ \usepackage{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lipsum} \usepackage[T1,altbullet]{lucidabr} \usepackage[scaled=0.82]{beramono} -%\usepackage{libertine} -\usepackage{microtype} -\usepackage[french=quotes]{csquotes} -%\let\glqq\flqq -%\let\grqq\frqq -\let\grqq\grqq - -\usepackage{scrpage2} -\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} - - -\usepackage[left=5cm,right=3cm,top=3cm,bottom=3cm]{geometry} -\usepackage{array,booktabs} - -\usepackage{xcolor} -\usepackage{tikz} -\usetikzlibrary{calc,backgrounds,arrows,matrix} - -\colorlet{titleblue}{blue!30!black} - -\usepackage{amsmath} -\usepackage[amsmath]{ntheorem} - -\usepackage[]{graphicx} - -\usepackage[style=1,]{mdframed} - - -\usepackage{xspace} -\usepackage{multicol} -\columnseprule0.4pt - - -\usepackage{listings} -\lstset{keywordstyle=\bfseries} -\lstnewenvironment{mdexample}[1][] - {\lstset{% - 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,needspace,mdf@globalstyle@cnt,framemethod},% - 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,defcounter}, - #1, - }% - }% -% morekeywords={\usepackage,\end,\begin,\lipsum,\documentclass,\newtheorem,\newenvironment,\section,\label\mbox{ }}% - {} -\makeatletter -\begingroup - \text@command\relax - \global\let\xspace@check@icr\check@icr -\endgroup -\xspaceaddexceptions{\xspace@check@icr} - -\renewcommand\tableofcontents{% -\setcounter{tocdepth}{2}% - \begin{multicols}{2}[\centering\textbf{\sffamily\Large\contentsname}] - \@starttoc{toc} - \end{multicols} -} -\makeatother -\newcommand*\mdoption[1]{\textsf{\bfseries\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\llap{% - \textsf{\bfseries\color{titleblue}#2}% - \quad}\mdDefault{#1}\ignorespaces} -\newcommand*{\mdDefault}[1]{% - \ifx\relax#1\relax\else\marginpar{\small\mdsetting{default=#1}}\fi} - -\newcommand*\mdDescribeCmd[2][]{\par\kern\baselineskip% - \noindent\llap{% - \textsf{\bfseries\color{titleblue}\textbackslash #2}% - \quad}{#1}\ignorespaces} - -\usepackage{hyperref} -\hypersetup{% -breaklinks=true, -pdftitle={Documenation of mdframed},% -pdfauthor={Marco Daniel},% -colorlinks=true,% -linkcolor=titleblue, -urlcolor=cyan, -bookmarksdepth=4, -} -%\usepackage{showframe} +\usepackage[framemethod=TikZ]{mdframed} -\newmdtheoremenv[linecolor=red]{lemma}{Lemma}[section] - -\begin{document} -\thispagestyle{empty} -\begin{center} - \color{titleblue} - \Large\bfseries \sffamily The \mdname package\footnote{Extending the package \texttt{framed.sty}.} - - \vspace*{0.5\baselineskip} - \normalfont\large\normalcolor auto-split frame environment - - \vspace*{.5\baselineskip} - \href{mailto:marco.daniel@mada-nada.de}{Marco Daniel}% +\title{The \mdname package\footnote{Extending the package \texttt{framed.sty}} +\subtitle{auto-split frame environment} +\author{\href{mailto:marco.daniel@mada-nada.de}{Marco Daniel}% \footnote{With thanks to Heiko Oberdiek, Rolf Niepraschk, - Martin Scharrer and Herbert Voss.\newline Sorry for bad English.}, - \href{mailto:marco.daniel@mada-nada.de}{Elke Schubert}% - \qquad \mdversion\ \qquad \today -\end{center} -\begin{abstract} -The standard methods for framing text (\mdcommand{fbox} or \mdcommand{fcolorbox}) require you to handle page breaks by hand, meaning that you have to split the \mdcommand{fbox} into two. The present package defines the environment \mdname which automatically deals with pagebreaks in framed text.\par -By defining new environments the user may choose between several individual designs. -\end{abstract} -\vspace*{2\baselineskip} + Martin Scharrer and Herbert Voss.\newline Sorry for bad English.} + \href{mailto:marco.daniel@mada-nada.de}{Elke Schubert}}} +\version{\mdversion} +\date{\svnToday} +\introduction{The standard methods for framing text (\mdcommand{fbox} or \mdcommand{fcolorbox}) require you to handle page breaks by hand, meaning that you have to split the \mdcommand{fbox} into two. The present package defines the environment \mdname which automatically deals with pagebreaks in framed text.\par +By defining new environments the user may choose between several individual designs.% +\par\kern.5\baselineskip\noindent +Linked files:\quad \begin{tabular}[t]{ll} + \url{mdframed-example-default.pdf} & + \url{mdframed-example-tikz.pdf} \\ + \url{mdframed-example-pstricks.pdf} & + \url{mdframed-example-texsx.pdf} + \end{tabular} +} -\pdfbookmark[1]{\contentsname}{tocbook} -\tableofcontents +\begin{document} +\maketitle + \section{Motivation} Many users wish to (further) emphasize lemmata, definitions, proofs, etc. The package \mdname allows you to create environments with breakable frames. I think an example is the best way to demonstrate its properties. @@ -180,7 +45,7 @@ Many users wish to (further) emphasize lemmata, definitions, proofs, etc. The pa \newmdtheoremenv[outerlinewidth=2,leftmargin=40,rightmargin=40,% backgroundcolor=yellow,outerlinecolor=blue,innertopmargin=0pt,% splittopskip=\topskip,skipbelow=\baselineskip,% - skipabove=\baselineskip,ntheorem]{theorem}{Theorem}[section] + skipabove=\baselineskip,ntheorem,roundcorner=5pt]{theorem}{Theorem}[section] \begin{theorem}[Pythagorean theorem] In any right triangle, the area of the square whose side is the hypotenuse @@ -205,7 +70,7 @@ The frame was defined with the following settings. \section{Syntax}\label{sec:syntax} -The package itself loads the packages \mdpack{kvoptions}, \mdpack{etoolbox}, \mdpack{calc} and \mdpack{color}. +The package itself loads the packages \mdpack{kvoptions}, \mdpack{etoolbox} and \mdpack{color}. By setting the correct options \mdpack{mdframed} will load \mdpack{xcolor}, \mdpack{tikz} or \mdpack{pstricks}. Load the package as usual: @@ -219,17 +84,17 @@ The package defines only one environment with the following syntax: <CONTENT> \end{mdframed} \end{mdexample} +To create own environments with \mdpack{mdframed} see section \ref{sec:cmds}. -With version 0.8 you have two commands to create environments with \mdpack{mdframed}. - -\mdDescribeMacro{autodetecting floats} -With version 0.9 I added a detection of \mdpack{float} or \mdpack{minipage} environments. If you use \mdname in such an environment \mdname will use the option \mdoption{nobreak} automaticlly. +\minisec{Autodetecting floats} +I added a detection of \mdpack{float} or \mdpack{minipage} environments. If you use \mdname in such an environment \mdname will use the option \mdoption{nobreak} automaticly. -\mdDescribeMacro{twoside-mode} With version 0.9d I added the detection of the \mdpack{twoside}. When you are using \mdname inside \mdpack{twoside} mode you have to set the option \mdoption{innermargin} +\minisec{Twoside-mode} +When you are using \mdname inside \mdpack{twoside} mode you can set the option \mdoption{innermargin} and \mdoption{outermargin} (see section \ref{optlength}). %%%%%%%%%%%%%%%%%%%%%%% -\section{Commands} +\section{Commands}\label{sec:cmds} The following commands should countenance your by the handling with \mdpack{mdframed} \mdDescribeCmd[]{newmdenv} The command has the following syntax: @@ -266,9 +131,9 @@ The last four arguments are equivalent to the command \mdcommand{newtheorem}. On So far there is no \mdcommand{renewmdtheoremenv}! -\mdDescribeMacro{\textbackslash mdfsetup}To set the options globally +\mdDescribeMacro{\textbackslash mdfsetup}To set the options you can use the optional argument of \mdcommand{usepackage} or -you can use the command \mdcommand{mdfsetup} which is not limited to the preamble. +you can use the command \mdcommand{mdfsetup} which is not limited to the preamble. Inside a group the command the settings work only local. \mdDescribeMacro{\textbackslash mdfdefinestyle} \mdcommand{mdfdefinestyle} allow the user to define diffenrent styles and use as an option of \mdpack{mdframed} via \mdoption{style}. The option \mdoption{style} is explained in section \ref{genopt}. @@ -282,13 +147,14 @@ foo \end{mdframed} \end{mdexample} - +\mdDescribeMacro{\textbackslash mdfapptodefinestyle} This commands allows to expand a defined style.\footnote{Thanks to Martin Scharrer and Enrico Gregorio:\newline \href{http://tex.stackexchange.com/questions/34684/argument-of-setkeys}{http://tex.stackexchange.com/questions/34684/argument-of-setkeys}} %%%%%%%%%%%%%%%%%%%%%%% \section{Options} -The package allows the following global and local options: +The packages provides various options to manipulate frames. In the following section all options are listed. Some internal macros which can be manipulated are not shown in this documentation. +The listed option are divided in global and local options. The global options can not be used inside \mdcommand{mdfsetup}. \subsection{Global Options}\label{globopt} The following options are only global options. @@ -296,7 +162,7 @@ The following options are only global options. \mdDescribeMacro[none]{xcolor} By setting this key, the package \mdpack{xcolor} will be loaded with the given value(s). Without any value \mbox{\mdname} loads -the package \mdpack{color} without any options. +the package \mdpack{color} without any options. If the package \mdpack{xcolor} is already loaded the given option will be ignored. I recommend to load \mdpack{xcolor} before \mdname. \mdDescribeMacro[default]{framemethod} With this key you can change the way frames are drawn. You can decide whether the frame is drawn with @@ -314,25 +180,27 @@ The option \mdoption{framemethod} requires a string. Allowed combination are lis \toprule \multicolumn{1}{@{}l}{\textbf{Method}} & \multicolumn{1}{l}{Allowed keys} \\\midrule \LaTeX-commands & default, tex, latex, none, 0 \\ -\mdpack{TikZ} & tikz, 1 \\ +\mdpack{TikZ} & tikz, pgf, 1 \\ \mdpack{PSTricks} & pstricks, ps, postscript, 2 \\\bottomrule \end{tabular} \end{table} \noindent{\small\textbf{FYI}\qquad It is independently whether the \texttt{method} is written with no, one or more capital letter.} -\noindent\textbf{Note}\qquad The manipulation of the frames depends on the option \mdoption{framemethod}. For further information see below. - - +\NOTE The manipulation of the frames depends on the option \mdoption{framemethod}. For further information see below. \subsection{Global and Local Options} -The options listed below can be set globally or locally. +The options listed below can be set globally or locally and they are not limited to the preamble. \subsubsection{Options with lengths}\label{optlength} In figure \eqref{fig:laengen} you can see the adjustable lengths which will be described below. All lengths accept two kinds of input. The first one is a length (e.g. 2pt) and the second one is a number (e.g. 2) which will be multiplied by \mdoption{1 defaultunit}. +The figure shows three different colored frames. Only \mdoption{framemethod=tikz} is able to draw such triple lines. + +I know that the predefined length are not well prepaired. Maybe I will change it later. + \mdDescribeMacro[pt]{defaultunit} see the sentence above. \begin{center} @@ -436,12 +304,14 @@ the second one is a number (e.g. 2) which will be multiplied by \mdoption{1 defa \mdDescribeMacro[10pt]{innerleftmargin} Sets the length of the inner left margin of the environment. \mdDescribeMacro[10pt]{innerrightmargin} Sets the length of the inner right margin of the environment. -\mdDescribeMacro[\newline.4\textbackslash baselineskip]{innertopmargin} Sets the length of the inner top margin of the environment. -\mdDescribeMacro[\newline.4\textbackslash baselineskip]{innerbottommargin} Sets the length of the inner bottom margin of the environment. +\mdDescribeMacro[.4\textbackslash baselineskip]{innertopmargin} Sets the length of the inner top margin of the environment. +\mdDescribeMacro[.4\textbackslash baselineskip]{innerbottommargin} Sets the length of the inner bottom margin of the environment. \paragraph*{The following lengths are not shown in figure \eqref{fig:laengen}.} \mbox{} +\mdDescribeMacro[0pt]{userdefinedwidth} Sets the width of the whole \mdname environment. The width represent the width including the line width and the inner margins. The outer margins will be ignored. + \mdDescribeMacro{outermargin} Sets the length of the outer margin. This option is only avaidable in \texttt{twoside}-mode. \mdDescribeMacro{innermargin} Sets the length of the inner margint. This option is only avaidable in \texttt{twoside}-mode. @@ -450,25 +320,22 @@ the second one is a number (e.g. 2) which will be multiplied by \mdoption{1 defa \mdDescribeMacro[0pt]{splitbottomskip} Sets the length of the skip below the splitt part of the environment. \mdDescribeMacro[0.4pt]{linewidth} Sets the width of the line around the environment. \mdDescribeMacro[0pt]{roundcorner} Sets the size of the radius of the corners of the frames. - \textbf{This works only with \mdoption{framemethod=TikZ} and \mdoption{framemethod=PSTricks}.} + \limitation\limitation[PSTricks] \mdDescribeMacro[0pt]{innerlinewidth} Sets the width of the inner line around the environment. - \textbf{This works only with \mdoption{framemethod=TikZ}.} + \limitation \mdDescribeMacro[0pt]{outerlinewidth} Sets the width of the outer line around the environment. - \textbf{This works only with \mdoption{framemethod=TikZ}.} -\mdDescribeMacro[\newline linewidth]{middlelinewidth} Sets the width of the middle line around the environment. - \textbf{This works only with \mdoption{framemethod=TikZ}.} + \limitation +\mdDescribeMacro[linewidth]{middlelinewidth} Sets the width of the middle line around the environment.\limitation \subsubsection{Colored Options} \mdDescribeMacro[black]{linecolor} Sets the color of the line around the environment. -\mdDescribeMacro[\newline linecolor]{innerlinecolor} Sets the color of the inner line around the environment. - \textbf{This works only with\mdoption{framemethod=TikZ}.} -\mdDescribeMacro[\newline linecolor]{middlelinecolor} Sets the color of the middle line around the environment. - \textbf{This works only with \mdoption{framemethod=TikZ}.} -\mdDescribeMacro[\newline linecolor]{outerlinecolor} Sets the color of the outer line around the environment. - \textbf{This works only with \mdoption{framemethod=TikZ}.} \mdDescribeMacro[white]{backgroundcolor} Sets the color of the background of the environment. \mdDescribeMacro[black]{fontcolor} Sets the color of the contents of the environment. +\mdDescribeMacro[linecolor]{innerlinecolor} Sets the color of the inner line around the environment. + \limitation +\mdDescribeMacro[\newline linecolor]{middlelinecolor} Sets the color of the middle line around the environment. \limitation +\mdDescribeMacro[\newline linecolor]{outerlinecolor} Sets the color of the outer line around the environment.\limitation \subsubsection{General options}\label{genopt} @@ -489,15 +356,28 @@ the second one is a number (e.g. 2) which will be multiplied by \mdoption{1 defa %\mdDescribeMacro[none]{printheight} This key allows the entries \texttt{none}, \texttt{info} or \texttt{warning}. In relation to the key the vertical space at the beginning of the environment \mdname on the current page will be printed in the \texttt{log} file. +\mdDescribeMacro[left]{align} Sometimes it is usefull to align the environment it selfs. For this you have the option \mdoption{align} which can be set to the following strings: \mdoption{left}, \mdoption{right} and \mdoption{center}. The alignments \mdoption{left} or \mdoption{right} depend on the given lenght \mdoption{leftmargin} and \mdoption{rightmargin}. Later I will present an example to demonstrate my bad English explanation. \mdDescribeMacro[none]{pstrickssetting} With this key you can pass several options to \mdcommand{psset}. For example if you want all lines dashed you will have to set \mdoption{pstrickssetting=\{linestyle=dashed\}}. It is very important to put the options of \mdoption{pstrickssetting} in brackets. - \textbf{This works only with \mdoption{framemethod=PSTricks}.} + \limitation[PSTricks] \mdDescribeMacro[none]{tikzsetting} With this key you can pass several options to \mdcommand{tikzset}. Some examples are listed in the next section. It is very important to put the options of \mdoption{tikzsetting} in brackets. - \textbf{This works only with \mdoption{framemethod=TikZ}.} + \limitation + +\mdDescribeMacro[none]{apptotikzsetting} With this key you can add several options to \mdoption{tikzsetting}. This key based on the idea of manipulation of predefined keys of \mdname. +The package \mdname define via \mdcommand{tikzset} the following keys to draw frames. +\begin{itemize} + \item \mdcommand{tikzset\{mdfbox/.style\}} + \item \mdcommand{tikzset\{mdfcorners./style\}} + \item \mdcommand{tikzset\{mdfbackground./style\}} + \item \mdcommand{tikzset\{mdfinnerline./style\}} + \item \mdcommand{tikzset\{mdfouterline./style\}} + \item \mdcommand{tikzset\{mdfmiddleline./style\}} +\end{itemize} +\textbf{Before you change one please have a look at the file \texttt{md-frame-1.mdf} to see the settings.}\limitation \subsection{Hidden Lines} @@ -527,93 +407,23 @@ Every footnote text will be collect inside a box and will be displayed at the en \vskip\baselineskip \noindent\textbf{Note}\qquad The ouput of the footnotes with the option \mdoption{footnoteinside=false} are not in a splitted frame. I think it isn't useful because the first line of a new page shouldn't be a footnote. - \section{Examples} -Now I present some examples. Of course I know that some of them are only gimmicks. To create the following examples I am using \mdoption{framemethod=TikZ}. -\mdfsetup{skipabove=\baselineskip,skipbelow=\baselineskip} -\begin{mdexample} -\mdfsetup{outerlinewidth=5pt,innerlinewidth=0pt, - outerlinecolor=red,roundcorner=5pt} -\end{mdexample} -\begin{mdframed}[outerlinewidth=5pt,innerlinewidth=0pt,outerlinecolor=red,roundcorner=5pt] -Some Text Some Text Some Text Some Text Some Text Some Text -Some Text Some Text Some Text Some Text Some Text Some Text -Some Text Some Text Some Text Some Text Some Text Some Text -Some Text Some Text Some Text Some Text Some Text Some Text -Some Text Some Text Some Text Some Text Some Text Some Text -\end{mdframed} - -Now I will add the next options -\begin{mdexample} -\mdfsetup{topline=false,leftline=false,} -\end{mdexample} -\begin{mdframed}[topline=false,leftline=false,outerlinewidth=5pt,innerlinewidth=0pt,outerlinecolor=red,roundcorner=5pt] -Some Text Some Text Some Text Some Text Some Text Some Text -Some Text Some Text Some Text Some Text Some Text Some Text -Some Text Some Text Some Text Some Text Some Text Some Text -Some Text Some Text Some Text Some Text Some Text Some Text -Some Text Some Text Some Text Some Text Some Text Some Text -\end{mdframed} - -Gimmick: -\begin{mdexample} -\mdfsetup{splitbottomskip=0.8cm,splittopskip=0cm, - innerrightmargin=2cm,innertopmargin=1cm,% - innerlinewidth=2pt,outerlinewidth=2pt, - middlelinewidth=10pt,backgroundcolor=red, - linecolor=blue,middlelinecolor=gray, - tikzsetting={draw=yellow,line width=3pt,% - dashed,% - dash pattern= on 10pt off 3pt}, - rightline=false,bottomline=false} -\end{mdexample} - -\begin{mdframed}[splitbottomskip=0.8cm,splittopskip=0cm, - innerrightmargin=2cm,innertopmargin=1cm,% - innerlinewidth=2pt,outerlinewidth=2pt, - middlelinewidth=10pt,backgroundcolor=red, - linecolor=blue,middlelinecolor=gray, - tikzsetting={draw=yellow,line width=3pt,dashed,dash pattern= on 10pt off 3pt}, - rightline=false, - bottomline=false] -Some Text Some Text Some Text Some Text Some Text Some Text -Some Text Some Text Some Text Some Text Some Text Some Text -Some Text Some Text Some Text Some Text Some Text Some Text -Some Text Some Text Some Text Some Text Some Text Some Text -Some Text Some Text Some Text Some Text Some Text Some Text -\end{mdframed} -\clearpage -\twocolumn[\subsection{Working in twocolumn mode}] -\lipsum[1] -\begin{mdframed}[leftmargin=10pt,rightmargin=10pt,outerlinecolor=blue,outerlinewidth=5pt,backgroundcolor=yellow] -\lipsum[1] -\end{mdframed} -Some Text Some Text Some Text Some Text Some Text Some Text -%Some Text Some Text Some Text Some Text Some Text Some Text -%Some Text Some Text Some Text Some Text Some Text Some Text -\clearpage -\onecolumn -\subsection{Framed \texttt{listings}} -The example below is inspired by the following post on StackExchange \href{http://tex.stackexchange.com/questions/27673/background-overflows-when-using-rounded-corners-for-listings-package-listings}{Background overflows when using rounded corners for listings (package: `listings`)} - -Here the solution which can be decorate as usual. - -\begin{mdexample}[moretexcs={BeforeBeginEnvironment,AfterEndEnvironment},morekeywords={lstlisting}] -\BeforeBeginEnvironment{lstlisting}{% - \begin{mdframed}[<modification>]% - \vspace{-0.7em}} -\AfterEndEnvironment{lstlisting}{% - \vspace{-0.5em}% - \end{mdframed}} -\end{mdexample} +I outsource the examples in four files to limited the documentation. The files are +\begin{description}[style=nextline] +\item[\texttt{mdframed-example-default}] Demonstration of examples created with \mdoption{framemethod=default}. +\item[\texttt{mdframed-example-tikz}] Demonstration of examples created with \mdoption{framemethod=TikZ}. +\item[\texttt{mdframed-example-pstricks}] Demonstration of examples created with \mdoption{framemethod=pstricks}. +\item[\texttt{mdframed-example-texsx}] Demonstration of examples like interaction with \mdpack{listings} +\end{description} +The examples are often not equivalent but normally they can be adapted to another method. \section{Errors, Warnings and Messages} The package \mdpack{mdframed} provides different errors, warnings and messages in the \texttt{log}-file. Some \LaTeX-editors like -\TeX Maker(X) have a special tab for errors and warnings +\TeX Maker or \TeX Studio have a special tab for errors and warnings but not for messages. So you should look in the \texttt{log-File} itself. The followings errors and warnings are generated by \mdpack{mdframed}. @@ -707,6 +517,7 @@ body you will get this warning. \item Improve page breaks. \item Improve footnotes \item Improve documentation and create a separate pdf with examples + \item Create styles for frame title \end{enumerate} \section{Previous versions} @@ -839,190 +650,100 @@ To create only a line at the left with the correct \mdoption{leftmargin} you can In this way you can do what you want. If you create your own style you can save the file as \mdpack{md-frame-X.mdf}. \mdpack{X} must be an integer. -In this way you can use the option \mdoption{style} to -load the file by setting \mdoption{style=X}. +In this way you can use the option \mdoption{framemethod} to +load the file by setting \mdoption{framemethod=X}. \clearpage -\subsection{Modify the frame} - -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} - -First I will show the the result. -\makeatletter -\newlength{\interruptlength} -\setlength{\interruptlength}{2.5ex} -\newrobustcmd\overlaplines{% - \input{md-frame-0.mdf}% - \global\defcounter{mdf@globalstyle@cnt}{0} - \appto\md@frame@leftline@single{% - \llap{\color{white}% - \rule[-\dp\@tempboxa-\mdf@innerbottommargin@length% - -\mdf@middlelinewidth@length+\interruptlength]% - {\mdf@middlelinewidth@length}% - {\mdfboundingboxheight% - +2\mdf@middlelinewidth@length - -2\interruptlength}% - }% - }% - \appto\md@frame@rightline@single{% - \rlap{\color{white}% - \hspace*{\mdfboundingboxwidth}% - \hspace*{\mdf@innerrightmargin@length}% - \rule[-\dp\@tempboxa-\mdf@innerbottommargin@length% - -\mdf@middlelinewidth@length+\interruptlength]% - {\mdf@middlelinewidth@length} - {\mdfboundingboxheight% - +2\mdf@middlelinewidth@length% - -2\interruptlength}% - }% - }% -} -\overlaplines -\newmdtheoremenv[style=0,ntheorem,linecolor=blue,linewidth=2pt]{lem}{Lemma}[section] -\makeatother - - -\begin{lem} -\lipsum[1] -\end{lem} -You can see how the lines on the left and the right are interrupted. Now I will show the code. -I define a command which draws white lines on the left and the right side in the same way as in the style file. For this example I must include the file \texttt{md-frame-1.mdf} because this document used the global style 1. - -With the new length \mdcommand{interruptlength} you can manipulate the amount of overlap. - -\begin{mdexample} -\newlength{\interruptlength} -\setlength{\interruptlength}{1.5ex} -\makeatletter -\newlength{\interruptlength} -\setlength{\interruptlength}{2.5ex} -\newrobustcmd\overlaplines{% - \input{md-frame-0.mdf}% - \global\defcounter{mdf@globalstyle@cnt}{0} - \appto\md@frame@leftline@single{% - \llap{\color{white}% - \rule[-\dp\@tempboxa - -\mdf@innerbottommargin@length% - -\mdf@middlelinewidth@length - +\interruptlength]% - {\mdf@middlelinewidth@length}% - {\mdfboundingboxheight% - +2\mdf@middlelinewidth@length - -2\interruptlength}% - }% - }% - \appto\md@frame@rightline@single{% - \rlap{\color{white}% - \hspace*{\mdfboundingboxwidth}% - \hspace*{\mdf@innerrightmargin@length}% - \rule[-\dp\@tempboxa - -\mdf@innerbottommargin@length% - -\mdf@middlelinewidth@length - +\interruptlength]% - {\mdf@middlelinewidth@length} - {\mdfboundingboxheight% - +2\mdf@middlelinewidth@length% - -2\interruptlength}% - }% - }% -} -\overlaplines -\newmdtheoremenv[style=0,ntheorem,linecolor=blue,% - linewidth=10pt]{lem}{Lemma}[section] -\makeatother -\end{mdexample} +%\clearpage +\subsection{Revision history}\label{rev} +\raggedright +\minisec{Version 1.0 submitted 13 Nov 2011} +\begin{itemize*} +\item add option \mdoption{userdefinedwidth} +\item add option \mdoption{align} +\item add option \mdoption{apptotikzsetting} +\item create new command \mdcommand{mdfapptodefinestyle} +\item changed internal algorithm +\item removed calc instead using \eTeX\ \verb+\dimexpr+ +\item expand documentation +\item trying to fixe problems with \mdpack{xcolor} +\item fixed bug with \mdoption{framemethod=pstricks} +\item create file \mdpack{mdframed-example-default} +\item create file \mdpack{mdframed-example-tikz} +\item create file \mdpack{mdframed-example-pstricks} +\item create file \mdpack{mdframed-example-texsx} (texsx stands for tex stackexchange) +\end{itemize*} -\subsection{\mdname in combination with \mdpack{multicol}} -How I wrote in \glqq Known Problems\grqq\ you can't combine \mdpack{multicol} with \mdname. In a simple way without any breaks you can use: -\begin{mdexample}[moretexcs={lipsum},morekeywords={lipsum,multicols}] -\begin{multicols}{2} -\lipsum[1] -\begin{mdframed} -Text\par Text\par Text -\end{mdframed} -\lipsum[2] -\end{multicols} -\end{mdexample} -\begin{multicols}{2} -\lipsum[1] -\begin{mdframed} -Text\par Text\par Text -\end{mdframed} -\lipsum[2] -\end{multicols} -%\clearpage -\twocolumn[\subsection{Revision history}\label{rev}] -\setkomafont{subsubsection}{\normalfont\bfseries} -\small\raggedright +\footnotesize \minisec{Version 0.9g submitted 08 Oct 2011} -\begin{itemize} +\begin{itemize*} \item fixed documentation \item added small footnote compatibility -\end{itemize} +\end{itemize*} \minisec{Version 0.9f submitted 04 Oct 2011} -\begin{itemize} +\begin{itemize*} \item fixes bugs (thanks to Lars Madsen) \item added option \mdoption{hidealllines} \item fixed documentation -\end{itemize} +\end{itemize*} \minisec{Version 0.9e submitted 11 Sep 2011} -\begin{itemize} +\begin{itemize*} \item working with \texttt{twoside} modus -\end{itemize} +\end{itemize*} \minisec{Version 0.9d submitted 10 Sep 2011} -\begin{itemize} +\begin{itemize*} \item \textcolor{red}{changed the meaning of the option \mdoption{style}}!!! (inspired by Lars Madsen) \item added option \mdoption{framemethod} (inspired by Lars Madsen) \item added options \mdoption{needspace} (inspired by Lars Madsen) \item added new command \mdcommand{mdfdefinestyle} (inspired by Lars Madsen) \item fixes documentation \item renamed \mdpack{md-frame-3.mdf} to \mdpack{md-frame-2.mdf} -\end{itemize} +\end{itemize*} + -\footnotesize \minisec{Version 0.9b submitted 7 Sep 2011} -\begin{itemize} +\begin{itemize*} \item fixes bugs in \mdcommand{newmdtheoremenv} (Thanks to Enrico Gregorio) -\end{itemize} +\end{itemize*} \minisec{Version 0.9a submitted 5 Sep 2011} -\begin{itemize} +\begin{itemize*} \item fixes bugs (Thanks to Lars Madson) \item expanded documentation (added revision history) -\end{itemize} +\end{itemize*} \minisec{Version 0.9 submitted 4 Sep 2011} -\begin{itemize} +\begin{itemize*} \item added option \mdoption{nobreak} \item detecting float environments to prevent split calculation \item expand documentation (Thanks to Alan Munn) -\end{itemize} +\end{itemize*} \minisec{Version 0.8a} -\begin{itemize} +\begin{itemize*} \item fixes bugs \item fixes documentation -\end{itemize} +\end{itemize*} \minisec{Version 0.8 submitted 22 Aug 2011} -\begin{itemize} +\begin{itemize*} \item added commands: \mdcommand{newmdenv}, \mdcommand{renewmdenv}, \mdcommand{newmdtheoremenv} \item fixes bugs \item fixes documentation -\end{itemize} +\end{itemize*} \minisec{Version 0.7a submitted 6 August 2011} -\begin{itemize} +\begin{itemize*} \item added option \mdoption{frametitle} \item added option \mdoption{frametitlefont} \item allow twolumn-mode @@ -1030,17 +751,19 @@ Text\par Text\par Text \item added option \mdoption{tikzsetting} \item added options for hidden lines for all styles \item fixes bugs -\end{itemize} +\end{itemize*} \minisec{Version 0.6a submitted 22 Dec 2010} -\begin{itemize} +\begin{itemize*} \item fixes bugs \item added \mdcommand{mdfsetup} \item expanded documentation -\end{itemize} +\end{itemize*} + + \minisec{Version 0.6 submitted 18 Dec 2010} -\begin{itemize} +\begin{itemize*} \item added \mdoption{style=3} with \mdpack{pstricks} \item added option \mdoption{pstrickssetting} \item added option \mdoption{splitbottomskip} @@ -1048,34 +771,34 @@ Text\par Text\par Text \item added options for hidden lines \item changed the calculation \item fixes bugs -\end{itemize} +\end{itemize*} \minisec{Version 0.4a submitted 14 May 2010} -\begin{itemize} +\begin{itemize*} \item fixes bug in fontcolor -\end{itemize} +\end{itemize*} \minisec{Version 0.4 submitted 13 May 2010} -\begin{itemize} +\begin{itemize*} \item Elke Schubert creates style file for \mdpack{tikz} \item fixes some bugs -- calculation of the page dimen (thanks Dick Nickalls) \item using tikz for the frame with different styles -\end{itemize} +\end{itemize*} \minisec{Version 0.3b submitted 1 May 2010} -\begin{itemize} +\begin{itemize*} \item fixes some bugs -- thanks to Dietrich Grau \item added new options: \mdoption{ntheorem} -\end{itemize} +\end{itemize*} \minisec{Version 0.3a submitted 23 Apr 2010} -\begin{itemize} +\begin{itemize*} \item added new options: \mdoption{leftmargin} and \mdoption{rightmargin} \item fixes some bugs -\end{itemize} +\end{itemize*} \minisec{Version 0.3 submitted16 Apr 2010} -\begin{itemize} +\begin{itemize*} \item first upload to \href{http://dante.ctan.org/upload}{CTAN} -\end{itemize} +\end{itemize*} \end{document} |