summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/blockdraw_mp
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-11-06 19:39:24 +0000
committerKarl Berry <karl@freefriends.org>2007-11-06 19:39:24 +0000
commit647ffa0224624c3d97c119efaef5191bdaff3067 (patch)
treed2103bd9f56be6d93b9f879e263380c802709a88 /Master/texmf-dist/doc/metapost/blockdraw_mp
parent59d409e3e827d1630055bbbb9a2606005b1f035c (diff)
new metapost package blockdraw_mp (22jan07)
git-svn-id: svn://tug.org/texlive/trunk@5381 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/metapost/blockdraw_mp')
-rw-r--r--Master/texmf-dist/doc/metapost/blockdraw_mp/README54
-rw-r--r--Master/texmf-dist/doc/metapost/blockdraw_mp/blockdraw_mp.pdfbin0 -> 288114 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/blockdraw_mp/blockdraw_mp.tex266
-rw-r--r--Master/texmf-dist/doc/metapost/blockdraw_mp/bonddemo.pdfbin0 -> 17522 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/blockdraw_mp/cascadedemo.pdfbin0 -> 12780 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/blockdraw_mp/tiddetext.sty71
-rw-r--r--Master/texmf-dist/doc/metapost/blockdraw_mp/tighttoc.sty64
7 files changed, 455 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/metapost/blockdraw_mp/README b/Master/texmf-dist/doc/metapost/blockdraw_mp/README
new file mode 100644
index 00000000000..3364dcd1bb9
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/blockdraw_mp/README
@@ -0,0 +1,54 @@
+The blockdraw_mp package
+========================
+
+This material is subject to the LaTeX Project Public License. See
+http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html
+for the details of that license.
+
+History
+-------
+o Submitted to CTAN: 2006-03-08
+ - First submission.
+o Updated 2006-07-18
+ - Added documentation sources and created separate sub-directories
+ for the implementation and documentation.
+o Updated 2007-01-21 (Backward incompatible changes for bond graphs.)
+ - Bond graphs can be drawn with arrowheads that are not filled.
+ - Bond graph labels that depend on the LaTeX preamble have been
+ removed from the bond graph package file, and must now be defined
+ in every bond graph application source.
+ - See further comments in bondgraph.mp, and how the changes affect
+ the example bonddemo.mp.
+ - Thanks to Johan Engelen for suggesting added features and bringing
+ my attention to the problem of preamble-dependent content in package
+ files.
+
+Description
+-----------
+This package targets the simple problem of producing block diagrams
+and bond graphs. In more detail, the provided functionality can be
+divided into
+o Standard elements such as labeled blocks and bond graph arrows.
+o Standardized way for selecting input and output points on blocks.
+o Means for the construction of "carpented" paths connecting points.
+o Standardized label positioning along block connections.
+o Higher-level macros that specialize and/or combine some of the above.
+
+An important example from the group of higher-level macros is the
+macro that takes two blocks as arguments and generates a path connecting
+them.
+
+Experienced MetaPost users will certainly prefer to write their own
+macros for this purpose, but less experienced users may find these
+simple macros accessible and handy in combination with the series
+of examples provided on the WWW (see below).
+
+Further information
+-------------------
+The main source of information for this package is located at
+ http://www.control.isy.liu.se/~tidefelt/projects/blockdraw/
+
+
+Please let me know if you run into problems or have suggestions,
+
+Henrik Tidefelt
diff --git a/Master/texmf-dist/doc/metapost/blockdraw_mp/blockdraw_mp.pdf b/Master/texmf-dist/doc/metapost/blockdraw_mp/blockdraw_mp.pdf
new file mode 100644
index 00000000000..2bca3b8c1c0
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/blockdraw_mp/blockdraw_mp.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/blockdraw_mp/blockdraw_mp.tex b/Master/texmf-dist/doc/metapost/blockdraw_mp/blockdraw_mp.tex
new file mode 100644
index 00000000000..81c36bdb872
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/blockdraw_mp/blockdraw_mp.tex
@@ -0,0 +1,266 @@
+\documentclass{ltxdoc}
+
+\usepackage[bookmarks,colorlinks,pdfauthor={Henrik Tidefelt},pdftitle={blockdraw_mp}]{hyperref}
+\usepackage[american]{babel}
+\usepackage{lmodern}
+\usepackage[T1]{fontenc}
+\usepackage[latin1]{inputenc}
+\usepackage{graphicx}
+\usepackage{tiddetext}
+\usepackage[squaren]{SIunits}
+\usepackage[labelsep=period,font={small,sl}]{caption}
+\usepackage[2ex]{tighttoc} % must be loaded before parskip!
+\usepackage{parskip}
+\usepackage[addtotoc]{abstract}
+
+\title{The \emph{blockdraw\_{}mp} package\\
+{\large MetaPost macros for the creation of block diagrams and bond graphs}}
+\author{Henrik Tidefelt\\
+{\small tidefelt@isy.liu.se}}
+
+\begin{document}
+\maketitle
+
+\begin{abstract}
+This is not the right place to motivate why MetaPost should be used for the production of technical illustrations, in particular those to be used in material produced using \LaTeX{}. Block diagrams are no exception since consistent layout of blocks, arrangement of connections, formatting of labels, placement of labels, et~c{} are such demanding tasks. This package provides macros that facilitate the drawing of block diagrams using MetaPost. To extend the capabilities to bond graphs is a small step, and such macros are also included in this package.
+
+This document describes the package, but is not the main manual. However, the $2$-sided appendix starting on an odd page may be used on its own as a reference sheet.
+\end{abstract}
+
+\tableofcontents
+
+\newpage
+
+\section{Motivation}%
+%
+The pdf format has several advantages to PostScript, perhaps most importantly that previewers for pdf are more generally available and of better quality. This is obviously the reason why there is pdf(La)\TeX{}. However, one problem for some potential pdf(La)\TeX{} users is that the psfrag package is not compatible with pdf(La)\TeX{}. On the other hand, since psfrag is not the most convenient way of putting good looking labels in a figure anyway, alternatives should be welcome. The drawing-language MetaPost is a powerful option for those who do not fear the expressiveness of text-based computer languages. This packages provide macros that facilitate the drawing of block diagrams and bond graphs in MetaPost. Two examples are given in \figuresref{demo1} and~\fgref{demo2}.
+
+Also the user who have no experience of MetaPost but needs a way to draw nice block diagrams without too much effort should consider using this package, because it might well be worthwhile to learn the few necessary bits of MetaPost. This typically amounts to looking at a few examples, learning how to invoke the MetaPost interpreter, and get acquainted with the \emph{MetaPost output} format.
+
+\begin{figure}[tbp]
+ \fglabel{demo1}
+ \centering
+ \includegraphics{cascadedemo}
+ \caption{Example figure: block diagram.}
+\end{figure}
+
+\begin{figure}[tbp]
+ \fglabel{demo2}
+ \centering
+ \includegraphics{bonddemo}
+ \caption{Example figure: bond graph.}
+\end{figure}
+
+
+\section{The Full Name}%
+%
+Although the main implementation file of this package is called \emph{blockdraw.mp}, the package has not been given the name \emph{blockdraw}. The full name of the package is precisely \emph{blockdraw\_{}mp}, and the reason for this is that the idea of drawing block diagrams with abstractions like those of this package can easily be, have been, and will be implemented in other languages than the presently targeted language MetaPost. For example, the implementation\footnote{%
+Note that it is not a well defined language that is implemented, but merely an idea of how to organize the drawing of block diagrams.
+} % The preceding whitespace matters to LaTeX!
+I have been using mostly myself was for the language Drool (written by the author, not yet published). Nevertheless, the present implementation have been used successfully by several others, and support have been provided whenever asked for. Hence, although I am not a user of the package myself, I am convinced that it is truly useful.
+
+\section{This Document and the WWW-Based Documentation}%
+%
+The documentation provided in the appendix is meant to be only a brief summary of the variables and macros defined by the MetaPost-hosted package for drawing block diagrams and bond graphs. Details, illustrations, and examples can be found in the WWW-based documentation, currently available at \href{http://www.control.isy.liu.se/~tidefelt/projects/blockdraw/}{http://www.control.isy.liu.se/$\sim$tidefelt/projects/blockdraw/}. Still, the appendix might be useful as a reference sheet.
+
+\section{Files}%
+%
+The implementation consists of three files, which are located in the \emph{implementation} directory:
+\begin{itemize}
+\item \emph{shiftoff.mp} contains general-purpose macros for placing objects relative to a point. This file is included from \emph{blockdraw.mp}.
+\item \emph{blockdraw.mp} contains the things that are specific to drawing block diagrams.
+\item \emph{bondgraph.mp} contains additional macros that are useful when drawing bond graphs.
+\end{itemize}
+
+The documentation and the sources needed to compile it are located in the \emph{documentation} directory:
+\begin{itemize}
+\item \emph{blockdraw\_mp.tex} is the source of this document.
+\item \emph{blockdraw\_mp.pdf}
+\item \emph{tiddetext.sty} contains various macros used.
+\item \emph{tighttoc.sty} is my ugly solution to make the table of contents consume less vertical space. Perhaps someone would like to have a look at it and make it a proper package\ldots
+\item \emph{cascadedemo.mp} is the source of the first demo figure.
+\item \emph{cascadedemo.pdf}
+\item \emph{bonddemo.mp} is the source of the second demo figure.
+\item \emph{bonddemo.pdf}
+\item \emph{docblockprefs.mp} is a file with settings to be used in block diagrams produces for this document. (Currently, there is only one such figure. A similar file could be creaded for bond diagrams to further emphasize how settings should be factored out in separate files, but I didn't just for brevity.)
+\end{itemize}
+
+% Make sure that the appendix starts at an odd page, so that it can be printed selectively.
+\newpage
+~\\
+\newpage
+
+\appendix
+
+\scriptsize
+
+\section{Miscellaneous macros}
+
+\begin{center}
+ \begin{tabular}{l c p{5cm}}
+ \hline
+ \textbf{Name} & \textbf{Argument list} & \textbf{Description} \\
+ \hline
+ \hline
+ \funname{mspoint} & ( \varname{con}, \varname{mediation}, \varname{slide} ) & Alternative to \texttt{point\ldots of\ldots}. \\
+ \funname{to\_{}dir} & ( \varname{pt} ) & (Low-level) Converts a direction vector to a direction constant. \\
+ \funname{dir\_{}to} & ( \varname{dir} ) & (Low-level) Converts a direction constant to a direction unit vector. \\
+ \funname{shiftoff} & ( \varname{pic}, \varname{corner} ) & Places \varname{pic} relative to the origin, according to \varname{corner} which shall be a direction constant (see below). \\
+ \funname{shiftoffwlm} & ( \varname{pic}, \varname{corner} ) & Like \funname{shiftoff}, but with ``label margin''. \\
+ \hline
+ \end{tabular}
+\end{center}
+
+\section{Block macros}
+
+\begin{center}
+ \begin{tabular}{l c p{5cm}}
+ \hline
+ \textbf{Name} & \textbf{Argument list} & \textbf{Description} \\
+ \hline
+ \hline
+ \funname{sizedblock} & ( \varname{pict}, \varname{center}, \varname{rx}, \varname{ry} ) & For subsystems of explicitly specified size. \\
+ \funname{longblock} & ( \varname{pict}, \varname{center} ) & For subsystems. \\
+ \funname{squareblock} & ( \varname{pict}, \varname{center} ) & For simple subsystems. \\
+ \funname{roundblock} & ( \varname{pict}, \varname{center} ) & For, for example, summations. \\
+ \funname{splitdot} & ( \varname{center} ) & A split point, drawn as a dot. \\
+ \funname{termcircle} & ( \varname{center} ) & A connection/terminal point, drawn as a small circle. \\
+ \funname{pointpicture} & ( \varname{center} ) & A <typename>picture</typename> that only serves to define a coordinate pair. \\
+ \funname{conlabel} & ( \varname{shiftdir}, \varname{pict}, \varname{z} ) & Similar to \funname{label}, but honors the \varname{textscale} setting. \\
+ \end{tabular}
+\end{center}
+
+\section{Point macros}
+
+\begin{center}
+ \begin{tabular}{l c p{5cm}}
+ \hline
+ \textbf{Name} & \textbf{Argument list} & \textbf{Description} \\
+ \hline
+ \hline
+ \funname{leftpoint} & ( \varname{pict}, \varname{total}, \varname{index} ) & For connections on the left side. \\
+ \funname{rightpoint} & ( \varname{pict}, \varname{total}, \varname{index} ) & For connections on the right side. \\
+ \funname{bottompoint} & ( \varname{pict}, \varname{total}, \varname{index} ) & For connections on the bottom side. \\
+ \funname{toppoint} & ( \varname{pict}, \varname{total}, \varname{index} ) & For connections on the top side. \\
+ \end{tabular}
+\end{center}
+
+\section{Connection macros}
+
+\begin{center}
+ \begin{tabular}{l c p{5cm}}
+ \hline
+ \textbf{Name} & \textbf{Argument list} & \textbf{Description} \\
+ \hline
+ \hline
+ \funname{hhconnect} & ( \varname{point1}, \varname{point2}, \varname{mediation}, \varname{slide} ) & For horizontal to horizontal connections. \\
+ \funname{vvconnect} & ( \varname{point1}, \varname{point2}, \varname{mediation}, \varname{slide} ) & For vertical to vertical connections. \\
+ \funname{hvconnect} & ( \varname{point1}, \varname{point2} ) & For horizontal to vertical connections. \\
+ \funname{vhconnect} & ( \varname{point1}, \varname{point2} ) & For vertical to horizontal connections. \\
+ \funname{connect} & ( \varname{pict1}, \varname{pict2} ) & Automatic side to automatic side. \\
+ \funname{lrconnect} & ( \varname{pict1}, \varname{pict2} ) & Left side to right side. \\
+ \funname{rlconnect} & ( \varname{pict1}, \varname{pict2} ) & Right side to left side. \\
+ \funname{btconnect} & ( \varname{pict1}, \varname{pict2} ) & Bottom side to top side. \\
+ \funname{tbconnect} & ( \varname{pict1}, \varname{pict2} ) & Top side to bottom side. \\
+ \funname{ltconnect} & ( \varname{pict1}, \varname{pict2} ) & Left side to top side. \\
+ \funname{lbconnect} & ( \varname{pict1}, \varname{pict2} ) & Left side to bottom side. \\
+ \funname{rtconnect} & ( \varname{pict1}, \varname{pict2} ) & Right side to top side. \\
+ \funname{rbconnect} & ( \varname{pict1}, \varname{pict2} ) & Right side to bottom side. \\
+ \funname{tlconnect} & ( \varname{pict1}, \varname{pict2} ) & Top side to left side. \\
+ \funname{trconnect} & ( \varname{pict1}, \varname{pict2} ) & Top side to right side. \\
+ \funname{blconnect} & ( \varname{pict1}, \varname{pict2} ) & Bottom side to left side. \\
+ \funname{brconnect} & ( \varname{pict1}, \varname{pict2} ) & Bottom side to right side. \\
+ \funname{llconnect} & ( \varname{pict1}, \varname{pict2}, \varname{slide} ) & Left side to left side. \\
+ \funname{rrconnect} & ( \varname{pict1}, \varname{pict2}, \varname{slide} ) & Right side to right side. \\
+ \funname{bbconnect} & ( \varname{pict1}, \varname{pict2}, \varname{slide} ) & Bottom side to bottom side. \\
+ \funname{ttconnect} & ( \varname{pict1}, \varname{pict2}, \varname{slide} ) & Top side to top side. \\
+ \end{tabular}
+\end{center}
+
+\section{Bond graph macros}%
+%
+The macros \funname{junction} and \funname{junctionlbl} should only be used in the definitions of specialized macros such as \funname{sjunction} and \funname{tfjunction}.
+
+\begin{center}
+ \begin{tabular}{l c p{5cm}}
+ \hline
+ \textbf{Name} & \textbf{Argument list} & \textbf{Description} \\
+ \hline
+ \hline
+ \funname{junction} & ( \varname{symbol}, \varname{center} ) & Generic junction without parameter. \\
+ \funname{junctionlbl} & ( \varname{symbol}, \varname{arrowdir}, \varname{lbl}, \varname{center}, \varname{drawarrow} ) & Generic junction with parameter. \\
+ \funname{terminal} & ( \varname{shiftdir}, \varname{pict}, \varname{point} ) & Terminal elements. \\
+ \funname{bgconnect} & ( \varname{pica}, \varname{picb} ) & Returns straight path from \varname{pica} to \varname{picb}, assuming that both pictures are circular with radii \varname{smallblockr}. This is similar to the macro \funname{connect} (documented <a href="../connections/">here</a>), which return paths with carpented segments. \\
+ \funname{bond} & ( \varname{pth} ) & Draws the half-arrow. \\
+ \funname{causalmark} & ( \varname{pth}, \varname{where} ) & Draws the causality mark. \varname{where} is a path time, and shall be 0 for the tail and infinity for the head. \\
+ \funname{tbond} & ( \varname{pth} ) & Draws the half-arrow and a causality mark at the tail. \\
+ \funname{hbond} & ( \varname{pth} ) & Draws the half-arrow and a causality mark at the head. \\
+ \funname{terminalto} & ( \varname{jct}, \varname{pict}, \varname{point} ) & Connection points to the junction. \\
+ \funname{terminalfr} & ( \varname{jct}, \varname{pict}, \varname{point} ) & Connection points to the junction. \\
+ \funname{effortlabel} & ( \varname{pth}, \varname{pict} ) & Puts the label (\varname{pict}) on the effort side of the path \varname{pth}. \\
+ \funname{flowlabel} & ( \varname{pth}, \varname{pict} ) & Puts the label (\varname{pict}) on the flow side of the path \varname{pth}. \\
+ \hline
+ \end{tabular}
+\end{center}
+
+\section{Standard user junction definitions}%
+%
+A bond graph application source file should define junction macros compatible with the following table.
+\begin{center}
+ \begin{tabular}{l c p{5cm}}
+ \hline
+ \textbf{Name} & \textbf{Argument list} & \textbf{Description} \\
+ \hline
+ \hline
+ \funname{sjunction} & ( \varname{center} ) & For serial (type 1) junctions. \\
+ \funname{pjunction} & ( \varname{center} ) & For parallell (type 0) junctions. \\
+ \funname{tfjunction} & ( \varname{center}, \varname{arrowdir}, \varname{lbl} ) & For transformer junctions. \\
+ \funname{gyjunction} & ( \varname{center}, \varname{arrowdir}, \varname{lbl} ) & For gyrator junctions. \\
+ \hline
+ \end{tabular}
+\end{center}
+
+\section{Setting variables}
+
+\begin{center}
+ \begin{tabular}{l c p{5cm}}
+ \hline
+ \textbf{Name} & \textbf{Type} & \textbf{Description} \\
+ \hline
+ \hline
+ \varname{shiftofflabelmargin} & Length & Similar to MetaPost's \varname{labelmargin}. \\
+ \varname{longblockrx} & Length & Horizontal size of standard rectangular blocks. \\
+ \varname{longblockry} & Length & Vertical size of standard rectangular blocks. \\
+ \varname{smallblockr} & Length & Size of square blocks. \\
+ \varname{connectionlw} & Length & Width of connection lines. \\
+ \varname{blocklw} & Length & Width of block frames. \\
+ \varname{textscale} & Scalar & Scaling applied to all labels. \\
+ \varname{implicitdraw} & Boolean & If true, generated objects are drawn before they are returned. \\
+ \varname{junctionimplicitdraw} & Boolean & Like \varname{implicitdraw}, but used in bond graphs. \\
+ \varname{useopenbonds} & Boolean & If true, the asymmetric arrowheads used in bond graphs are not filled. \\
+ \hline
+ \end{tabular}
+\end{center}
+
+\section{Direction constants}
+
+\begin{center}
+ \begin{tabular}{l p{8cm}}
+ \hline
+ \textbf{Name} &\textbf{Description} \\
+ \hline
+ \hline
+ \varname{to\_{}center} & Tells \funname{shiftoff} and \funname{shiftoffwlm} to center an object at the origin. \\
+ \varname{to\_{}lft} & Tells \funname{shiftoff} and \funname{shiftoffwlm} to place an object to the left of the origin, in a fashion analogue to the \varname{lft} suffix on MetaPost's \funname{label} macro. \\
+ \varname{to\_{}ulft} & Analogue to the corresponding \funname{label} suffix. \\
+ \varname{to\_{}top} & Analogue to the corresponding \funname{label} suffix. \\
+ \varname{to\_{}urt} & Analogue to the corresponding \funname{label} suffix. \\
+ \varname{to\_{}rt} & Analogue to the corresponding \funname{label} suffix. \\
+ \varname{to\_{}lrt} & Analogue to the corresponding \funname{label} suffix. \\
+ \varname{to\_{}bot} & Analogue to the corresponding \funname{label} suffix. \\
+ \varname{to\_{}llft} & Analogue to the corresponding \funname{label} suffix. \\
+ \hline
+ \end{tabular}
+\end{center}
+
+\end{document}
diff --git a/Master/texmf-dist/doc/metapost/blockdraw_mp/bonddemo.pdf b/Master/texmf-dist/doc/metapost/blockdraw_mp/bonddemo.pdf
new file mode 100644
index 00000000000..8613ed39001
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/blockdraw_mp/bonddemo.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/blockdraw_mp/cascadedemo.pdf b/Master/texmf-dist/doc/metapost/blockdraw_mp/cascadedemo.pdf
new file mode 100644
index 00000000000..1b7a7aaeae7
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/blockdraw_mp/cascadedemo.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/blockdraw_mp/tiddetext.sty b/Master/texmf-dist/doc/metapost/blockdraw_mp/tiddetext.sty
new file mode 100644
index 00000000000..f3a462b5c4c
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/blockdraw_mp/tiddetext.sty
@@ -0,0 +1,71 @@
+\RequirePackage{xspace}
+
+% label and ref pairs
+\newcommand{\qlabel}[1]{\label{eq:#1}}
+\newcommand{\qref}[1]{\eqref{eq:#1}}
+\newcommand{\Equationref}[1]{Equation~\qref{#1}}
+\newcommand{\equationref}[1]{\qref{#1}}
+\newcommand{\Equationsref}[1]{Equations~\qref{#1}}
+\newcommand{\equationsref}[1]{\qref{#1}}
+
+\newcommand{\fglabel}[1]{\label{fig:#1}}
+\newcommand{\fgref}[1]{\ref{fig:#1}}
+\newcommand{\Figureref}[1]{Figure~\fgref{#1}}
+\newcommand{\figureref}[1]{figure~\fgref{#1}}
+\newcommand{\Figuresref}[1]{Figures~\fgref{#1}}
+\newcommand{\figuresref}[1]{figures~\fgref{#1}}
+
+\newcommand{\tblabel}[1]{\label{fig:#1}}
+\newcommand{\tbref}[1]{\ref{fig:#1}}
+\newcommand{\Tableref}[1]{Table~\tbref{#1}}
+\newcommand{\tableref}[1]{table~\tbref{#1}}
+\newcommand{\Tablesref}[1]{Tables~\tbref{#1}}
+\newcommand{\tablesref}[1]{tables~\tbref{#1}}
+
+\newcommand{\alglabel}[1]{\label{fig:#1}}
+\newcommand{\algref}[1]{\ref{fig:#1}}
+\newcommand{\Algorithmref}[1]{Algorithm~\algref{#1}}
+\newcommand{\algorithmref}[1]{algorithm~\algref{#1}}
+\newcommand{\Algorithmsref}[1]{Algorithms~\algref{#1}}
+\newcommand{\algorithmsref}[1]{algorithms~\algref{#1}}
+
+\newcommand{\chalabel}[1]{\label{fig:#1}}
+\newcommand{\charef}[1]{\ref{fig:#1}}
+\newcommand{\Chapterref}[1]{Chapter~\charef{#1}}
+\newcommand{\chapterref}[1]{chapter~\charef{#1}}
+\newcommand{\Chaptersref}[1]{Chapters~\charef{#1}}
+\newcommand{\chaptersref}[1]{chapters~\charef{#1}}
+
+\newcommand{\seclabel}[1]{\label{fig:#1}}
+\newcommand{\secref}[1]{\ref{fig:#1}}
+\newcommand{\Sectionref}[1]{Section~\secref{#1}}
+\newcommand{\sectionref}[1]{section~\secref{#1}}
+\newcommand{\Sectionsref}[1]{Sections~\secref{#1}}
+\newcommand{\sectionsref}[1]{sections~\secref{#1}}
+
+\newcommand{\applabel}[1]{\label{fig:#1}}
+\newcommand{\appref}[1]{\ref{fig:#1}}
+\newcommand{\Appendixref}[1]{Appendix~\appref{#1}}
+\newcommand{\appendixref}[1]{appendix~\appref{#1}}
+\newcommand{\Appendicesref}[1]{Appendices~\appref{#1}}
+\newcommand{\appendicesref}[1]{appendices~\appref{#1}}
+
+\newcommand{\ost}[1]{\ensuremath{{#1}^{\textrm{st}}}}
+\newcommand{\ond}[1]{\ensuremath{{#1}^{\textrm{nd}}}}
+\newcommand{\ord}[1]{\ensuremath{{#1}^{\textrm{rd}}}}
+\newcommand{\oth}[1]{\ensuremath{{#1}^{\textrm{th}}}}
+
+\newcommand{\abbetc}{etc\xspace}
+\newcommand{\abbie}{i~e\xspace}
+\newcommand{\Matlab}{\textsc{Matlab}\xspace}
+\newcommand{\Mathematica}{\textit{Mathematica}\xspace}
+
+\newenvironment{codeverbatim}%
+ {\hspace{0.05\textwidth}\begin{minipage}[c]{0.95\textwidth}}%
+ {\end{minipage}}
+\newcommand{\inline}[1]{\textnormal{\texttt{#1}}}
+
+\newcommand{\funname}[1]{\textnormal{\texttt{#1}}}
+\newcommand{\typename}[1]{\textnormal{\textbf{\textit{#1}}}}
+\newcommand{\varname}[1]{\textnormal{\textit{#1}}}
+\newcommand{\filename}[1]{\emph{#1}}
diff --git a/Master/texmf-dist/doc/metapost/blockdraw_mp/tighttoc.sty b/Master/texmf-dist/doc/metapost/blockdraw_mp/tighttoc.sty
new file mode 100644
index 00000000000..ebfd73b4f4b
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/blockdraw_mp/tighttoc.sty
@@ -0,0 +1,64 @@
+% This package was written for the CTAN submission of the blockdraw_mp documentation source.
+%
+% It is my first package using options...
+%
+% It should be loaded before the parskip package, or else it will not work!
+%
+% Author: Henrik Tidefelt
+
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{tighttoc}[2006/07/18 Tight table of contents]
+
+\RequirePackage{ifthen}
+
+\newcounter{oldtocdepth}
+\newcounter{tighttoctocdepth}
+\newboolean{overridetocdepth}
+\newboolean{bookmarktoc}
+\newboolean{tighttoc}
+\newlength{\tighttocparskipreduction}
+
+\DeclareOption{bookmark}{\setboolean{bookmarktoc}{true}}
+\DeclareOption{nobookmark}{\setboolean{bookmarktoc}{false}}
+\DeclareOption{depthdefault}{\setboolean{overridetocdepth}{false}}
+\DeclareOption{depth0}{\setcounter{tighttoctocdepth}{0}\setboolean{overridetocdepth}{true}}
+\DeclareOption{depth1}{\setcounter{tighttoctocdepth}{1}\setboolean{overridetocdepth}{true}}
+\DeclareOption{depth2}{\setcounter{tighttoctocdepth}{2}\setboolean{overridetocdepth}{true}}
+\DeclareOption{depth3}{\setcounter{tighttoctocdepth}{3}\setboolean{overridetocdepth}{true}}
+\DeclareOption{depth4}{\setcounter{tighttoctocdepth}{4}\setboolean{overridetocdepth}{true}}
+\DeclareOption{0ex}{\setlength{\tighttocparskipreduction}{0ex}}
+\DeclareOption{1ex}{\setlength{\tighttocparskipreduction}{1ex}}
+\DeclareOption{2ex}{\setlength{\tighttocparskipreduction}{2ex}}
+\DeclareOption{3ex}{\setlength{\tighttocparskipreduction}{3ex}}
+
+\ExecuteOptions{bookmark,depthdefault,1ex}
+\ProcessOptions\relax
+
+\let\@oldstarttoc\@starttoc
+
+\renewcommand{\tableofcontents}%
+{%
+ \ifthenelse{\isundefined{\href}}{%
+ % Don't add a bookmark!
+ }{%
+ \ifthenelse{\boolean{bookmarktoc}}{%
+ \pdfbookmark[1]{Contents}{thetocanchor}%
+ }{%
+ % do nothing
+ }%
+ }%
+ \section*{\contentsname}%
+ \addtolength{\parskip}{-\tighttocparskipreduction}%
+ \setcounter{oldtocdepth}{\value{tocdepth}}%
+ \ifthenelse{\boolean{overridetocdepth}}{%
+ \setcounter{tocdepth}{\thetighttocdepth} % limit the depth of the conents tree
+ }{%
+ % do nothing
+ }%
+ \makeatletter
+ \@oldstarttoc{toc}%
+ \makeatother
+ \setcounter{tocdepth}{\value{oldtocdepth}}%
+ \addtolength{\parskip}{\tighttocparskipreduction}%
+}