summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/method
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/method
Initial commit
Diffstat (limited to 'macros/latex/contrib/method')
-rw-r--r--macros/latex/contrib/method/Makefile20
-rw-r--r--macros/latex/contrib/method/README66
-rw-r--r--macros/latex/contrib/method/method.dtx845
-rw-r--r--macros/latex/contrib/method/method.ins60
-rw-r--r--macros/latex/contrib/method/method.pdfbin0 -> 354734 bytes
-rw-r--r--macros/latex/contrib/method/methtest.tex54
6 files changed, 1045 insertions, 0 deletions
diff --git a/macros/latex/contrib/method/Makefile b/macros/latex/contrib/method/Makefile
new file mode 100644
index 0000000000..3c4d215c15
--- /dev/null
+++ b/macros/latex/contrib/method/Makefile
@@ -0,0 +1,20 @@
+CODE := '\date{1999/03/25}\input{method.dtx}'
+LATEX := pdflatex -draftmode $(CODE)
+LATEX_FINISH := pdflatex $(CODE)
+
+method.pdf: method.dtx method.ind method.gls
+ $(LATEX)
+ $(LATEX)
+ $(LATEX_FINISH)
+
+method.ind: method.dtx method.idx
+ makeindex -s gind.ist -o method.ind method.idx
+
+method.gls: method.dtx method.glo
+ makeindex -s gglo.ist -o method.gls method.glo
+
+method.idx: method.dtx
+ $(LATEX)
+
+method.glo: method.dtx
+ $(LATEX)
diff --git a/macros/latex/contrib/method/README b/macros/latex/contrib/method/README
new file mode 100644
index 0000000000..501b1e3afd
--- /dev/null
+++ b/macros/latex/contrib/method/README
@@ -0,0 +1,66 @@
+README for the package method
+
+
+License
+=======
+
+The files in this directory (method distribution) are Copyright 1998 1999
+Thomas Leineweber, Univerity of Dortmund, Germany
+
+
+The files associated with the method-package (see below for a list) may be
+distributed under the terms of the LaTeX Project Public License, as
+described in lppl.txt in the base LaTeX distribution. Either version 1.0
+or, at your option, any later version.
+
+ERROR REPORTS
+=============
+
+Before you report an error, please check that:
+
+ - the error isn't caused by obsolete versions of other software;
+ LaTeX from 1986 is a good candidate ...
+
+ - you use an original version of the package.
+
+
+ If you think you found a genuine bug please report it together
+ with the following information:
+
+ - version of the file
+
+ - version (date!) of your LaTeX
+
+ - a short test file showing the behavior with all unnecessary
+ code removed.
+
+ - a transcript (log file) of the session that shows the error.
+
+Please note that it is important to make the file as small as possible
+to allow me to find and fix the error soon.
+
+If you have an unchanged version of my package method, you can send me
+error reports to
+
+ leineweb@ls6.cs.uni-dortmund.de
+
+
+Files distributed with this package
+===================================
+
+method.ins This is the installation script that will produce
+ the executable file method.sty when run through LaTeX
+ or TeX
+method.dtx `method' style for LaTeX in docstrip format.
+readme This file
+methtest.tex A test file showing the usage of the package.
+
+
+
+Acknowledgements
+================
+
+This readme is mostly copied from the readme from the dinbrief package by
+K.D. Braune and R. Gussmann
+
+Jean-Pierre Drucbert for the french translation
diff --git a/macros/latex/contrib/method/method.dtx b/macros/latex/contrib/method/method.dtx
new file mode 100644
index 0000000000..13f6b38ec6
--- /dev/null
+++ b/macros/latex/contrib/method/method.dtx
@@ -0,0 +1,845 @@
+% \iffalse Meta-Kommentar
+%
+% Copyright 1997, 1998, 1998, 1999
+% Thomas Leineweber
+% Lehrstuhl VI, Fachbereich Informatik,
+% Universitaet Dortmund
+% (leineweb@ls6.cs.uni-dortmund.de)
+%
+% This package is based on work by J. Wahlmann and R. Garmann.
+% I took their package and enhanced it.
+%
+% Enhancements provided by
+% Jean-Pierre Drucbert
+%
+% This is the documented macrocode for the generation and
+% documentation of the package `method'.
+%
+% This file may be distributed under the terms of the LaTeX Project Public
+% License, as described in lppl.txt in the base LaTeX distribution.
+% Either version 1.0 or, at your option, any later version.
+%
+% \fi
+%
+% \CheckSum{787}
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%
+% \title{\LaTeX-package for an easy declaration of functions and variables}
+% \author{Thomas Leineweber}
+% \maketitle
+%
+% \changes{v1.0}{????/??/??}{First version by J. Wahlmann}
+% \changes{v1.1}{1995/10/17}{Facelifting by R. Garmann}
+% \changes{v1.1}{1995/10/18}{Facelifting by R. Garmann}
+% \changes{v1.1}{1995/10/19}{New environment data for variables}
+% \changes{v1.1}{1995/10/19}{init and del for the environment data added}
+% \changes{v1.1}{1995/10/25}{Test for the use of the special commands
+% outside the environments}
+% \changes{v1.2}{1997/06/25}{Change documentation to a dtx-file}
+% \changes{v1.3}{1997/06/29}{Documentation changes}
+% \changes{v1.6}{1999/01/04}{Documentation changes}
+% \changes{v1.7}{1999/01/28}{Documentation changes}
+% \changes{v1.7}{1999/01/28}{First parts for internationalization}
+% \changes{v1.8}{1999/02/04}{Change standard to english}
+% \changes{v2.0}{1999/02/05}{First public version with
+% internationalization and localization for english and german}
+% \changes{v2.0b}{1999/03/25}{Change licencse to lppl}
+%
+% \section{Overview}
+% The package method can be used to easily format method- and
+% variabledeclarations with \LaTeX.
+% It is based on work by J. Wahlmann and Robert Garmann.
+%
+%\section{Usage}
+% The package is used as usual:
+%\begin{quote}
+% |\usepackage[<language>]{method}|
+%\end{quote}
+% It defines two new environments: method and data. Method is used to
+% typeset method-declarations, data for variable-declarations.
+% At the moment the two options \textsf{english} and \textsf{german}
+% are defined. With these options it is possible to select the language
+% used to typeset the declarations. In the future some other languages
+% will be added.
+%
+%\section{The environment method}
+% \DescribeEnv{method}
+% Within the environment
+% method the following commands are defined:
+%
+%\begin{itemize}
+%\item \DescribeMacro{\head}
+% \cs{head}\texttt{\{\emph{Header}\}:} The header of the method.
+%\item \DescribeMacro{\para}
+% \cs{para}\texttt{\{\emph{Name}\}\{\emph{Description}\}:}
+% Name and description of a parameter.
+%\item \DescribeMacro{\precond}
+% \cs{precond}\texttt{\{\emph{Precondition}\}:}
+% Description of a precondition of the method.
+%\item \DescribeMacro{\descr}
+% \cs{descr}\texttt{\{\emph{Description}\}:}
+% Description of the method itself.
+%\item \DescribeMacro{\postcond}
+% \cs{postcond}\texttt{\{\emph{postcondition}\}:}
+% Description of a postcondition of the method.
+%\item \DescribeMacro{\error}
+% \cs{error}\texttt{\{\emph{Exception}\}:} Error and exceptions.
+%\item \DescribeMacro{\return}
+% \cs{return}\texttt{\{\emph{Return value}\}:}
+% Description of the data returned by the method.
+%\item \DescribeMacro{\see}
+% \cs{see}\texttt{\{\emph{where}\}:} Cross-References.
+%\end{itemize}
+%
+%These commands have the following in common:
+%\begin{itemize}
+%\item All parameters are simple texts.
+%\item The sequence of the commands inside the method-environment is
+% not relevant. The parts are typeset automatically.
+%\item Up to 26 \cs{para}-commands are allowed inside a method
+% environment. When there are more, a warning will be issued und the
+% following parameters will be ignored.
+%\item The header of the method and the parameters are typeset in a
+%typewriter font.
+%\item If the header is extremely long, it can be typeset in more
+%lines with the following macros (an example is given further down):
+%\begin{verbatim}
+% \headtabbed{<functionname>} Name of the function
+% \headpara{<parametername>} one or more parameter
+%\end{verbatim}
+%\end{itemize}
+%
+%\section{The environment data} \DescribeEnv{data}
+% The environment data equals to the environment method. The macros
+% \cs{head}, \cs{descr} and \cs{see} can also be used inside a
+% data-environment.
+% Further macros inside a data-environment are:
+%\begin{itemize}
+%\item \DescribeMacro{\init}
+% \cs{init}\texttt{\{\emph{Info}\}:} Information about the generation
+% of the objekt.
+%\item \DescribeMacro{\del}
+% \cs{del}\texttt{\{\emph{Info}\}:} Information about the release of
+% the object.
+%\end{itemize}
+%
+%\section{Examples}
+%In this section some examples for the usage of the environments
+%method and data are shown.
+%\begin{verbatim}
+% \begin{method}
+% \head{int div(int a, int b, double \&c);}
+% \para{a}{dividend}
+% \para{b}{divisor}
+% \para{\&c}{result of the division}
+% \precond{no preconditions}
+% \descr{Divides \texttt{a} by \texttt{b} and gives the result
+% in \texttt{c}}
+% \postcond{no postconditions}
+% \error{no errors}
+% \return{\texttt{-1}, when \texttt{b==0}, else \texttt{0}}
+% \see{your favourite mathematics book}
+% \end{method}
+%
+% \begin{method}
+% \headtabbed{PrimObject(}
+% \headpara{const Matrix transformation,}
+% \headpara{AbstGeometry *geometry = 0,}
+% \headpara{MaterialApplication *material = 0,}
+% \headpara{AbstBumpMap *bumpMap = 0,}
+% \headpara{Distribution *distribution = 0);}
+% \para{transformation}{Transformation matrix}
+% \para{*geometry}{\ldots}
+% \descr{\ldots}
+% \end{method}
+%
+% \begin{data}
+% \head{char *name}
+% \descr{Name of the user}
+% \end{data}
+% \begin{data}
+% \head{char *no}
+% \descr{Telephone-number of the user}
+% \see{Telephone Book}
+% \end{data}
+%\end{verbatim}
+%
+% \StopEventually
+%
+% \section{Identification und documentation}
+%
+% This package can only be used with \LaTeXe. Therefore make sure,
+% we use no other \TeX-format.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+% \end{macrocode}
+%
+% Show the name of the package and its version
+% \begin{macrocode}
+%<+method>\ProvidesPackage{method}
+%<+method> [1999/03/25 v2.0b
+%<+method> LaTeX-package for method- and
+%<+method> data-descriptions (TL)]
+% \end{macrocode}
+%
+%
+% We have a specialized class for the documentation.
+% \begin{macrocode}
+%<*driver>
+\documentclass[a4paper]{ltxdoc}
+% \end{macrocode}
+% Set the specific options for the documentation of the package.
+% \begin{macrocode}
+\DoNotIndex{\",\\,\addtolength,\begin,\CodelineIndex,\CodelineNumbered}
+\DoNotIndex{\def,\DocInput,\documentclass,\DoNotIndex,\EnableCrossrefs}
+\DoNotIndex{\end,\fbox,\fboxrule,\hfill,\hspace,\ifcase,\or,\fi}
+\DoNotIndex{\ifnum,\fi,\item,\itemindent,\labelsep,\labelwidth}
+\DoNotIndex{\leftmargin,\listparindent,\NeedsTeXFormat,\newcommand}
+\DoNotIndex{\newcount,\newcounter,\newenvironment,\newlength,\sloppy}
+\DoNotIndex{\nopagebreak,\PackageError,\parbox,\parindent,\stepcounter}
+\DoNotIndex{\PrintChanges,\PrintIndex,\ProvidesPackage,\RecordChanges}
+\DoNotIndex{\setcounter,\setlength,\textbf,\texttt,\usepackage,\vspace}
+\DoNotIndex{\settowidth,\textwidth,\topsep}
+\CodelineNumbered
+\CodelineIndex
+\EnableCrossrefs
+\RecordChanges
+\setcounter{StandardModuleDepth}{1}
+\usepackage[T1]{fontenc}
+\usepackage[latin1]{inputenc}
+% \end{macrocode}
+% Give all details.
+% \begin{macrocode}
+\begin{document}
+\DocInput{method.dtx}
+\PrintIndex
+\PrintChanges
+\end{document}
+%</driver>
+% \end{macrocode}
+%
+%
+%\section{Package internals}
+%
+% At the start of a method-environment the actual textwidth is read
+% and saved for the layout of the description.
+%
+% The commands for the parts, namely \cs{head}, \cs{para},
+% \cs{precond}, ..., define
+% internal commands with the names \cs{meth@head}, \cs{meth@pa},
+% \cs{meth@pb}, ..., \cs{meth@pz},
+% \cs{meth@precond}, ... which are defined with the actual
+% parameters.
+%
+% At the end of a method-environment all these internal saved data is
+% typeset in a (hopefully) fashionable way.
+
+%
+% \section{Helping commands}
+% \begin{macro}{\meth@paranum}
+% \begin{macro}{\meth@headparanum}
+% The counter \cs{meth@paranum} counts the number of
+% \cs{para}-commands within a
+% method-environment:
+% \begin{macrocode}
+\newcounter{meth@paranum}
+% \end{macrocode}
+% The counter \cs{meth@headparanum} stores how many
+% \cs{headpara}-commands are given within a method-environment:
+% \begin{macrocode}
+\newcounter{meth@headparanum}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%\begin{macro}{\meth@totwid}
+% The header will be typeset inside a framed minipage with a width of
+% \cs{@totwid} (= \cs{textwidth} - 6mm):
+% \begin{macrocode}
+\newlength{\meth@totwid}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\meth@indent}
+%\begin{macro}{\meth@listdecl}
+% \changes{v1.3}{1997/06/29}{Minimale Änderung.}
+% The descriptions are organized as lists with the following parameters:
+% \begin{macrocode}
+\def\meth@indent{3.5cm}
+\def\meth@listdecl{\labelwidth3cm \labelsep0.5cm
+ \itemindent0cm \leftmargin\meth@indent
+ \topsep0cm \listparindent0cm}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%
+% \begin{macro}{\meth@righttotwid}
+% The right part of the list has a width of \cs{meth@righttotwid}
+% (= \cs{meth@totwid} - \cs{meth@indent}):
+% \begin{macrocode}
+\newlength{\meth@righttotwid}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\meth@namewid}
+%\begin{macro}{\meth@nameindent}
+%\begin{macro}{\meth@rightnamewid}
+% The following lengths are used for the macro \cs{headtabbed}:
+% \begin{macrocode}
+\newlength{\meth@namewid}
+\newlength{\meth@nameindent}
+\newlength{\meth@rightnamewid}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%
+%\section{Options}
+%\begin{macro}{\textsee}
+%\begin{macro}{\textinit}
+%\begin{macro}{\textdel}
+%\begin{macro}{\textreturn}
+%\begin{macro}{\textprecond}
+%\begin{macro}{\textpostcond}
+%\begin{macro}{\textdescr}
+%\begin{macro}{\texterror}%
+% Now we have the option-processing. The option defines the language,
+% which will be used to print the textual parts of the
+% descriptions. At the moment only the languages english and german
+% are defined.
+%
+% First, define the parts for german descriptions
+% \begin{macrocode}
+\DeclareOption{german}{\def\textsee{Siehe auch:}
+ \def\textinit{Erzeugung:}
+ \def\textdel{Freigabe:}
+ \def\textreturn{R\"uckgabewert:}
+ \def\textprecond{Vorbed.:}
+ \def\textpostcond{Nachbed.:}
+ \def\textdescr{Beschreibung:}
+ \def\texterror{Ausnahmebeh.:}}
+
+% \end{macrocode}
+% Now for the english descriptions:
+% \begin{macrocode}
+\DeclareOption{english}{\def\textsee{see also:}
+ \def\textinit{initialisation:}
+ \def\textdel{disposal:}
+ \def\textreturn{return value:}
+ \def\textprecond{precondition:}
+ \def\textpostcond{postcondition:}
+ \def\textdescr{description:}
+ \def\texterror{exceptions:}}
+% \end{macrocode}
+% \changes{v2.0a}{1999/02/18}{French localization (thanks to
+% Jean-Pierre Drucbert)}
+% The french descriptions, provided by Jean-Pierre Drucbert:
+% \begin{macrocode}
+\DeclareOption{french}{\def\textsee{voir aussi:}
+ \def\textinit{initialisation:}
+ \def\textdel{lib\'eration:}
+ \def\textreturn{valeur de retour:}
+ \def\textprecond{pr\'econdition:}
+ \def\textpostcond{postcondition:}
+ \def\textdescr{description:}
+ \def\texterror{exceptions:}}
+% \end{macrocode}
+% Make the english version the default version and process the options.
+% \begin{macrocode}
+\ExecuteOptions{english}
+\ProcessOptions\relax
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%
+%\section{Error-detection}
+%\begin{macro}{\meth@where}
+%\begin{macro}{\meth@checkdoubleopen}
+%\begin{macro}{\meth@checknotopen}
+%\changes{v1.3}{1997/06/29}{Show error messages with \cs{PackageError}}
+% The macro \cs{head} can be used both in the environments method and
+% data. The following value is used to differentiate if method or data
+% is active. If none is active, the counter is set to 99. Method sets
+% it to 0, data to 1.
+% \begin{macrocode}
+\newcount\meth@where \meth@where=99
+% \end{macrocode}
+% Now define the error messages:
+% \begin{macrocode}
+\def\meth@checkdoubleopen{
+ \ifnum\meth@where<99
+ \PackageError{method}%
+ {There is an method.sty-environment open!}%
+ {}
+ \fi
+}
+\def\meth@checknotopen{
+ \ifnum\meth@where=99
+ \PackageError{method}%
+ {There is no method.sty-environment open!}%
+ {}
+ \fi
+}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%
+%\section{The environment method}
+%\begin{environment}{method}
+% Now we define the environment method.
+% \begin{macrocode}
+\newenvironment{method}
+{
+% \end{macrocode}
+% First we check, wether a method or data-environment is open. After
+% that we set \cs{meth@where} to 0, which shows, that we are inside a
+% method-environment.
+% \begin{macrocode}
+ \meth@checkdoubleopen
+ \meth@where=0
+% \end{macrocode}
+% Define the lengths used for the typesetting of the method.
+% \changes{v1.1}{????/??/??}{Abzug von \cs{meth@totwid} von 4~mm auf 6~mm erhhöht}
+% \begin{macrocode}
+ \setlength{\meth@totwid}{\textwidth}
+ \addtolength{\meth@totwid}{-6mm}
+ \setlength{\meth@righttotwid}{\meth@totwid}
+ \addtolength{\meth@righttotwid}{-\meth@indent}
+% \end{macrocode}
+% The right column is not very wide. Therfore use \cs{sloppy}.
+% \begin{macrocode}
+ \sloppy
+% \end{macrocode}
+% All parts are defined to nothing.
+%\changes{v1.5}{1998/01/19}{extend to 26 parameters}
+% \begin{macrocode}
+ \def\meth@head{}
+ \def\meth@headtabbed{}
+ \setcounter{meth@headparanum}{0}
+ \def\meth@hpa{}\def\meth@hpb{}\def\meth@hpc{}\def\meth@hpd{}
+ \def\meth@hpe{}\def\meth@hpf{}\def\meth@hpg{}\def\meth@hph{}
+ \def\meth@hpi{}\def\meth@hpj{}\def\meth@hpk{}\def\meth@hpl{}
+ \def\meth@hpm{}\def\meth@hpn{}\def\meth@hpo{}\def\meth@hpp{}
+ \def\meth@hpq{}\def\meth@hpr{}\def\meth@hps{}\def\meth@hpt{}
+ \def\meth@hpu{}\def\meth@hpv{}\def\meth@hpw{}\def\meth@hpx{}
+ \def\meth@hpy{}\def\meth@hpz{}
+ \setcounter{meth@paranum}{0}
+ \def\meth@pa{}\def\meth@pb{}\def\meth@pc{}\def\meth@pd{}
+ \def\meth@pe{}\def\meth@pf{}\def\meth@pg{}\def\meth@ph{}
+ \def\meth@pi{}\def\meth@pj{}\def\meth@pk{}\def\meth@pl{}
+ \def\meth@pm{}\def\meth@pn{}\def\meth@po{}\def\meth@pp{}
+ \def\meth@pq{}\def\meth@pr{}\def\meth@ps{}\def\meth@pt{}
+ \def\meth@pu{}\def\meth@pv{}\def\meth@pw{}\def\meth@px{}
+ \def\meth@py{}\def\meth@pz{}
+ \def\meth@precond{}
+ \def\meth@descr{}
+ \def\meth@postcond{}
+ \def\meth@error{}
+ \def\meth@return{}
+ \def\meth@see{}
+% \end{macrocode}
+% Now for the end of the environment. The first line in a paragraph
+% is not indented and a small space is made above the header.
+% \begin{macrocode}
+}{
+ \parindent0cm
+ \vspace{2mm}
+% \end{macrocode}
+% now a sorted list of all given parts inside the environment. The
+% user has to see, that only one of
+% \cs{meth@head} and \cs{meth@headtabbed} is used.
+% \changes{v1.3}{1997/06/29}{Minimal change in the format of typesetting}%
+% \changes{v1.5}{1998/01/19}{extend to 26 parameters}
+% \begin{macrocode}
+ \meth@head\meth@headtabbed
+ \nopagebreak[4]
+ \meth@pa \meth@pb \meth@pc \meth@pd \meth@pe \meth@pf \meth@pg
+ \meth@ph \meth@pi \meth@pj \meth@pk \meth@pl \meth@pm \meth@pn
+ \meth@po \meth@pp \meth@pq \meth@pr \meth@ps \meth@pt \meth@pu
+ \meth@pv \meth@pw \meth@px \meth@py \meth@pz
+ \meth@precond
+ \meth@descr
+ \meth@postcond
+ \meth@error
+ \meth@return
+ \meth@see
+% \end{macrocode}
+% Now set \cs{meth@where} back to 99.
+% \begin{macrocode}
+ \meth@where=99
+% \end{macrocode}
+% This is the end of the definition of the environment method.
+% \begin{macrocode}
+}
+% \end{macrocode}
+%\end{environment}
+%
+%\section{The environment data}
+%\begin{environment}{data}
+% The environment data is nearly equivalent to the environment method.
+% \changes{v1.3}{1997/06/29}{Change \cs{meth@totwid} from 4~mm to 6~mm.}
+% \begin{macrocode}
+\newenvironment{data}
+{
+ \meth@checkdoubleopen
+ \meth@where=1
+ \setlength{\meth@totwid}{\textwidth}
+ \addtolength{\meth@totwid}{-6mm}
+ \sloppy
+ \def\meth@head{}
+ \def\meth@descr{}
+ \def\meth@init{}
+ \def\meth@del{}
+ \def\meth@see{}
+}{
+ \parindent0cm
+ \vspace{2mm}
+ \meth@head
+ \nopagebreak
+ \meth@descr
+ \meth@init
+ \meth@del
+ \meth@see
+ \meth@where=99
+}
+% \end{macrocode}
+%\end{environment}
+%
+%\section{Macros for the parts inside the environments}
+%
+% The definitions for the parts of the environments data and method
+% \subsection{\cs{head}}
+% \begin{macro}{\head}
+% The macro \cs{head} is used to typeset the header of the method or
+% the definition of the variable.
+% \begin{macrocode}
+\newcommand{\head}[1]{
+% \end{macrocode}
+% First check, if the environment is active at the moment.
+% \begin{macrocode}
+ \meth@checknotopen
+% \end{macrocode}
+% If \cs{meth@where} is set to 0, the environment method is active.
+% \begin{macrocode}
+ \ifnum\meth@where=0
+ \def\meth@head{
+% \end{macrocode}
+% The code to typeset the header.
+% \changes{v1.3}{1997/06/29}{\cs{tt} replaced by \cs{texttt}.}
+% \begin{macrocode}
+ {\setlength{\fboxrule}{0.2mm}%
+ \fbox{\parbox{\meth@indent}{\hfill}
+ \begin{minipage}{\meth@righttotwid}
+ {\parindent-\meth@indent \texttt{#1}}
+ \end{minipage}
+ }}
+ }
+ \fi%
+% \end{macrocode}
+% If \cs{meth@where} is set to 1, the environment data is active.
+% \begin{macrocode}
+ \ifnum\meth@where=1
+ \def\meth@head{
+% \end{macrocode}
+% The code to typeset the header.
+% \changes{v1.3}{1997/06/29}{\cs{tt} replaced by \cs{texttt}.}
+% \begin{macrocode}
+ {\setlength{\fboxrule}{0.1mm}%
+ \fbox{\hspace{2mm}\begin{minipage}{\meth@totwid}
+ \texttt{#1}
+ \end{minipage}}
+ }
+ }
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{headtabbed}}
+% \begin{macro}{\headtabbed}
+% \cs{headtabbed} takes care of the first line, which will be
+% formatted in the header of the method and defines the macro
+% \cs{meth@headtabbed}, which does the output.
+% \changes{v1.3}{1997/06/29}{\cs{tt} replaced by \cs{texttt}.}
+% \begin{macrocode}
+\newcommand{\headtabbed}[1]{
+ \meth@checknotopen
+ \def\meth@headtabbed{
+ \setlength{\fboxrule}{0.2mm}%
+ \settowidth{\meth@namewid}{\texttt{#1}}%
+ \setlength{\meth@rightnamewid}{\meth@totwid}
+ \addtolength{\meth@rightnamewid}{-\meth@namewid}
+ \setlength{\meth@nameindent}{\meth@namewid}
+ \addtolength{\meth@nameindent}{2mm}
+ \fbox{\parbox{\meth@nameindent}{\hfill}%
+ \begin{minipage}{\meth@rightnamewid}
+ \parindent-\meth@namewid
+ \texttt{#1\meth@hpa
+ \meth@hpb
+ \meth@hpc
+ \meth@hpd
+ \meth@hpe
+ \meth@hpf
+ \meth@hpg
+ \meth@hph
+ \meth@hpi
+ \meth@hpj
+ \meth@hpk
+ \meth@hpl
+ \meth@hpm
+ \meth@hpn
+ \meth@hpo
+ \meth@hpp
+ \meth@hpq
+ \meth@hpr
+ \meth@hps
+ \meth@hpt
+ \meth@hpu
+ \meth@hpv
+ \meth@hpw
+ \meth@hpx
+ \meth@hpy
+ \meth@hpz}%
+ \end{minipage}%
+ }
+ }
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{headpara}}
+% \begin{macro}{\meth@defheadpara}
+% \changes{v1.5}{1997/01/19}{extend to 26 parameters}
+% \cs{meth@defheadpara} searches for the first empty macro of
+% \cs{meth@hpa}, \ldots, \cs{meth@hpz}. In this macro the new line can
+% be saved. This macro is used by \cs{headpara}.
+% \begin{macrocode}
+\newcommand{\meth@defheadpara}[1]{
+ \ifcase\value{meth@headparanum}
+ \def\meth@hpa{#1} \or
+ \def\meth@hpb{\\#1} \or
+ \def\meth@hpc{\\#1} \or
+ \def\meth@hpd{\\#1} \or
+ \def\meth@hpe{\\#1} \or
+ \def\meth@hpf{\\#1} \or
+ \def\meth@hpg{\\#1} \or
+ \def\meth@hph{\\#1} \or
+ \def\meth@hpi{\\#1} \or
+ \def\meth@hpj{\\#1} \or
+ \def\meth@hpk{\\#1} \or
+ \def\meth@hpl{\\#1} \or
+ \def\meth@hpm{\\#1} \or
+ \def\meth@hpn{\\#1} \or
+ \def\meth@hpo{\\#1} \or
+ \def\meth@hpp{\\#1} \or
+ \def\meth@hpq{\\#1} \or
+ \def\meth@hpr{\\#1} \or
+ \def\meth@hps{\\#1} \or
+ \def\meth@hpt{\\#1} \or
+ \def\meth@hpu{\\#1} \or
+ \def\meth@hpv{\\#1} \or
+ \def\meth@hpw{\\#1} \or
+ \def\meth@hpx{\\#1} \or
+ \def\meth@hpy{\\#1} \or
+ \def\meth@hpz{\\#1} \or
+ \PackageError{method}%
+ {Too many parameters in method-environment !}{}
+ \fi
+ \stepcounter{meth@headparanum}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\meth@defheadpara}
+% Now for the definition of the macro \cs{headpara}. Check first, if
+% the correspondent environment is open. Then use the macro
+% \cs{meth@defheadpara}.
+% \begin{macrocode}
+\newcommand{\headpara}[1]{
+ \meth@checknotopen
+ \meth@defheadpara{#1}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{para}}
+% \begin{macro}{\meth@defpara}
+% \begin{macrocode}
+\newcommand{\meth@defpara}[1]{
+ \ifcase\value{meth@paranum}
+ \def\meth@pa{#1} \or
+ \def\meth@pb{#1} \or
+ \def\meth@pc{#1} \or
+ \def\meth@pd{#1} \or
+ \def\meth@pe{#1} \or
+ \def\meth@pf{#1} \or
+ \def\meth@pg{#1} \or
+ \def\meth@ph{#1} \or
+ \def\meth@pi{#1} \or
+ \def\meth@pj{#1} \or
+ \def\meth@pk{#1} \or
+ \def\meth@pl{#1} \or
+ \def\meth@pm{#1} \or
+ \def\meth@pn{#1} \or
+ \def\meth@po{#1} \or
+ \def\meth@pp{#1} \or
+ \def\meth@pq{#1} \or
+ \def\meth@pr{#1} \or
+ \def\meth@ps{#1} \or
+ \def\meth@pt{#1} \or
+ \def\meth@pu{#1} \or
+ \def\meth@pv{#1} \or
+ \def\meth@pw{#1} \or
+ \def\meth@px{#1} \or
+ \def\meth@py{#1} \or
+ \def\meth@pz{#1} \or
+ \PackageError{method}%
+ {Too many parameters in method.sty-environment !}
+ \fi
+ \stepcounter{meth@paranum}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\para}
+% Here the definition for \cs{para}:
+% \changes{v1.3}{1997/06/29}{\cs{tt} replaced by \cs{texttt}.}
+% \changes{v1.4}{1997/06/29}{insert braces, which were missing before}
+% \begin{macrocode}
+\newcommand{\para}[2]{
+ \meth@checknotopen
+ \meth@defpara{\begin{list}{\texttt{#1}}{\meth@listdecl}
+ \item #2
+ \end{list}}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{The other macros}
+% \begin{macro}{\precond}
+% The other macros are very simple. The create a list-environment and
+% put their data inside of this list.
+% \changes{v1.3}{1997/06/29}{\cs{bf} replaced by \cs{textbf}.}
+% \changes{v1.4}{1997/06/29}{insert missing braces.}
+% \begin{macrocode}
+\newcommand{\precond}[1]{
+ \meth@checknotopen
+ \def\meth@precond{\begin{list}{\textbf{\textprecond}}{\meth@listdecl}
+ \item #1
+ \end{list}}
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\postcond}
+% \changes{v1.3}{1997/06/29}{\cs{bf} replaced by \cs{textbf}.}
+% \changes{v1.4}{1997/06/29}{insert missing braces.}
+% \begin{macrocode}
+\newcommand{\postcond}[1]{
+ \meth@checknotopen
+ \def\meth@postcond{\begin{list}{\textbf{\textpostcond}}{\meth@listdecl}
+ \item #1
+ \end{list}}
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\descr}
+% \changes{v1.3}{1997/06/29}{\cs{bf} replaced by \cs{textbf}.}
+% \changes{v1.4}{1997/06/29}{insert missing braces.}
+% \begin{macrocode}
+\newcommand{\descr}[1]{
+ \meth@checknotopen
+ \def\meth@descr{\begin{list}{\textbf{\textdescr}}{\meth@listdecl}
+ \item #1
+ \end{list}}
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\error}
+% \changes{v1.3}{1997/06/29}{\cs{bf} replaced by \cs{textbf}.}
+% \changes{v1.4}{1997/06/29}{insert missing braces.}
+% \begin{macrocode}
+\newcommand{\error}[1]{
+ \meth@checknotopen
+ \def\meth@error{\begin{list}{\textbf{\texterror}}{\meth@listdecl}
+ \item #1
+ \end{list}}
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\return}
+% \changes{v1.3}{1997/06/29}{\cs{bf} replaced by \cs{textbf}.}
+% \changes{v1.4}{1997/06/29}{insert missing braces.}
+% \begin{macrocode}
+\newcommand{\return}[1]{
+ \meth@checknotopen
+ \def\meth@return{\begin{list}{\textbf{\textreturn}}{\meth@listdecl}
+ \item #1
+ \end{list}}
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\see}
+% \changes{v1.3}{1997/06/29}{\cs{bf} replaced by \cs{textbf}.}
+% \changes{v1.4}{1997/06/29}{insert missing braces.}
+% \begin{macrocode}
+\newcommand{\see}[1]{
+ \meth@checknotopen
+ \def\meth@see{\begin{list}{\textbf{\textsee}}{\meth@listdecl}
+ \item #1
+ \end{list}}
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\init}
+% \changes{v1.3}{1997/06/29}{\cs{bf} replaced by \cs{textbf}.}
+% \changes{v1.4}{1997/06/29}{insert missing braces.}
+% \begin{macrocode}
+\newcommand{\init}[1]{
+ \meth@checknotopen
+ \def\meth@init{\begin{list}{\textbf{\textinit}}{\meth@listdecl}
+ \item #1
+ \end{list}}
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\del}
+% \changes{v1.3}{1997/06/29}{\cs{bf} replaced by \cs{textbf}.}
+% \changes{v1.4}{1997/06/29}{insert missing braces.}
+% \begin{macrocode}
+\newcommand{\del}[1]{
+ \meth@checknotopen
+ \def\meth@del{\begin{list}{\textbf{\textdel}}{\meth@listdecl}
+ \item #1
+ \end{list}}
+}
+% \end{macrocode}
+%\end{macro}
+% \Finale
+%
+\endinput
+%
+%
+% \Finale
+%
+\endinput
diff --git a/macros/latex/contrib/method/method.ins b/macros/latex/contrib/method/method.ins
new file mode 100644
index 0000000000..1f02bf4506
--- /dev/null
+++ b/macros/latex/contrib/method/method.ins
@@ -0,0 +1,60 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright (C) 1997-1999 Thomas Leineweber
+%% Lehrstuhl VI
+%% Fachbereich Informatik
+%% Universitaet Dortmund
+%%
+%%
+%% This file is based upon the standard .ins-Files shipped with the
+%% LaTeX-Distribution
+%%
+%% It may be distributed under the terms of the LaTeX Project Public
+%% License, as described in lppl.txt in the base LaTeX distribution.
+%% Either version 1.0 or, at your option, any later version.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\batchfile{method.ins}
+\input docstrip.tex
+\preamble
+
+This is a generated file.
+Copyright (C) 1997-1999 Thomas Leineweber, University of Dortmund.
+
+This file may be distributed under the terms of the LaTeX Project Public
+License, as described in lppl.txt in the base LaTeX distribution.
+Either version 1.0 or, at your option, any later version.
+
+For error reports in case of UNCHANGED versions see the readme file.
+
+Please do not request updates from me directly. Distribution is
+done through the Comprehensive TeX Archive Network (CTAN).
+
+\endpreamble
+\keepsilent
+
+\Msg{*** Generating method style file ***}
+
+\generateFile{method.sty}{t}{
+ \from{method.dtx}{method}}
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space method.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `method.dtx'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/macros/latex/contrib/method/method.pdf b/macros/latex/contrib/method/method.pdf
new file mode 100644
index 0000000000..87d2239062
--- /dev/null
+++ b/macros/latex/contrib/method/method.pdf
Binary files differ
diff --git a/macros/latex/contrib/method/methtest.tex b/macros/latex/contrib/method/methtest.tex
new file mode 100644
index 0000000000..407c40ae2a
--- /dev/null
+++ b/macros/latex/contrib/method/methtest.tex
@@ -0,0 +1,54 @@
+%% This file is part of the method-distribution
+%% --------------------------------------------
+%%
+%% It may be distributed under the terms of the LaTeX Project Public
+%% License, as described in lppl.txt in the base LaTeX distribution.
+%% Either version 1.0 or, at your option, any later version.
+%%
+\documentclass{book}
+\usepackage[french]{method}
+\begin{document}
+ Als erstes eine Methode:
+
+ \begin{method}
+ \head{int div(int a, int b, double \&c);}
+ \para{a}{Dividend}
+ \para{b}{Divisor}
+ \para{\&c}{Ergebnis der Division}
+ \precond{keine}
+ \descr{Dividiert \texttt{a} durch \texttt{b} und legt
+ das Ergebnis in \texttt{c} ab.}
+ \postcond{keine}
+ \error{keine}
+ \return{\texttt{-1}, falls \texttt{b==0}, sonst \texttt{0}}
+ \see{Duden der Mathematik}
+ \end{method}
+%
+
+Noch eine Methode
+
+ \begin{method}
+ \headtabbed{PrimObject(}
+ \headpara{const Matrix transformation,}
+ \headpara{AbstGeometry *geometry = 0,}
+ \headpara{MaterialApplication *material = 0,}
+ \headpara{AbstBumpMap *bumpMap = 0,}
+ \headpara{Distribution *distribution = 0);}
+ \para{transformation}{Transformationsmatrix}
+ \para{*geometry}{\ldots}
+ \descr{\ldots}
+ \end{method}
+%
+
+Jetzt eine Variable
+
+ \begin{data}
+ \head{char *name}
+ \descr{Name des Teilnehmers}
+ \end{data}
+ \begin{data}
+ \head{char *no}
+ \descr{Telefonnummer des Teilnehmers}
+ \see{Amtliches Telefonbuch}
+ \end{data}
+\end{document}