diff options
Diffstat (limited to 'macros/latex/contrib/refman')
-rw-r--r-- | macros/latex/contrib/refman/00Contents | 23 | ||||
-rw-r--r-- | macros/latex/contrib/refman/lay_d2.tex | 877 | ||||
-rw-r--r-- | macros/latex/contrib/refman/lay_e2.tex | 806 | ||||
-rw-r--r-- | macros/latex/contrib/refman/layout_d.pdf | bin | 0 -> 212034 bytes | |||
-rw-r--r-- | macros/latex/contrib/refman/layout_d.tex | 781 | ||||
-rw-r--r-- | macros/latex/contrib/refman/layout_e.pdf | bin | 0 -> 202816 bytes | |||
-rw-r--r-- | macros/latex/contrib/refman/layout_e.tex | 674 | ||||
-rw-r--r-- | macros/latex/contrib/refman/pagepc.sty | 99 | ||||
-rw-r--r-- | macros/latex/contrib/refman/refman.dtx | 3874 | ||||
-rw-r--r-- | macros/latex/contrib/refman/refman.ins | 64 | ||||
-rw-r--r-- | macros/latex/contrib/refman/refman.pdf | bin | 0 -> 301000 bytes | |||
-rw-r--r-- | macros/latex/contrib/refman/refman.upl | 159 |
12 files changed, 7357 insertions, 0 deletions
diff --git a/macros/latex/contrib/refman/00Contents b/macros/latex/contrib/refman/00Contents new file mode 100644 index 0000000000..7fc08d6c07 --- /dev/null +++ b/macros/latex/contrib/refman/00Contents @@ -0,0 +1,23 @@ +00Contents This file + +layout_d.tex German description of the refman classes + +layout_d.pdf The PDF version of Layout_d formatted for A4 + +layout_e.tex English description of the refman classes + +layout_e.pdf The PDF version of Layout_e formatted for A4 + +lay_d2.tex Part 2 of the german description + +lay_e2.tex Part 2 of the english description + +pagepc.sty Package to get pagenumbers in the chapter-page format + +refman.dtx The refman classes + +refman.pdf The PDF version of refman.dtx + +refman.ins The install script + +refman.upl A short note about refman recent changes diff --git a/macros/latex/contrib/refman/lay_d2.tex b/macros/latex/contrib/refman/lay_d2.tex new file mode 100644 index 0000000000..b042e0de32 --- /dev/null +++ b/macros/latex/contrib/refman/lay_d2.tex @@ -0,0 +1,877 @@ +% LAYOUT2.TEX - Anhang von LAYOUT.TEX (PA 1988) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\clearpage + +\section*{Anhang} +\addcontentsline{toc}{section}{Anhang} + +\appendix + +\section{Die Seitenaufteilung in \LaTeX} + +In diesem Anhang wird angegeben, aus welchen Komponenten der +Seitenaufbau besteht und wie die einzelnen Parameter in \LaTeX\ +definiert sind (siehe auch \seealso{Abb.\,\ref{bild}} +Abbildung~\ref{bild}, die von Nelson Beebe an der University of Utah +erzeugt wurde). + +\begin{description} + +\item[Textbereich] + Der normale Textbereich ("`Body"') umfa"st den laufenden + Text einschlie"s"-lich Fu"snoten, Tabellen und Abbildungen. + \emph{Nicht} zu diesem Bereich geh"oren Kopfzeilen, + Fu"szeilen und Randnoten. + + Der Textbereich hat die Breite \cs{text"-width} und die + H"ohe \cs{text"-height}. + + Bei zweispaltiger Ausgabe enth"alt der Textbereich zwei Spalten, die + jeweils \cs{column"-width} breit sind, und zwischen ihnen einen + Abstand der Breite \cs{column"-sep}. Die Spaltenbreite + \cs{column"-width} ist also etwas geringer als die H"alfte von + \cs{text"-width}. + + \cs{text"-width} bzw.\ \cs{column"-width} soll ein + Vielfaches der Buchstabenbreite des \texttt{tt}-Fonts sein. + + \cs{text"-height} soll ein Vielfaches der + Zeilenh"ohe \cs{baseline"-skip}, vermehrt um die Konstante + \cs{top"-skip}, sein. + + Innerhalb des Textbereichs werden Einr"uckungen mit \cs{left"-skip} + und \cs{right"-skip} festgelegt. Diese beiden Gr"o"sen sollen nicht + explizit ver"-"andert werden sondern nur implizit durch die + Environments. + +\item[linker Rand] + Der Rand links vom Textbereich ist um 1~Inch mehr als \cs{ + odd-} bzw.\ \cs{even"-side"-margin}, je nachdem ob die + Seitennummer ungerade oder gerade ist. Normalerweise sind beide + Gr"o"sen gleich, nur bei der Option \texttt{twoside} werden rechte + (=""ungerade) und linke (=""gerade) Seiten verschieden gesetzt. + +\item[oberer Rand] + Der Rand oberhalb des Textbereichs ist um 1~Inch mehr als die + Summe von \cs{top"-margin}, \cs{head"-height} und + \cs{head"-sep}. + +\item[rechter Rand] + Der Rand rechts vom Textbereich ergibt sich aus der + Papierbreite minus der Breite von linkem Rand und Textbereich. + +\item[unterer Rand] + Der Rand unterhalb des Textbereichs ergibt sich aus der + Papier"-h"ohe minus der H"ohe von oberem Rand und Textbereich. + +\item[Kopfzeilen]\index{Kopfzeilen} + Kopfzeilen ("`Header"') stehen innerhalb des oberen Randes, und + zwar so, da"s zwischen dem unteren Rand der Kopfzeile und dem + oberen Rand des Textbereichs der Abstand \cs{head"-sep} + bleibt. Oberhalb der Kopfzeile bleibt ein freier Rand von + 1~Inch mehr als \cs{top"-margin}. + +\item[Fu"szeilen]\index{Fu{\ss}zeilen} + Fu"szeilen ("`Footer"') stehen innerhalb des unteren Randes, + und zwar so, da"s der Abstand vom unteren Rand des + Textbereichs zum unteren Rand der Fu"s"-zeile \cs{ + foot"-skip} ist. + +\item[Randnoten]\index{Randnoten} + Randnoten ("`Margin Notes"') stehen innerhalb des rechten oder + linken Randes. Sie haben eine Breite von \cs{ + margin"-par"-width}, und zwischen den Randnoten und dem + Textbereich bleibt ein horizontaler Abstand von \cs{ + margin"-par"-sep}. Der vertikale Abstand zwischen + aufeinanderfolgenden Randnoten ist mindestens \cs{ + margin"-par"-push}. + +\end{description} + +Die Papierh"ohe setzt sich also von oben nach unten +aus folgenden Elementen zusammen: +\begin{verse} +\rm 1 Inch \\*[2pt] +\cs{topmargin} \\*[2pt] +\cs{headheight} \\*[2pt] +\cs{headsep} \\*[2pt] +\cs{textheight} \\*[2pt] +\cs{footskip} \\*[2pt] +\rm Rest der Seite +\end{verse} + +Bei Seiten mit rechten Randnoten +-- was der Standardfall ist -- +setzt sich die Papierbreite +von links nach rechts aus folgenden Elementen zusammen: +\begin{verse} +1 Inch \\*[2pt] +\cs{oddsidemargin}\ \ bzw.\ \ \cs{evensidemargin} \\*[2pt] +\cs{textwidth} \\*[2pt] +\cs{marginparsep} \\*[2pt] +\cs{marginparwidth} \\*[2pt] +\rm Rest der Seite +\end{verse} +Bei der Option \texttt{twoside} besteht die Seitenbreite +von linken Seiten mit linken Randnoten +aus folgenden Elementen: +\begin{verse} +\rm 1 Inch \\*[2pt] +\cs{evensidemargin} \\*[2pt] +\cs{textwidth} \\*[2pt] +\rm Rest der Seite +\end{verse} + +\marginlabel{Anmerkungen:} +Die Gr"o"sen \cs{topmargin}, \cs{oddside"-margin} und \cs{evenside"-margin} +k"onnen auch negative Werte haben, dann ergibt sich an der betreffenden +Stelle ein Rand von weniger als 1~Inch. Auch \cs{left"-skip} und +\cs{right"-skip} k"onnen negative Werte haben, dann ragt der Text +entsprechend aus dem Textbereich heraus. Ausf"uhrlichere Hinweise und +Skizzen zu diesem Thema findet man unter anderem in der Zeitschrift {\sc +TUGboat} Vol.9, No.1 (April 1988). + +Die Gr"o"se \cs{footheight} ist in \LaTeX2e\ \emph{nicht} +mehr definiert, da sie anscheinend von niemandem benutzt wurde. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{fullpage} +%%%%%%%%%%%%%%%% + + +% Bild von Nelson Beebe, mit geringen "Anderungen von PA: +\newcommand{\X}[1]{{#1}\index{{#1}}} +% NB: For computed dimension parameters, we cannot use +% \newcommand{}, because this expands to a TeX \def which does +% not evaluate the definition before assigning it to the control +% sequence name; we use \xdef directly to force evaluation +\newcount\T % temporary counter for arithmetic calculations +\T=0 + +% ********************************************************************** +% WARNING: Do not insert ANY aditional whitespace in these +% macros--otherwise it ends up in the TeX boxes and ruins the +% positioning, sigh.... +% ********************************************************************** + +% NAMEBOX{x}{y}{dx}{dy}{width}{height}{pos}{label} -- framed label with +% box lower-left corner at (x+dx,y+dy) +\newcommand{\NAMEBOX}[8]{\put(#1,#2){\begin{picture}(0,0)(-#3,-#4)\ignorespaces + \framebox(#5,#6)[#7]{#8}\end{picture}}} + +% HARROW{x}{y}{dx}{dy}{length}{side}{pos}{label} -- horizontal +% labeled arrow with left point at (x+dx,y+dy), label on bottom +% (side=b) or top (side=t) of arrow, in makebox[pos] +\newcommand{\HARROW}[8]{\put(#1,#2){\begin{picture}(0,0)(-#3,-#4)\ignorespaces + \put(0,0){\vector(1,0){#5}}\ignorespaces + \put(#5,0){\vector(-1,0){#5}}\ignorespaces + \ifthenelse{\equal{#6}{b}}{\ignorespaces + \put(0,-\TAD){\makebox(#5,0)[#7]{#8}} + }{\ignorespaces + \ifthenelse{\equal{#6}{t}}{}{\ignorespaces + \typeout{Side #6 must be ``b'' or ``t''--``t'' assumed}}\ignorespaces + \put(0,\TAD){\makebox(#5,0)[#7]{#8}} + } + \end{picture}}} + +% VARROW{x}{y}{dx}{dy}{length}{side}{pos}{label} -- vertical +% labeled arrow with left point at (x+dx,y+dy), label on left +% (side=l) or right (side=r) of arrow, in makebox[pos] +\newcommand{\VARROW}[8]{\put(#1,#2){\begin{picture}(0,0)(-#3,-#4)\ignorespaces + \put(0,0){\vector(0,1){#5}}\ignorespaces + \put(0,#5){\vector(0,-1){#5}}\ignorespaces + \ifthenelse{\equal{#6}{l}}{\ignorespaces + \put(-\TAD,0){\makebox(0,#5)[#7]{#8}} + }{\ignorespaces + \ifthenelse{\equal{#6}{r}}{}{\ignorespaces + \typeout{Side #6 must be ``r'' or ``l''--``r'' assumed}}\ignorespaces + \put(\TAD,0){\makebox(0,#5)[#7]{#8}} + } + \end{picture}}} + +% VRULE{x}{y}{dx}{dy}{length}{side}{pos}{label} -- vertical +% rule with left point at (x+dx,y+dy), label on left +% (side=l) or right (side=r) of rule, in makebox[pos] +\newcommand{\VRULE}[8]{\put(#1,#2){\begin{picture}(0,0)(-#3,-#4)\ignorespaces + \put(0,0){\line(0,1){#5}}\ignorespaces + \ifthenelse{\equal{#6}{l}}{\ignorespaces + \put(0,0){\makebox(0,#5)[#7]{$\rightarrow${}#8}} + }{\ignorespaces + \ifthenelse{\equal{#6}{r}}{}{\ignorespaces + \typeout{Side #6 must be ``r'' or ``l''--``r'' assumed}}\ignorespaces + \put(0,0){\makebox(0,#5)[#7]{$\leftarrow${}#8}} + } + \end{picture}}} +% ********************************************************************** +% If you wish to change any of these values: +% * definitions are mostly in alphabetical order +% * remember units are in centipoints for accurate +% positioning +% * most parameters are taken directly from values in +% BK11.STY, but in order to improve the appearance of the +% figure, a few have been increased to avoid overlap of +% labels and/or boxes, or to loosen up the figure +% * ALL parameters which depend on others are defined by +% computation and \xdef's below; they must NEVER be +% changed +% +%- For 11pt BOOK style, \textwidth / \pagewidth(8.5in) = 0.5294 +%- Anything larger than this will generate an overfull box. We +%- choose 0.50 since that makes scaling trivial for the reader +%- \newcommand{\UNITLENGTH}{0.005pt} +%- \newcommand{\SCALEFACTOR}{50\%} +% +%-----> We use a larger picture with 0.70 on our DIN-A4 paper: +\newcommand{\UNITLENGTH}{0.007pt} +\newcommand{\SCALEFACTOR}{70\%} +% <------------------------------ +% +% US papersize... +% +\newcommand{\PAGEHEIGHT}{79497} % 11in in centipoints +\newcommand{\PAGEWIDTH}{61430} % 8.5in in centipoints +% +% Typical dimensions from BK10.DOC +% +\newcommand{\BASELINESKIP}{2000} % really 1000, but this is + % too tight for the figure +\newcommand{\COLUMNSEP}{1000} +\newcommand{\COLUMNSEPRULE}{0} + +% DVI drivers put top left corner at (1in,1in) from physical page +% left corner +\newcommand{\DVIXOFFSET}{7227} +\newcommand{\DVIYOFFSET}{7227} + +\newcommand{\EVENSIDEMARGIN}{10841} + +\newcommand{\FOOTHEIGHT}{2400} % really 1200, but too tight +\newcommand{\FOOTNOTESEP}{665} +\newcommand{\FOOTSKIP}{4207} % really 2529, but too tight; for symmetry, + % make FOOTSKIP=HEADSEP+FOOTHEIGHT +\newcommand{\HEAdHEIGHT}{2400} % really 1200, but too tight +\newcommand{\HEADSEP}{1807} + +\newcommand{\MARGINPARPUSH}{2000} % really 500, but too tight +\newcommand{\MARGINPARSEP}{2800} % really 700, but too tight +\newcommand{\MARGINPARWIDTH}{7227} +\newcommand{\MARGINNOTEHEIGHT}{4444} % arbitrary value (holds + % ``Margin Note A'' on + % 2 lines) + +\newcommand{\ODDSIDEMARGIN}{3613} +% +% Upper left page corner (0,0) is at (1in,1in) on physical page +% for DVI drivers. Position the LOWER left corner at +% (\PAGEXORIGIN,\PAGEYORIGIN), where \PAGEYORIGIN is computed +% below +\newcommand{\PAGEXORIGIN}{\DVIXOFFSET} + +\newcommand{\TAD}{800} % how far to move labels from their arrows +\newcommand{\TEXTHEIGHT}{50400} +\newcommand{\TEXTWIDTH}{32522} +\newcommand{\TOPMARGIN}{5420} + +% ********************************************************************** +% DO NOT CHANGE any of these computed parameters +% + +% +\T=\TEXTWIDTH +\advance\T by -\COLUMNSEP +\divide\T by 2 +\xdef\COLUMNWIDTH{\the\T} + +\T=\TEXTWIDTH +\divide\T by 2 +\advance\T by \ODDSIDEMARGIN +\xdef\COLUMNXMIDDLE{\the\T} % 0.5*TEXTWIDTH+ODDSIDEMARGIN + +\T=\COLUMNWIDTH +\advance\T by \ODDSIDEMARGIN +\advance\T by \COLUMNSEP +\xdef\COLUMNTWOX{\the\T} % COLUMNWIDTH+COLUMNSEP+ODDSIDEMARGIN + +\T=\FOOTSKIP +\advance\T by \TEXTHEIGHT +\advance\T by \HEADSEP +\xdef\HEADYORIGIN{\the\T} % FOOTSKIP+TEXTHEIGHT+HEADSEP +% +% Inner TeX page dimensions are (\INNERWIDTH,\INNERHEIGHT). All TeX +% coordinates are relative to (0,0) at upper-left corner of this +% page, although for the figures, we put (0,0) at lower-left +% corner. +% +\T=\TOPMARGIN +\advance\T by \HEAdHEIGHT +\advance\T by \HEADSEP +\advance\T by \TEXTHEIGHT +\advance\T by \FOOTSKIP +% INNERHEIGHT=TOPMARGIN+HEAdHEIGHT+HEADSEP+TEXTHEIGHT+FOOTSKIP +\xdef\INNERHEIGHT{\the\T} + +\T=\ODDSIDEMARGIN +\advance\T by \TEXTWIDTH +\advance\T by \EVENSIDEMARGIN +\xdef\INNERWIDTH{\the\T} % ODDSIDEMARGIN+TEXTWIDTH+EVENSIDEMARGIN + +\T=\ODDSIDEMARGIN +\advance\T by \TEXTWIDTH +\advance\T by \MARGINPARSEP +\xdef\MARGINNOTEXORIGIN{\the\T} % ODDSIDEMARGIN+TEXTWIDTH+MARGINPARSEP + +\T=\TEXTHEIGHT +\multiply\T by 75 +\divide\T by 100 +\advance\T by \FOOTSKIP +\xdef\MARGINNOTEYA{\the\T} % .75*TEXTHEIGHT+FOOTSKIP + +\T=\MARGINNOTEYA +\advance\T by -\MARGINNOTEHEIGHT +\advance\T by -\MARGINPARPUSH +\xdef\MARGINNOTEYB{\the\T} % MARGINNOTEYA-MARGINNOTEHEIGHT-MARGINPARPUSH + +\T=\MARGINNOTEYA +\advance\T by \MARGINNOTEHEIGHT +\xdef\MARGINNOTEYC{\the\T} % MARGINNOTEYA+MARGINNOTEHEIGHT + +\T=\PAGEHEIGHT +\advance\T by -\DVIYOFFSET +\xdef\PAGEYTOP{\the\T} % PAGEHEIGHT-DVIYOFFSET + +\T=\PAGEYTOP +\advance\T by -\INNERHEIGHT +\xdef\PAGEYORIGIN{\the\T} % PAGEYTOP-INNERHEIGHT + +\T=\ODDSIDEMARGIN +\advance\T by \TEXTWIDTH +\xdef\RIGHTEDGE{\the\T} % ODDSIDEMARGIN+TEXTWIDTH + +\T=\TEXTHEIGHT +\multiply\T by 4 +\divide\T by 10 +\xdef\TEXTY{\the\T} % TEXTY = 0.4*TEXTHEIGHT (we put + % sample text here) + +\T=\TEXTHEIGHT +\divide\T by 3 +\xdef\TEXTWIDTHY{\the\T} % TEXTWIDTHY = TEXTHEIGHT/3 (we + % put \textwidth label here) + \begin{figure} + %%%%%%%%%%%%%% + + \caption{Seiten-Layout} + \label{bild} + + \begin{center} + \begin{small} % make text somewhat smaller + \setlength{\unitlength}{\UNITLENGTH} + \begin{picture}(\PAGEWIDTH,\PAGEHEIGHT) % sizes in centipoints + +% + \NAMEBOX{0}{0}{0}{0}{\PAGEWIDTH}{\PAGEHEIGHT}{}{} +% + \HARROW{0}{\PAGEYTOP}{0}{0}{\PAGEXORIGIN}{b}{}{1in} +% + \VARROW{\PAGEXORIGIN}{\PAGEYTOP}{0}{0}{\DVIYOFFSET}{r}{l}{1in} +% + \put(\PAGEXORIGIN,\PAGEYORIGIN){ + \begin{picture}(\INNERWIDTH,\INNERHEIGHT) + % Draw 3-sided inner page frame--no bottom side + % because it is not significant for dimensioning + \put(0,0){\line(0,1){\INNERHEIGHT}} + \put(0,\INNERHEIGHT){\line(1,0){\INNERWIDTH}} + \put(\INNERWIDTH,0){\line(0,1){\INNERHEIGHT}} +% + \NAMEBOX{\ODDSIDEMARGIN}{\TEXTY}{0}{0}{\TEXTWIDTH}{ + \BASELINESKIP}{l}{A line of text\ldots} + \NAMEBOX{\ODDSIDEMARGIN}{\TEXTY}{0}{-\BASELINESKIP}{ + \TEXTWIDTH}{\BASELINESKIP}{l}{Next line\ldots} +% + \VARROW{\COLUMNXMIDDLE}{\TEXTY}{0}{-\BASELINESKIP}{ + \BASELINESKIP}{r}{l}{\tt\string\baselinestretch + $\times$\string\baselineskip} +% + \HARROW{0}{\TEXTHEIGHT}{0}{0}{\ODDSIDEMARGIN}{t}{}{ + \tt\string\oddsidemargin} + \HARROW{0}{\TEXTHEIGHT}{0}{0}{\ODDSIDEMARGIN}{b}{}{ + \tt\string\evensidemargin} + % + % Page text label + \NAMEBOX{\ODDSIDEMARGIN}{\FOOTSKIP}{0}{0}{\TEXTWIDTH}{ + \TEXTHEIGHT}{}{Page Text} + % Page footer box, arrow, and label + \NAMEBOX{\ODDSIDEMARGIN}{0}{0}{0}{\TEXTWIDTH}{ + \FOOTHEIGHT}{}{Page Footer} + % + \VARROW{\ODDSIDEMARGIN}{0}{-\TAD}{0}{\FOOTHEIGHT}{l}{r}{ + \tt\string\footheight} + % + % Footskip arrow and label + \VARROW{\RIGHTEDGE}{0}{\TAD}{0}{\FOOTSKIP}{r}{l}{ + \tt\string\footskip} + % + \HARROW{\ODDSIDEMARGIN}{\TEXTWIDTHY}{0}{0}{\TEXTWIDTH}{b}{}{ + \tt\string\textwidth} + % + \VARROW{\ODDSIDEMARGIN}{\FOOTSKIP}{-\TAD}{0}{ + \TEXTHEIGHT}{l}{r}{\tt\string\textheight$\rightarrow$} + % + \VARROW{\ODDSIDEMARGIN}{\HEADYORIGIN}{-\TAD}{0}{ + \HEAdHEIGHT}{l}{r}{\tt\string\headHeight} + % + \VARROW{\RIGHTEDGE}{\HEADYORIGIN}{\TAD}{-\HEADSEP}{ + \HEADSEP}{r}{l}{\tt\string\headsep} + % + \VARROW{\RIGHTEDGE}{\INNERHEIGHT}{\TAD}{-\TOPMARGIN}{ + \TOPMARGIN}{r}{l}{\tt\string\topmargin} + % + \NAMEBOX{\ODDSIDEMARGIN}{\HEADYORIGIN}{0}{0}{\TEXTWIDTH}{ + \HEAdHEIGHT}{}{Page Header} + % + \NAMEBOX{\MARGINNOTEXORIGIN}{\MARGINNOTEYA}{0}{0}{ + \MARGINPARWIDTH}{\MARGINNOTEHEIGHT}{}{\shortstack{ + Margin\\note A}} + % + \VARROW{\MARGINNOTEXORIGIN}{\MARGINNOTEYA}{-\TAD}{ + -\MARGINPARPUSH}{\MARGINPARPUSH}{l}{r}{ + \tt\string\marginparpush} + % + \NAMEBOX{\MARGINNOTEXORIGIN}{\MARGINNOTEYB}{0}{0}{ + \MARGINPARWIDTH}{\MARGINNOTEHEIGHT}{}{\shortstack{Margin\\note B}} + % + \HARROW{\MARGINNOTEXORIGIN}{\MARGINNOTEYB}{0}{-\TAD}{ + \MARGINPARWIDTH}{b}{}{\tt\string\marginparwidth} + % + \HARROW{\MARGINNOTEXORIGIN}{\MARGINNOTEYC}{ + -\MARGINPARSEP}{\TAD}{\MARGINPARSEP}{t}{}{ + \tt\string\marginparsep} + % + \end{picture}} + \end{picture} + \end{small} + \end{center} + \end{figure} + %%%%%%%%%%%% + + \clearpage + %%%%%%%%%% + +\end{fullpage} +%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\section{Beschreibung der Dokumentklasse Refman} +\label{refman} + +Am EDV-Zentrum der TU Wien wurde -- aufbauend auf den in +den vorangegangenen Kapiteln angef"uhrten Grunds"atzen -- eine +Style-Option \texttt{refman} zu den \LaTeX-Styles \texttt{article} und +\texttt{report} entwickelt, die ein Layout f"ur Reference Manuals, technische +Beschreibungen und dergleichen realisiert. Das Layout entspricht im +wesentlichen den Angaben in Abschnitt~\ref{refmanex}: Die normalen +Textseiten haben einen breiten linken Rand, der f"ur "Uberschriften +und Randnoten ben"utzt wird, und nur einen eher knappen freien Rand +oben, rechts und unten. + +F"ur \LaTeX2e\ wurde diese Option in eine echte Class +umgewandelt. Dadurch ist es leichter m"oglich, verschiedene +Papierformate zu unterst"uzen. Au"serdem gibt es neben der +\texttt{report}-"ahnliche +\texttt{refrep}-Class\index{Refrep.cls} eine +\texttt{article}-"ahnliche +\texttt{refart}-Class\index{Refart.cls}, die sich durch andere +Eintr"age in Kopf- und Fu"s-Zeile sowie das Fehlen der +Gliederungsebene \texttt{chapter} von \texttt{refrep} +unterscheidet. + +Die derzeitige Version dieser Class wird im folgenden kurz in Hinblick +auf ihre Anwendeung beschrieben. Dies soll gleichzeitig als Beispiel +daf"ur dienen, welche "Anderungen und zus"atzliche Komponenten ein +typischer neuer \LaTeX-Style enthalten kann. + +Das vorliegende Handbuch wurde mit der Documentclass +\texttt{refart} gesetzt. Es ist also gleichzeitig ein Beispiel +f"ur das von dieser Class bewirkte Layout. + + +\subsection{Aufruf} +\index{Refart,Aufruf} +\index{Refrep,Aufruf} + +Im \LaTeX\ Local Guide ist jeweils angegeben, ob und wo dieses oder +ein "ahnliches Class-File in einer bestimmten +\LaTeX-""Installation verf"ugbar ist. Der Aufruf erfolgt durch die +Angabe der Class \texttt{refart} im Befehl \cs{documentclass}, +also \zB~mit +\begin{verbatim} +\documentclass[11pt,a4paper]{refart} +\usepackage{german} +\end{verbatim} + +\subsection{Optionen} +\index{Optionen} + +Die Class \texttt{refart} ersetzt die Class \texttt{article} und +die Class \texttt{refrep} die Class \texttt{report}. Sie kann +\emph{nicht} mit der folgenden Option verwendet werden: +\texttt{twocolumn}. + +Da es sich jetzt um eine selbstst"andige Class handelt, sind folgende +Optionen m"oglich: +\texttt{landscape}\index{Landscape}, +\texttt{square}\index{Square} +sowie die aus den Standard--Classes bekannten +Papiergr"o"sen-Optionen +\texttt{a4paper}\index{a4paper}, +\texttt{a5paper} oder auch die Optionen f"ur amerikanische +Formate. Die \texttt{square}-Option erzeugt ein quadratisches +Layout, bei dem die H"ohe auf die Papierbreite begrenzt wird. + +Sie \emph{kann} auch mit zahlreichen anderen Optionen kombiniert +werden, auch \zB\ mit \texttt{twoside} oder \texttt{fleqn}. Die +Option \texttt{titelpage} erzeugt bei der \texttt{refart}-Class +eine eigene Titelseite. Bei der Class \texttt{refrep} ist dies +die Standardeinstellung. + +Die Classes \texttt{refart} und \texttt{refrep} unter"-st"utzen nur +die einspaltige Ausgabe, die Befehle \cs{twocolumn} und +\cs{onecolumn} k"onnen in diesem Fall \emph{nicht} verwendet +werden. + +Der Index wird automatisch zweispaltig gesetzt. Das Layout entspricht +hier dem der Standard--Classes, allerdings mit kleinen "Uberschriften +wie im Rest des Dokumentes. + +\subsection{Layout-"Anderungen} + +\subsubsection{Seitenaufteilung} + +\index{Seitenaufteilung, horizontal}\marginlabel{Horizontal:} Die +komplette gen"utzte Breite (\cs{fullwidth}) berechnet sich so, da"s am +Papier rechts und links noch jeweils 1~Inch freier Rand bleiben. Die +Zeilenl"ange des normalen Textes (\cs{textwidth}) und alle davon +abgeleiteten Gr"o"sen betragen 70\% der \cs{fullwidth}. Die Breite des +Randes (\cs{leftmarginwidth}), der links vom normalen Textbereich f"ur +"Uberschriften und Randnoten verwendet wird, ergibt sich aus der +Differenz von \cs{fullwidth} und \cs{textwidth}. + +\index{Seitenaufteilung, vertikal}\marginlabel{Vertikal:} Die Texth"ohe +berechnet sich so, da"s ein oberer und unterer Rand von 1~Inch bleibt. +Manche Pagestyles verwenden einen anderen Wert f"ur den oberen Rand. +(siehe \ref{pagestyle}). + +Mit der Option \texttt{smallborder} wird der Rand auf 0,25~Inch verringert. + +Der Rand kann durch den Befehl +\verb|\setlength\papermarginwidth|\verb|{0.25in}| umdefiniert werden, +danach ist der Befehl \verb|\setpagefraction{0.7}| aufzurufen, um das +neue Layout zu berechnen. Dies funktioniert nur in der Pr"aambel. Die +Blattgr"o"se wird dem DVI-Treiber mitgeteilt, wenn die Option +\texttt{pagesize} angegeben wird. + +Es wird kein vertikaler Randausgleich gemacht (\cs{raggedbottom}). + +\subsubsection{Kapitel-"Uberschriften} + +Die "Uberschriften von \cs{section}, \cs{subsection} und +\cs{subsubsection} verwenden die gesamte Seitenbreite, \dH\ sie ragen in +den linken Rand hinaus. Daf"ur werden kleinere vertikale Abst"ande vor +und nach den "Uberschriften und eine weniger gro"se Schrift verwendet. +In den "Uberschriften werden keine Wort"-abteilungen und kein rechter +Randausgleich gemacht. + +Beim Style \texttt{refart} werden die von \cs{maketitle} und \cs{part} +erzeugten "Uberschriften im folgenden Layout gesetzt: Sie stehen am +Beginn einer neuen Seite (\cs{clearpage}), verwenden die gesamte Breite +und sind von zwei waagrechten Linien eingeschlossen. Der Befehl +\cs{maketitle} setzt die "Uberschrift (\cs{title}) und den Autor +(\cs{author}). Der Befehl \cs{makeauthor}, wird nicht mehr unterst"utzt. +Beim Befehl \cs{part} wird nur die r"omische Nummer des Abschnitts vor +den Text gesetzt (ohne das Wort "`Part"' oder "`Teil"'). + +Beim Style \texttt{refrep} werden Kapitel-"Uberschriften (\cs{chapter}) +im folgenden Layout gesetzt: Sie stehen am Beginn einer neuen Seite +(\cs{clearpage}), verwenden die gesamte Breite und sind von zwei +waagrechten Linien eingeschlossen. Die Befehle \cs{maketitle} und +\cs{part} bleiben in diesem Style unver"-"andert, es wird aber +empfohlen, sie in ein Fullpage-""Environment (siehe \ref{fullpage}) +einzu"-schlie"sen. + +\subsubsection{Abs"atze} + +Abs"atze werden durch einen vertikalen Abstand (\cs{parskip}) von einer +halben Zeile getrennt, ohne horizontale Einr"uckung (\cs{parindent} ist +Null). Der vertikale Abstand ent"-h"alt einen "`stretchable"' Anteil von +"`\texttt{plus 2pt}"'; dies ver"-gr"o"sert die Wahrscheinlichkeit, da"s +\LaTeX\ die am besten geeigneten Stellen f"ur alle Seitenwechsel findet. + +Die vertikalen Ab"-st"an"-de in den List-""Environments sind so gesetzt, +da"s sich vor, nach und innerhalb der Environments jeweils derselbe +Abstand wie zwischen den normalen Ab"-s"atzen ergibt. + +\subsection{Fu"snoten} + +Das Layout der Fu"snoten wurde an das Absatzlayout angepast, \dH\ auch +die Fu"snoten werden ohne Einzug in der ersten Zeile gesetzt. + +\subsubsection{Description-Environment} +\index{Description-Environment} + +Das \texttt{description}-Environment ist so abge"-"an"-dert, da"s +die Item-Labels den gesamten linken Rand verwenden. + +\seealso{Kapitel \ref{layout}} +Beispiele daf"ur finden sich unter anderem in Kapitel~\ref{layout}. + +\subsubsection{Positionierung der Randnoten} + +Randnoten (\cs{marginpar}) werden stets in den linken Rand gesetzt +und verwenden dessen gesamte Breite. + +Der minimale vertikale Abstand zwischen Randnoten (\cs{marginparpush}) +ist auf Null gesetzt, damit m"oglichst keine Verschiebung von Randnoten +erfolgt. + + +\subsubsection{Kopf- und Fu"szeilen, Pagestyles} \label{pagestyle} +\index{Pagestyles} + +Beim Pagestyle \texttt{plain} werden die Seitennummern in der +Fu"s"-zeile jeweils ganz rechts bzw.\ (auf linken Seiten bei der Option +\texttt{twoside}) ganz links au"sen gesetzt. + +\index{Headings} \index{Myheadings} Bei den Pagestyles \texttt{headings} +und \texttt{myheadings} wird ebenfalls die gesamte Breite verwendet, und +unter die Kopfzeile wird eine waagrechte Linie gesetzt. Beim Pagestyle +\texttt{ headings} enth"alt die Kopfzeile beim \texttt{refart} die +\verb|\section|-"""Uberschrift auf der linke und die +\verb|\subsection|-"""Uberschrift auf der linken Seite, beim +\texttt{refrep} die \verb|\chapter|-"""Uberschrift auf der linken und +die \verb|\section|-"""Uberschrift auf der rechten Seite. Die Schrift +wird in schr"ager (slanted) Schrift gesetzt. + +Seit Version 2.0~e wird f"ur die erste Seite eines Kapitels der +Pagestyle \texttt{empty} anstelle von \texttt{plain} verwendet. Bei +Verwendung des Pagestyles \texttt{headings} kamm es zu seltsamen +Effekten, wenn die erste Seite mit den Pagestyle \texttt{plain} ges"atzt +wurde. + +\index{Footings} +\index{Myfootings} +Zus"atzlich sind auch Pagestyles \texttt{footings} und \texttt{myfootings} +definiert, die entsprechende Fu"s"-zeilen (mit einer waagrechten Linie +dar"uber) setzen. Beispiel: Die folgenden Befehle setzen den Kurztitel des +Schrift"-st"ucks in die Fu"s"-zeile: +\begin{verse} +\verb|\pagestyle{myfootings}| \\* +\verb|\markboth{Kurztitel}{Kurztitel}| +\end{verse} + +Die Pagestyles \texttt{headings} und \texttt{myheadings} setzen den +oberen Rand auf einen etwas gr"o"seren Wert, um die leere Fu"s"-zeile +auszugleichen. Die Pagestyles \texttt{footings} und \texttt{myfootings} +setzen den oberen Rand auf einen etwas kleineren Wert, um die leere +Kopf"-zeile auszugleichen. Die Pagestyles \texttt{empty} und +\texttt{plain} lassen den Rand unver"-"andert. Daraus ergibt sich: +Innerhalb eines Schrift"-st"ucks kann manentweder zwischen den +Pagestyles \texttt{headings}, \texttt{myheadings} und \texttt{empty} +\newline oder zwischen den Pagestyles \texttt{footings}, +\texttt{ myfootings} und \texttt{empty} +wechseln, aber man sollte nicht zwischen \texttt{footings}- +\texttt{headings}- und \texttt{plain} Seiten wechseln. + + +\subsection{Zus"atzliche Befehle} + +\subsubsection{Marginlabel} +\index{Marginlabel} + +Der Befehl \verb|\marginlabel{xxx}| setzt das Wort oder den Text +\texttt{ xxx} rechts"-b"undig in den linken Rand. Dies kann f"ur +Stichworte, kurze "Uberschriften von Abs"atzen oder "ahnliches verwendet +werden. + +\marginlabel{Beispiel:}Das Wort "`Beispiel:"' links von diesem Absatz +ist ein Beispiel f"ur einen Marginlabel. + +\subsubsection{Attention} +\index{Attention}\index{Attentionsymbol}\index{manfnt} + +Der Befehl \verb|\attention| setzt ein Ausrufungszeichen in den linken +Rand. Dies dient zum Markieren wichtiger Abs"atze oder S"atze. + +\attention +Das ist ein Beispiel f"ur \verb|\attention|. + +\renewcommand{\attentionsymbol}{\texttt{:-)}} +\attention +Seit Version 2.0c ist es m"oglich das Symbol f"ur den +\cs{attention} Befehl mit Hilfe von +\verb|\renewcommand{\attentionsymbol}{\texttt\{:-)\}}| +zu ver"andern. Mit +\verb|\renewcommand{\attentionsymbol}|\\ \verb|{\large \bfseries ! $\rightarrow$}| +\renewcommand{\attentionsymbol}{\large \bfseries ! $\rightarrow$} +wird wieder auf das Originalverhalten zur"uckgeschaltet. + +Zus"atzlich unterst"utzt der \cs{attention} Befehl ein optionales +Argument um das Symbol im Rand einmalig durch ein anderes zu ers"atzen. +In diesem Fall ist es nicht notwendig, das \cs{attentionsymbol} +zur"uckzus"atzen. Diese Erweiterung dient vor allem zur Unterst"utzung +f"ur das \texttt{manfnt} Paket und sollte nicht zur Erzeugung eines +bunten Layouts mi"sbraucht werden.\attention[\texttt{:-(}] + +Mit dem \texttt{manfnt} Paket existiert eine einfache M"oglichkeit, um +auf die Symbole des \texttt{manfnt} Zeichensatzes zuzugreifen. Dieser +Zeichensatz enth"alt u.a. das "`Dangerous Bend"' und "`Double Dangerous +Bend"' Zeichen. + +\subsubsection{Seealso} +\index{Seealso} + +Der Befehl \verb|\seealso{n}| markiert einen Verweis auf ein Kapitel +oder eine Abbildung. + +Beispiele daf"ur finden sich nicht nur hier (am linken Rand) +sondern unter anderem auch in \seealso{Kapitel 1} Kapitel~1. + + +\subsubsection{Maxipage-Environment} +\index{Maxipage} + +Das \texttt{maxipage}-Environment ist eine Art von "`Minipage"', die +sich "uber die gesamte Seitenbreite erstreckt. Es eignet sich \zB\ +f"ur "uberlange mathematische Gleichungen oder breite Tabellen innerhalb +des Textes oder in "`Floats"' (\texttt{table} oder \texttt{figure}). +Innerhalb der "`Maxipage"' sind keine Seitenwechsel und keine Randnoten +m"oglich. Beginn und Ende des \texttt{maxipage}-Envrionment bewirken +jeweils einen neuen Absatz und eine waagrechte Linie. + +Hier folgt nun ein Beispiel f"ur eine Maxipage.\nopagebreak +\begin{maxipage} +Diese "uberlangen Zeilen sind der Inhalt der Maxipage. Sie erstrecken +sich "uber die gesamte Seitenbreite, ohne linken +Rand. +\end{maxipage}\nopagebreak +Dies ist der normale Text nach dem Ende der Maxipage. + +\subsubsection{Fullpage-Environment} \label{fullpage} +\index{Fullpage} + +Das \texttt{fullpage}-Environment besteht aus einer oder mehreren +Seiten, bei denen sich der Text "uber die gesamte Seitenbreite erstreckt +und kein linker Rand bleibt. Randnoten sind darin nicht m"oglich. Beginn +und Ende des \texttt{fullpage}-Envrionment bewirken jeweils einen +Seitenwechsel (\verb|\clearpage|). + +Dies eignet sich f"ur Spezialseiten wie mehrseitige gro"se +Tabellen, Programmlistings, Titelseiten, Inhaltsverzeichnisse und +"ahnliches. + +\seealso{Seite \pageref{bild}} +Seite~\pageref{bild} ist ein Beispiel f"ur eine Fullpage. + +\subsubsection{Noparskip} + +Der Befehl \verb|\noparskip| entfernt den vertikalen Abstand vor einem +Absatz -- analog zum Befehl \verb|\noindent|, der die horizontale +Einr"uckung am Beginn eines Absatzes entfernt. + +\subsubsection{Setleftmarginwidth} +\index{Setleftmarginwidth} + +Der Befehl \verb|\setleftmarginwidth| wird nicht mehr unterst"utzt. +Stattdessen kann mit dem Befehl \verb|\settextfraction| der +Anteil des Textes (normalerweise 70~\%) ge"andert werden. Das +Argument mu"s zwischen 0 und 1 liegen. + +\subsubsection{Descriptioncolon} +\index{Descriptioncolon} + +Der Doppelpunkt in einer \texttt{description} kann durch den Befehl +\verb|\descriptioncolonfalse| ab und durch \verb|\descriptioncolontrue| +wieder eingeschaltet werden. Im Normalfall ist der Doppelpunkt +eingeschaltet. + +\subsubsection{Descriptionleft} +\index{Descriptionleft} + +Mit \verb|\descriptionlefttrue| wird der Label f"ur eine +\texttt{description} linksb"undig in den Rand gesetzt. Der Normalfall ist +rechtsb"undig, dies wird durch \verb|\descriptionleftfalse| erreicht. + +\subsubsection{Maxipagerule} +\index{Maxipagerule} + +Mit \verb|\maxipagerulefalse| lassen sich die Striche vor und nach +einer \texttt{maxipage} abschalten. Sie sind normalerweise aktiv. + +\subsubsection{Condbreak} +\index{Condbreak} + +Mit \verb|\condbreak{2cm}| wird sichergestellt, da"s die n"achsten 2~cm +nicht getrennt werden. Sie erscheinen entweder auf der aktuellen Seite +oder werden komplett auf die neue Seite umgebrochen. + +\subsubsection{Example} +\index{Example} + +Die \texttt{example}-Umgebung erzeugt eine \texttt{verse}-Umgebung, schaltet +allerdings auf \texttt{tt} und versucht einen Seitenumbruch vor der +Umgebung zu vermeiden. + +\subsubsection{Pageperchapter} +\index{Pageperchapter} + +Der Befehl \verb|\pageperchapter| erzeugt eine kapitelweise +Seitennumerierung. Dies ist besonders f"ur umfangreiches +Reference Manuals sinnvoll. Da nur \texttt{refrep} "uber die +Gliederungsebene \texttt{chapter} verf"ugt, ist dieser Befehl +auch nur hier m"oglich. + +\subsubsection{Smallborder} +\index{Smallborder} + +Der normale Seitenrand betr"agt 1~inch (25,4~mm). Das ist f"ur ein gedrucktes +Dokument in Ordnung, f"ur die Betrachtung auf dem Monitor aber verschwendete +Bildschirmfl"ache. Die Option \verb|smallborder| reduziert den Rand auf 0,25~inch +(6,35~mm). Damit klebt der Text noch nicht am Rand, es wird aber auch nicht +zu viel Bildschirmfl"ache verschenkt. + +Der Rand kann durch den Befehl \verb|\setlength\papermarginwidth|\verb|{0.25in}| +umdefiniert werden, danach ist der Befehl \verb|\setpagefraction{0.7}| +aufzurufen, um das neue Layout zu berechnen. + +\subsubsection{Dvips} +\index{Dvips} + +Die Option \verb|dvips| teilt DVIPS die aktuelle Blattgr"o"se mit. + +\subsubsection{Pdftex} +\index{Pdftex} + +Die Option \verb|pdftex| teilt PDFTEX die aktuelle Blattgr"o"se mit. + +\subsubsection{Pagesize} +\index{Pagesize} + +Pagesize w"ahlt automatisch den passenden Befehl f"ur den jeweiligen +DVI-Treiber. Dies funktioniert bei DVIPS und DVIPDFMX f"ur DVI-Ausgabe und +PDF\TeX f"ur PDF-Ausgabe. + +\subsubsection{Ifpdfoutput} +\index{Ifpdfoutput} + +Mit dem Befehl \verb|\ifpdfoutput{pdftext}{dvitext}| k"onnen Texte abh"angig +vom Ausgabeformat ges"atzt werden. Die Option \verb|pagesize| nutzt diesen +Befehl. + +Die letzten vier Befehle wurden aus KOMA-Script "ubernommen, vielen Dank +Markus! +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput + diff --git a/macros/latex/contrib/refman/lay_e2.tex b/macros/latex/contrib/refman/lay_e2.tex new file mode 100644 index 0000000000..9590edbfb4 --- /dev/null +++ b/macros/latex/contrib/refman/lay_e2.tex @@ -0,0 +1,806 @@ +% LAY_e2.TEX - Anhang von LAYOUT.TEX (PA 1988) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\clearpage + +\section*{Appendix} +\addcontentsline{toc}{section}{Appendix} + +\appendix + +\section{The page structure in \LaTeX} + +This appendix describes how the actual page is build from its +components and how they are influenced by \TeX{}'s parameters. +(\seealso{Fig.\,\ref{bild}} Figure~\ref{bild} has been created by +Nelson Beebe at the University of Utah.) + +\begin{description} + +\item[text area] + The normal text area (``Body'') contains the running text + including footnotes, tables and figures. The headings, footer + and margin notes do \emph{not} belong to the text area. + + The text area has the width \cs{textwidth} + and the height \cs{text\-height}. + + In a two column layout the text area is split into two columns, with + the width \cs{columnwidth} each and a space of \cs{columnsep} between + them. Thus the \cs{columnwidth} is a little bit smaller than half + the \cs{textwidth}. + + \cs{textwidth} and \cs{columnwidth} should be a multiple of the + width of one character in the \texttt{tt} font. + + \cs{textheight} should be multiple of the line height + \cs{baselineskip}, increased by the constant value of \cs{topskip}. + + Indentations inside the text area are defined with \cs{leftskip} and + \cs{rightskip}. These parameters should not be changed explicitly + by the user but rather implicitly through environments. + +\item[left margin] + The left margin is either \cs{odd-} or \cs{evensidemargin} plus + 1~inch. Both parameters have the same value, unless the + \texttt{twoside} option is given. + +\item[top margin] + The top margin is the sum of \cs{topmargin}, \cs{headheight} and + \cs{headsep} plus 1~inch. + +\item[right margin] + The right margin is the paper width minus the left margin and + the text area. + +\item[bottom margin] + The bottom margin is the paper height minus the top margin and + the text area. + +\item[heading]\index{headings} + The heading is inside the top margin with a space of \cs{headsep} + between the lower border of the header and the upper border of the + text area. Above the header is a free space of \cs{topmargin} + increased by 1~inch. + +\item[footing]\index{footings} The footer is inside the bottom margin with a + space of \cs{footskip} between the lower border + of the text area and the lower border of the footer. + +\item[margin notes]\index{margin notes} Margin notes are inside the left or + right margin. They have a width of \cs{marginparwidth} and a space + of \cs{marginparsep} between the margin note and the text area. The + vertical space between two margin notes is \cs{marginparpush}. + +\end{description} + +The \texttt{paperheight} consists of the following elements (from top to +bottom): +\begin{verse} +1 inch \\*[2pt] +\cs{topmargin} \\*[2pt] +\cs{headheight} \\*[2pt] +\cs{headsep} \\*[2pt] +\cs{textheight} \\*[2pt] +\cs{footskip} \\*[2pt] +remaining page. +\end{verse} + +On pages with margin notes in the right margin the \texttt{paperwidth} consists +of the following elements: +\begin{verse} +1 inch\\*[2pt] +\cs{oddsidemargin} +\ \ or\ \ +\cs{evensidemargin}\\*[2pt] +\cs{textwidth}\\*[2pt] +\cs{marginparsep}\\*[2pt] +\cs{marginparwidth}\\*[2pt] +remaining page +\end{verse} +With the option \texttt{twoside} the left pages change to +\begin{verse} +1 inch\\*[2pt] +\cs{evensidemargin}\\*[2pt] +\cs{textwidth}\\*[2pt] +remaining page +\end{verse} + +\marginlabel{Comments:} The parameters \cs{topmargin}, \cs{oddsidemargin}, +and \cs{evensidemargin} may be negative. In this case, the margin will be +smaller than 1~inch. The same is true for \cs{leftskip} and \cs{rightskip} +which leads to text that is wider than the text area. + +Extensive treatment and figures to this subject may be found in the +\textsc{TUGboat} Vol.9, No.1 (April 1988). + +The parameter \cs{footheight} is no longer defined +in \LaTeXe\ since no-one used it. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{fullpage} +%%%%%%%%%%%%%%%% + + +% Bild von Nelson Beebe, mit geringen "Anderungen von PA: +\newcommand{\X}[1]{{#1}\index{{#1}}} +% NB: For computed dimension parameters, we cannot use +% \newcommand{}, because this expands to a TeX \def which does +% not evaluate the definition before assigning it to the control +% sequence name; we use \xdef directly to force evaluation +\newcount\T % temporary counter for arithmetic calculations +\T=0 + +% ********************************************************************** +% WARNING: Do not insert ANY aditional whitespace in these +% macros--otherwise it ends up in the TeX boxes and ruins the +% positioning, sigh.... +% ********************************************************************** + +% NAMEBOX{x}{y}{dx}{dy}{width}{height}{pos}{label} -- framed label with +% box lower-left corner at (x+dx,y+dy) +\newcommand{\NAMEBOX}[8]{\put(#1,#2){\begin{picture}(0,0)(-#3,-#4)\ignorespaces + \framebox(#5,#6)[#7]{#8}\end{picture}}} + +% HARROW{x}{y}{dx}{dy}{length}{side}{pos}{label} -- horizontal +% labeled arrow with left point at (x+dx,y+dy), label on bottom +% (side=b) or top (side=t) of arrow, in makebox[pos] +\newcommand{\HARROW}[8]{\put(#1,#2){\begin{picture}(0,0)(-#3,-#4)\ignorespaces + \put(0,0){\vector(1,0){#5}}\ignorespaces + \put(#5,0){\vector(-1,0){#5}}\ignorespaces + \ifthenelse{\equal{#6}{b}}{\ignorespaces + \put(0,-\TAD){\makebox(#5,0)[#7]{#8}} + }{\ignorespaces + \ifthenelse{\equal{#6}{t}}{}{\ignorespaces + \typeout{Side #6 must be ``b'' or ``t''--``t'' assumed}}\ignorespaces + \put(0,\TAD){\makebox(#5,0)[#7]{#8}} + } + \end{picture}}} + +% VARROW{x}{y}{dx}{dy}{length}{side}{pos}{label} -- vertical +% labeled arrow with left point at (x+dx,y+dy), label on left +% (side=l) or right (side=r) of arrow, in makebox[pos] +\newcommand{\VARROW}[8]{\put(#1,#2){\begin{picture}(0,0)(-#3,-#4)\ignorespaces + \put(0,0){\vector(0,1){#5}}\ignorespaces + \put(0,#5){\vector(0,-1){#5}}\ignorespaces + \ifthenelse{\equal{#6}{l}}{\ignorespaces + \put(-\TAD,0){\makebox(0,#5)[#7]{#8}} + }{\ignorespaces + \ifthenelse{\equal{#6}{r}}{}{\ignorespaces + \typeout{Side #6 must be ``r'' or ``l''--``r'' assumed}}\ignorespaces + \put(\TAD,0){\makebox(0,#5)[#7]{#8}} + } + \end{picture}}} + +% VRULE{x}{y}{dx}{dy}{length}{side}{pos}{label} -- vertical +% rule with left point at (x+dx,y+dy), label on left +% (side=l) or right (side=r) of rule, in makebox[pos] +\newcommand{\VRULE}[8]{\put(#1,#2){\begin{picture}(0,0)(-#3,-#4)\ignorespaces + \put(0,0){\line(0,1){#5}}\ignorespaces + \ifthenelse{\equal{#6}{l}}{\ignorespaces + \put(0,0){\makebox(0,#5)[#7]{$\rightarrow${}#8}} + }{\ignorespaces + \ifthenelse{\equal{#6}{r}}{}{\ignorespaces + \typeout{Side #6 must be ``r'' or ``l''--``r'' assumed}}\ignorespaces + \put(0,0){\makebox(0,#5)[#7]{$\leftarrow${}#8}} + } + \end{picture}}} +% ********************************************************************** +% If you wish to change any of these values: +% * definitions are mostly in alphabetical order +% * remember units are in centipoints for accurate +% positioning +% * most parameters are taken directly from values in +% BK11.STY, but in order to improve the appearance of the +% figure, a few have been increased to avoid overlap of +% labels and/or boxes, or to loosen up the figure +% * ALL parameters which depend on others are defined by +% computation and \xdef's below; they must NEVER be +% changed +% +%- For 11pt BOOK style, \textwidth / \pagewidth(8.5in) = 0.5294 +%- Anything larger than this will generate an overfull box. We +%- choose 0.50 since that makes scaling trivial for the reader +%- \newcommand{\UNITLENGTH}{0.005pt} +%- \newcommand{\SCALEFACTOR}{50\%} +% +%-----> We use a larger picture with 0.70 on our DIN-A4 paper: +\newcommand{\UNITLENGTH}{0.007pt} +\newcommand{\SCALEFACTOR}{70\%} +% <------------------------------ +% +% US papersize... +% +\newcommand{\PAGEHEIGHT}{79497} % 11in in centipoints +\newcommand{\PAGEWIDTH}{61430} % 8.5in in centipoints +% +% Typical dimensions from BK10.DOC +% +\newcommand{\BASELINESKIP}{2000} % really 1000, but this is + % too tight for the figure +\newcommand{\COLUMNSEP}{1000} +\newcommand{\COLUMNSEPRULE}{0} + +% DVI drivers put top left corner at (1in,1in) from physical page +% left corner +\newcommand{\DVIXOFFSET}{7227} +\newcommand{\DVIYOFFSET}{7227} + +\newcommand{\EVENSIDEMARGIN}{10841} + +\newcommand{\FOOTHEIGHT}{2400} % really 1200, but too tight +\newcommand{\FOOTNOTESEP}{665} +\newcommand{\FOOTSKIP}{4207} % really 2529, but too tight; for symmetry, + % make FOOTSKIP=HEADSEP+FOOTHEIGHT +\newcommand{\HEAdHEIGHT}{2400} % really 1200, but too tight +\newcommand{\HEADSEP}{1807} + +\newcommand{\MARGINPARPUSH}{2000} % really 500, but too tight +\newcommand{\MARGINPARSEP}{2800} % really 700, but too tight +\newcommand{\MARGINPARWIDTH}{7227} +\newcommand{\MARGINNOTEHEIGHT}{4444} % arbitrary value (holds + % ``Margin Note A'' on + % 2 lines) + +\newcommand{\ODDSIDEMARGIN}{3613} +% +% Upper left page corner (0,0) is at (1in,1in) on physical page +% for DVI drivers. Position the LOWER left corner at +% (\PAGEXORIGIN,\PAGEYORIGIN), where \PAGEYORIGIN is computed +% below +\newcommand{\PAGEXORIGIN}{\DVIXOFFSET} + +\newcommand{\TAD}{800} % how far to move labels from their arrows +\newcommand{\TEXTHEIGHT}{50400} +\newcommand{\TEXTWIDTH}{32522} +\newcommand{\TOPMARGIN}{5420} + +% ********************************************************************** +% DO NOT CHANGE any of these computed parameters +% + +% +\T=\TEXTWIDTH +\advance\T by -\COLUMNSEP +\divide\T by 2 +\xdef\COLUMNWIDTH{\the\T} + +\T=\TEXTWIDTH +\divide\T by 2 +\advance\T by \ODDSIDEMARGIN +\xdef\COLUMNXMIDDLE{\the\T} % 0.5*TEXTWIDTH+ODDSIDEMARGIN + +\T=\COLUMNWIDTH +\advance\T by \ODDSIDEMARGIN +\advance\T by \COLUMNSEP +\xdef\COLUMNTWOX{\the\T} % COLUMNWIDTH+COLUMNSEP+ODDSIDEMARGIN + +\T=\FOOTSKIP +\advance\T by \TEXTHEIGHT +\advance\T by \HEADSEP +\xdef\HEADYORIGIN{\the\T} % FOOTSKIP+TEXTHEIGHT+HEADSEP +% +% Inner TeX page dimensions are (\INNERWIDTH,\INNERHEIGHT). All TeX +% coordinates are relative to (0,0) at upper-left corner of this +% page, although for the figures, we put (0,0) at lower-left +% corner. +% +\T=\TOPMARGIN +\advance\T by \HEAdHEIGHT +\advance\T by \HEADSEP +\advance\T by \TEXTHEIGHT +\advance\T by \FOOTSKIP +% INNERHEIGHT=TOPMARGIN+HEAdHEIGHT+HEADSEP+TEXTHEIGHT+FOOTSKIP +\xdef\INNERHEIGHT{\the\T} + +\T=\ODDSIDEMARGIN +\advance\T by \TEXTWIDTH +\advance\T by \EVENSIDEMARGIN +\xdef\INNERWIDTH{\the\T} % ODDSIDEMARGIN+TEXTWIDTH+EVENSIDEMARGIN + +\T=\ODDSIDEMARGIN +\advance\T by \TEXTWIDTH +\advance\T by \MARGINPARSEP +\xdef\MARGINNOTEXORIGIN{\the\T} % ODDSIDEMARGIN+TEXTWIDTH+MARGINPARSEP + +\T=\TEXTHEIGHT +\multiply\T by 75 +\divide\T by 100 +\advance\T by \FOOTSKIP +\xdef\MARGINNOTEYA{\the\T} % .75*TEXTHEIGHT+FOOTSKIP + +\T=\MARGINNOTEYA +\advance\T by -\MARGINNOTEHEIGHT +\advance\T by -\MARGINPARPUSH +\xdef\MARGINNOTEYB{\the\T} % MARGINNOTEYA-MARGINNOTEHEIGHT-MARGINPARPUSH + +\T=\MARGINNOTEYA +\advance\T by \MARGINNOTEHEIGHT +\xdef\MARGINNOTEYC{\the\T} % MARGINNOTEYA+MARGINNOTEHEIGHT + +\T=\PAGEHEIGHT +\advance\T by -\DVIYOFFSET +\xdef\PAGEYTOP{\the\T} % PAGEHEIGHT-DVIYOFFSET + +\T=\PAGEYTOP +\advance\T by -\INNERHEIGHT +\xdef\PAGEYORIGIN{\the\T} % PAGEYTOP-INNERHEIGHT + +\T=\ODDSIDEMARGIN +\advance\T by \TEXTWIDTH +\xdef\RIGHTEDGE{\the\T} % ODDSIDEMARGIN+TEXTWIDTH + +\T=\TEXTHEIGHT +\multiply\T by 4 +\divide\T by 10 +\xdef\TEXTY{\the\T} % TEXTY = 0.4*TEXTHEIGHT (we put + % sample text here) + +\T=\TEXTHEIGHT +\divide\T by 3 +\xdef\TEXTWIDTHY{\the\T} % TEXTWIDTHY = TEXTHEIGHT/3 (we + % put \textwidth label here) + \begin{figure} + %%%%%%%%%%%%%% + + \caption{Page layout} + \label{bild} + + \begin{center} + \begin{small} % make text somewhat smaller + \setlength{\unitlength}{\UNITLENGTH} + \begin{picture}(\PAGEWIDTH,\PAGEHEIGHT) % sizes in centipoints + +% + \NAMEBOX{0}{0}{0}{0}{\PAGEWIDTH}{\PAGEHEIGHT}{}{} +% + \HARROW{0}{\PAGEYTOP}{0}{0}{\PAGEXORIGIN}{b}{}{1in} +% + \VARROW{\PAGEXORIGIN}{\PAGEYTOP}{0}{0}{\DVIYOFFSET}{r}{l}{1in} +% + \put(\PAGEXORIGIN,\PAGEYORIGIN){ + \begin{picture}(\INNERWIDTH,\INNERHEIGHT) + % Draw 3-sided inner page frame--no bottom side + % because it is not significant for dimensioning + \put(0,0){\line(0,1){\INNERHEIGHT}} + \put(0,\INNERHEIGHT){\line(1,0){\INNERWIDTH}} + \put(\INNERWIDTH,0){\line(0,1){\INNERHEIGHT}} +% + \NAMEBOX{\ODDSIDEMARGIN}{\TEXTY}{0}{0}{\TEXTWIDTH}{ + \BASELINESKIP}{l}{A line of text\ldots} + \NAMEBOX{\ODDSIDEMARGIN}{\TEXTY}{0}{-\BASELINESKIP}{ + \TEXTWIDTH}{\BASELINESKIP}{l}{Next line\ldots} +% + \VARROW{\COLUMNXMIDDLE}{\TEXTY}{0}{-\BASELINESKIP}{ + \BASELINESKIP}{r}{l}{\tt\string\baselinestretch + $\times$\string\baselineskip} +% + \HARROW{0}{\TEXTHEIGHT}{0}{0}{\ODDSIDEMARGIN}{t}{}{ + \tt\string\oddsidemargin} + \HARROW{0}{\TEXTHEIGHT}{0}{0}{\ODDSIDEMARGIN}{b}{}{ + \tt\string\evensidemargin} + % + % Page text label + \NAMEBOX{\ODDSIDEMARGIN}{\FOOTSKIP}{0}{0}{\TEXTWIDTH}{ + \TEXTHEIGHT}{}{Page Text} + % Page footer box, arrow, and label + \NAMEBOX{\ODDSIDEMARGIN}{0}{0}{0}{\TEXTWIDTH}{ + \FOOTHEIGHT}{}{Page Footer} + % + \VARROW{\ODDSIDEMARGIN}{0}{-\TAD}{0}{\FOOTHEIGHT}{l}{r}{ + \tt\string\footheight} + % + % Footskip arrow and label + \VARROW{\RIGHTEDGE}{0}{\TAD}{0}{\FOOTSKIP}{r}{l}{ + \tt\string\footskip} + % + \HARROW{\ODDSIDEMARGIN}{\TEXTWIDTHY}{0}{0}{\TEXTWIDTH}{b}{}{ + \tt\string\textwidth} + % + \VARROW{\ODDSIDEMARGIN}{\FOOTSKIP}{-\TAD}{0}{ + \TEXTHEIGHT}{l}{r}{\tt\string\textheight$\rightarrow$} + % + \VARROW{\ODDSIDEMARGIN}{\HEADYORIGIN}{-\TAD}{0}{ + \HEAdHEIGHT}{l}{r}{\tt\string\headheight} + % + \VARROW{\RIGHTEDGE}{\HEADYORIGIN}{\TAD}{-\HEADSEP}{ + \HEADSEP}{r}{l}{\tt\string\headsep} + % + \VARROW{\RIGHTEDGE}{\INNERHEIGHT}{\TAD}{-\TOPMARGIN}{ + \TOPMARGIN}{r}{l}{\tt\string\topmargin} + % + \NAMEBOX{\ODDSIDEMARGIN}{\HEADYORIGIN}{0}{0}{\TEXTWIDTH}{ + \HEAdHEIGHT}{}{Page Header} + % + \NAMEBOX{\MARGINNOTEXORIGIN}{\MARGINNOTEYA}{0}{0}{ + \MARGINPARWIDTH}{\MARGINNOTEHEIGHT}{}{\shortstack{ + Margin\\note A}} + % + \VARROW{\MARGINNOTEXORIGIN}{\MARGINNOTEYA}{-\TAD}{ + -\MARGINPARPUSH}{\MARGINPARPUSH}{l}{r}{ + \tt\string\marginparpush} + % + \NAMEBOX{\MARGINNOTEXORIGIN}{\MARGINNOTEYB}{0}{0}{ + \MARGINPARWIDTH}{\MARGINNOTEHEIGHT}{}{\shortstack{Margin\\note B}} + % + \HARROW{\MARGINNOTEXORIGIN}{\MARGINNOTEYB}{0}{-\TAD}{ + \MARGINPARWIDTH}{b}{}{\tt\string\marginparwidth} + % + \HARROW{\MARGINNOTEXORIGIN}{\MARGINNOTEYC}{ + -\MARGINPARSEP}{\TAD}{\MARGINPARSEP}{t}{}{ + \tt\string\marginparsep} + % + \end{picture}} + \end{picture} + \end{small} + \end{center} + \end{figure} + %%%%%%%%%%%% + + \clearpage + %%%%%%%%%% + +\end{fullpage} +%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\section{Description of the refman-class family} +\label{refman} + +The \texttt{refman.sty} was defined at the EDV-Zentrum (computing center) of +the TU\footnote{Technical University} Wien. This layout is suitable for +reference manuals, technical descriptions and similar applications. It is +based on the ideas shown in previous sections: The layout has a wide left +margin for headings and margin notes and smaller margins on the right side, +the top and the bottom. + +In 1994 this layout was re-implemented as a class for the new \LaTeXe. +This made it possible to include some minor improvements, such as the +support of different paper sizes. The \texttt{refman.sty} was split +into two classes +\texttt{refrep}\index{refrep.cls}, similar to \texttt{report} and +\texttt{refart}\index{refart.cls}, similar to \texttt{article}. +These classes differ in the layout of the header and footer. The +\texttt{refart} does not support the \cs{chapter} command. + +The current version of both classes is described in this document. It +serves as an example for the layout. + + +\subsection{Invocation} +\index{refart, invocation} +\index{refrep, invocation} + +The \LaTeX\ local guide (if available) shows if this class is available +at your \TeX\ installation or where to install it. To use the +\texttt{refart} class, simply call it with the \cs{documentclass} +command: + +\begin{verbatim} +\documentclass[11pt,a4paper]{refart} +\usepackage{german} % other packages you may want +\end{verbatim} + +\subsection{Options} +\index{options} + +The \texttt{refart} class replaces \texttt{article} and \texttt{refrep} +replaces \texttt{report}. They support all options of these classes +except for the \texttt{twocolumn} option. + +It supports the additional option \texttt{square} which makes the +\cs{textheight} equal to the \cs{textwidth}. + +Neither \texttt{refart} nor \texttt{refrep} support two column layout, thus +the commands \cs{twocolumn} and \cs{onecolumn} must not be used. + +The index will be set in two column format and you can't change it +with the means of this class. + +\subsection{Layout changes} + +\subsubsection{Page design} + +\index{page design, horizontal}\marginlabel{Horizontal:} +In this design the usable area for text (\cs{fullwidth}) is +calculated as the paper width minus 2~\cs{papermarginwidth}. The default +value for \cs{papermarginwidth}\index{papermarginwidth} is 1~Inch. + +The option \texttt{smallborder} reduces \cs{papermarginwidth} to 0.25~Inch. +This is more suitable for documents viewed on screen, especially when +combined with the \texttt{a5paper} and \texttt{landscape} options. + +Only a fraction of this width is used for the running text (\cs{textwidth}), +the remaining part forms a wide left margin (\cs{leftmarginwidth}) which is +used for headings and margin notes. The \cs{textwidth} is 70~\% of the +\cs{fullwidth} by default, but this can be changed with the +\cs{settextfraction} command\index{settextfraction} which accepts arguments +between 0 and 1. + +\index{page design, vertical}\marginlabel{Vertical:} The text height is +calculated as the paper height minus 2~\cs{papermarginwidth}. The +\texttt{topmargin} is modified by some pagestyles. (see \ref{pagestyle}). + +The pages are always set with a ragged bottom. + +\subsubsection{Section headings} + +The headings for \cs{section}, \cs{subsection}, and +\cs{subsubsection} extend into the left margin, thus using the full +width of the page. They are not justified and hyphenation is +discouraged. A small space is kept free above and below the heading. +Headings for \cs{section} and \cs{subsection} are set in a bold +font. + +The \texttt{refrep} class defines a different layout for the +\cs{chapter} command: It always starts a new page and prints the +chapter headings in a large bold font with a thick line above and +below. This heading uses the full width of the page. + +A similar heading is created by the \cs{part} commands which is +available in both classes. It uses a roman part number instead of the +arabic section number. + +The \cs{maketitle} commands sets the title of the document in the +same layout when no special title page is requested. (This is the +default for \texttt{refart}. To suppress the title page in a +\texttt{refrep} document, you can use the \texttt{notitlepage} option.) +The name of the author and the date is printed in italic flush right +below the document title. + +\subsubsection{Paragraphs} + +Paragraphs are separated by a vertical space (\cs{parskip}) of +half a line (\verb|0.5\baselineskip|) plus a stretchable length of 2~pt. +Paragraphs are not indented. + +The vertical spacing inside, above and below a list environment is the +same as in the running text. + +\subsection{Footnotes}\index{footnote} + +The footnote layout consists of a small margin (1em) which contains +the footnote symbol. A small space is set between the symbol and the +footnote text. The paragraphs of the footnote are not indented. There +is currently no space between two footnotes, I'm not sure it this will +stay this way. The footnote symbol is set as a superscript. This may +change in later versions. I'm relying on user feedback to finally +solve this. + +\subsubsection{Description environment} +\index{description environment} + +The \texttt{description} environment will use the whole left margin +for the description label. + +\seealso{Section \ref{layout}} +You will find examples in the section~\ref{layout}. + +\subsubsection{Positioning of margin notes} + +Margin notes (\cs{marginpar}) are always put into the left margin. +They use the whole width of the margin. + +The minimum space between two margin notes is set to 0 to prevent +them from being shifted around when many margin notes are used. + +\subsubsection{Headers and Footers} \label{pagestyle} +\index{pagestyle} + +The page style \texttt{plain} puts the page number into the footer in +the right corner. When the option \texttt{twoside} is active, the page +number of left pages is put into the left corner. + +\index{headings} \index{myheadings} The pagestyles \texttt{headings} and +\texttt{myheadings} create a header which spans the whole width of the page. +The headings contain the running head (\cs{section} and \cs{subsection} in +\texttt{refart} and \cs{chapter} and \cs{section} in \texttt{refrep}) when +\texttt{headings} is used or a fixed text that can defined with the +\cs{markboth} command when \texttt{myheadings} is used. The heading will be +set in a slanted font and separated from the body by a thin line. + +\index{footings} +\index{myfootings} +In addition to the standard classes, \texttt{refman} supports a style +for footers, which is used in this documentation. The information is +exactly the same as in the headings but now printed in the footer with +a thin line above. + +To use a user-defined string you can say: +\begin{verbatim} +\pagestyle{myfootings} % or myheadings +\markboth{left title}{right title} +\end{verbatim} + +The \texttt{heading} and \texttt{myheading} commands increase the top margin +by one line while the \texttt{footings} and \texttt{myfootings} commands +decrease the top margin by one line. The page styles \texttt{empty} and +\texttt{plain} leave the top margin unchanged. You should not combine +headings and footings in one document. + +User feedback has shown that it is not a good idea to combine \texttt{plain} +and \texttt{(my)heading} either. Therefore I changed the layout of the +\cs{chapter} page to \texttt{empty}. Maybe it is necessary to define a +\texttt{hplain} and \texttt{fplain} pagestyle or to define some magic to use +the correct definition of \texttt{plain}. Feedback is welcome. + +\subsection{Additional commands} + +\subsubsection{Marginlabel} +\index{marginlabel} + +The command \verb|\marginlabel{xxx}| prints the text \texttt{xxx} right +justified into the left margin. Please note that a \cs{marginpar} will print +it left justified. + +\marginlabel{Example:} The word ``Example'' in the left margin is +printed with the command \verb|\marginlabel{Example:}| + +\subsubsection{Attention} +\index{attention}\index{attentionsymbol}\index{manfnt} + +The command \cs{attention} puts an exclamation mark with an arrow +pointing to the text into the left margin.\attention{} This is an +example for \cs{attention}. + +\renewcommand{\attentionsymbol}{\texttt{:-)}} +\attention +Since version 2.0c you can change the symbol used for the +\cs{attention} command using a +\verb|\renewcommand{\attentionsymbol}{\texttt\{:-)\}}| +command. To get the default back use +\verb|\renewcommand{\attentionsymbol}| \verb|{\large \bfseries ! $\rightarrow$}| +\renewcommand{\attentionsymbol}{\large \bfseries ! $\rightarrow$} + +Since version 2.0c \cs{attention} takes an optional argument to define the +symbol used in the margin. Thus you can change the symbol once, without +having to restore it later. Do not abuse this +feature\attention[\texttt{:-(}], it is primarily meant as an support for the +\texttt{manfnt} package which enables you to use the ``dangerous bend'' and +``double dangerous bend'' signs. + +The \texttt{manfnt} package is no longer enclosed with Refman, it +has grown and is now a package of its own. + +\subsubsection{Seealso} +\index{seealso} + +The command \verb|\seealso{n}| prints an arrow and its argument into +the left margin. You will find examples for this in the left margin +and in \seealso{Chapter 1} chapter~1. + +\subsubsection{Maxipage environment} +\index{maxipage} + +The \texttt{maxipage} environment is a special kind of \texttt{minipage} +which extends over the full width of the page. It can be used for long +formulas or \texttt{tabular} environments. You may use \texttt{maxipage} +environments inside floats. You cannot use margin notes inside a +\texttt{maxipage} and no page break will occur while in a \texttt{maxipage}. +A \texttt{maxipage} is always a paragraph of its own with a thick line above +and below. You can disable these lines with the +\cs{maxipagerulefalse}\index{maxipagerule} command. They are on by default. + +The following paragraph is an example for a \texttt{maxipage}: +\nopagebreak +\begin{maxipage} +This very long line is an example for a \texttt{maxipage}. It extends +over the full width of the page, including the left margin. +\end{maxipage}\nopagebreak +This is normal text after the \texttt{maxipage}. + +\subsubsection{Fullpage environment} \label{fullpage} +\index{fullpage} + +The \texttt{fullpage} environment consists of one or more pages where +the text extends over the full width of the page. You cannot use +margin notes inside a \texttt{fullpage} environment. A \texttt{fullpage} +will always start and end on a page of its own. It may be used for +large tables, program listings or anything that does not fit into the +normal layout. + +\seealso{Page \pageref{bild}} +Page~\pageref{bild} is an example for a \texttt{fullpage}. + +\subsubsection{Noparskip} + +The \cs{noparskip} removes the vertical space between two +paragraphs. It is similar to the \cs{noindent} command that removes +the indent of the first line of a paragraph. + +\subsubsection{Setleftmarginwidth} +\index{setleftmarginwidth} + +The \cs{setleftmarginwidth} command is no longer supported. You can +achieve similar results by using the \cs{settextfraction} command. + +\subsubsection{Descriptioncolon} +\index{descriptioncolon} + +By default a colon is printed after the description label. The command +\cs{description\-colonfalse} disables the colon, the +\cs{description\-colontrue} re-enables it. + +\subsubsection{Descriptionleft} +\index{descriptionleft} + +The \cs{descriptionlefttrue} command sets the description label +left justified into the margin. The default is right justified which +will be achieved with \cs{descriptionleftfalse} + +\subsubsection{Maxipagerule} +\index{maxipagerule} + +You can disable the rules before and after a \texttt{maxipage} with the +\cs{maxipage\-rulefalse} command and re-enable them with the +\cs{maxipageruletrue} command. The default is on. You should not mix +\texttt{maxipage}s with and without rules in one document. + +\subsubsection{Condbreak} +\index{condbreak} + +The command \verb|\condbreak{2cm}| ensures, that the next 2~cm are +either completely on this page or completely on the next. No +page break will appear in the next 2~cm. + +This is really a hack to achieve what the \cs{samepage} command often fails +to do. + +\subsubsection{Example} +\index{example} + +The \texttt{example} environment acts like a \texttt{verse} +environment but uses a \texttt{tt} font. + +\subsubsection{Pageperchapter} +\index{pageperchapter} + +The command \cs{pageperchapter} creates page number that start with +1 for every new chapter. This may be useful for larger manuals. Since +it works with chapters it is only available in the +\texttt{refrep} class. + +\subsubsection{Smallborder} +\index{smallborder} + +The normal border around the page is 1~Inch. That is fine for a printed +document, but wastes a lot of space when a document is meant for reading on +screen. The option \texttt{smallborder} reduces the margin to 0.25~Inch. + + +You can redefine the border with \cs{setlength}\cs{papermarginwidth} +\verb|{0.25in}|. +Call \verb|\setpagefraction{0.7}| afterwards to recalculate the page layout. + +\subsubsection{Dvips} +\index{dvips} + +The option \texttt{dvips} tells DVIPS about the current page size. + +\subsubsection{Pdftex} +\index{pdftex} + +The option \texttt{pdftex} tells PDF\TeX about the current page size. + +\subsubsection{Pagesize} +\index{pagesize} + +\texttt{pagesize} chooses the correct \cs{special}-command to tell the +DVI-driver about the paper size. It works with DVIPS and DVIPDFMX for DVI +output and PDF\TeX\ for PDF output. + +\subsubsection{Ifpdfoutput} +\index{ifpdfoutput} + +You can use \verb|\ifpdfoutput{pdftext}{dvitext}| to write different text +depending on the output format. This command was necessary to implement the +\texttt{pagesize} option and is available for the user as well. + +The last four commands have been taken from KOMA-Script, thanks Markus. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput + diff --git a/macros/latex/contrib/refman/layout_d.pdf b/macros/latex/contrib/refman/layout_d.pdf Binary files differnew file mode 100644 index 0000000000..dfd2758d48 --- /dev/null +++ b/macros/latex/contrib/refman/layout_d.pdf diff --git a/macros/latex/contrib/refman/layout_d.tex b/macros/latex/contrib/refman/layout_d.tex new file mode 100644 index 0000000000..899d8dcb4c --- /dev/null +++ b/macros/latex/contrib/refman/layout_d.tex @@ -0,0 +1,781 @@ +% +% LAYOUT.TEX - Kurzbeschreibung von PA 88-10-04 (LaTeX) +% 99-03-20 +% +% Updated for REFMAN.CLS (LaTeX2e) +% +\documentclass[twoside,a4paper]{refart} +%\documentclass[pagesize,twoside,a5paper,smallborder,10pt]{refart} +\usepackage[T1]{fontenc} +\usepackage{ae} % CM-Zeichens"atze mit T1 encoding +\usepackage{makeidx} +\usepackage{ifthen} +\usepackage{german} +%\usepackage{showidx} + +\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}} +\def\bs{\char'134 } % backslash in \tt font. +\newcommand{\zB}{z.\,B.} +\newcommand{\dH}{d.\,h.} + +\title{Layout-"Anderungen mit \LaTeX} +\author{EDV-Zentrum der TU Wien, Abt.~Digitalrechenanlage \\ +Hubert Partl \\ +1988-10-04 \\ +Axel Kielhorn\thanks{A.Kielhorn@web.de}\\ +1996-01-01 \\ +H27.0 --- Version 1} + +\date{} +\emergencystretch1em % F"ur TeX <3.0 auskommentieren! + +%\pagestyle{footings} +%\pagestyle{headings} +%\pagestyle{myfootings} +\markboth{Layout-"Anderungen mit \textrm{\LaTeX}}% + {Layout-"Anderungen mit \textrm{\LaTeX}} + +\makeindex % Dies nur als Demonstration, das jetzt auch ein Index + % m"oglich ist :-) +% Bei Marginlabels mu"s der Index *vor* dem Label stehen. + +% Es ist notwendig die Umlaute in der TeX-Schreibweise zu schreiben, +% da der german.sty sie sonst in etwas verwandeln w"urde, mit dem +% MakeIndex nicht zurecht kommt. + + +\setcounter{tocdepth}{2} +\settextfraction{0.7} + +\begin{document} +\maketitle + +\begin{abstract} + Dieses Dokument beschreibt die M"oglichkeiten der + \texttt{refart} und \texttt{refrep} Class f"ur \LaTeXe. + Sie arbeitet nicht mehr mit dem alten \LaTeX\ 2.09 + zusammen und enth"alt einige Verbesserungen gegen"uber dem + Original. Alte \texttt{REFMAN} Quellen sollten sich aber + problemlos an die Class anpassen lassen. +\end{abstract} + + +Dieses Heft ist als Erg"anzung zu Kapitel~5 (``Designing It Yourself'') +des \LaTeX-Manuals von Leslie Lamport gedacht. + +\tableofcontents + +\newpage + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\section{Einleitung} + +\subsection{Autor, Layout-Designer und Setzer} + +Jedes Schrift"-st"uck -- von einer kurzen handgeschriebenen Notiz bis zu +einem gedruckten Buch --besteht aus zwei Komponenten: \textbf{Inhalt} +und \textbf{Form.} In den meisten F"allen ist die Form nicht Selbstzweck +sondern dient nur dazu, den Inhalt f"ur den Leser verst"and"-lich +darzustellen. + +\index{Autor}\marginlabel{Autor:} +Der \textbf{Inhalt} wird vom jeweiligen Autor geliefert. Bei +Druckwerken wird der Autor meist durch den Lektor des Verlages oder den +Herausgeber der Zeitschrift unterst"utzt. + +Bei der Verwendung des Textsatzsystems \LaTeX\ wird der Inhalt im +Hauptteil des \LaTeX-""Eingabefiles angegeben -- also zwischen +\verb|\begin{document}| und \verb|\end{document}| -- erg"anzt durch +\LaTeX-Befehle, die angeben, welche Bedeutung die einzelnen Text"-Teile +haben. + +\index{Designer}\marginlabel{Designer:} +Die \textbf{Form} eines Druckwerks wird "ublicherweise vom Verleger +festgelegt, der das Layout von den im Verlag angestellten Designern +entwerfen l"a"st. + +Die mit \LaTeX\ mitgelieferten sogenannten "`Document Classes"' +wurden von professionellen amerikanischen Layout-Designern f"ur die +von Leslie Lamport vorgesehenen Arten von Schrift"-st"ucken entworfen, +also f"ur wissenschaftliche Zeitschriften, Berichte und B"ucher -- auf +der Grundlage der in den USA "ublichen Konventionen. Die "`Koma-Script- +Classes"' sind an den europ"aischen Geschmack angepa"st und in vielen +Kleinigkeiten optimiert worden. Diese Layouts sind in den sogenannten +"`Class-Files"' festgelegt. Am Beginn des \LaTeX-""Eingabefiles -- +vor dem Befehl \verb|\begin{document}| -- wird angegeben, in welcher +Form der Inhalt des Schrift"-st"ucks gesetzt und ausgedruckt werden +soll. + +\index{Setzer}\marginlabel{Setzer:} +Der Setzer in der Druckerei +bringt den vom Autor bzw.\ Lektor gelieferten Inhalt in die vom +Layout-Designer festgelegte Form, in der das Schrift"-st"uck dann +schlie"slich ausgedruckt wird. + +Bei der Verwendung von \LaTeX\ erfolgt das Setzen durch das +Computer-""Programm \TeX\ und das Ausdrucken durch ein weiteres +Computer-""Programm, den sogenannten Device-Driver. + + +\subsection{Layout-"Anderungen} + +Wenn das Schrift"-st"uck nicht in einem der vorgefertigten +\LaTeX-Layouts gesetzt werden soll, sind die folgenden zwei +Voraussetzungen notwendig: +\begin{enumerate} + +\item + Das Layout mu"s entworfen werden. + Dies sollte im allgemeinen von einem professionellen Designer + gemacht werden. Falls kein solcher zur Verf"ugung steht, mu"s + sich der Autor oder der Herausgeber als "`Amateur-Designer"' + versuchen -- am besten durch Anlehnung an professionell + gestaltete Vorbilder. + +\seealso{\ref{design}} + Ausf"uhrlichere Hinweise dazu werden in Kapitel~\ref{design} + angegeben. + +\item + Das Layout mu"s in Form eines \LaTeX-Class-Files formuliert + werden. Dies kann entweder als "`Class-Option"' geschehen, oder + durch die Definition einer neuen "`Class"'. Die komplette + Neudefinition hat den Vorteil, das sie weitreichendere + "Anderungen erlaubt. Ich habe mich daher bei der Portierung nach + \LaTeXe\ f"ur eine eigene "`Class"' entschieden. Dadurch wird + die "Ubertragung von alten Dateien zwar etwas erschwert, aber + meiner Meinung nach "uberwiegen die Vorteile. + Die Angabe dieser "`Class"' bzw.\ dieser "`Class-Option"' am + Beginn des \LaTeX-""Eingabefiles bewirkt dann, da"s der Inhalt + des Schrift"-st"ucks in dieser neuen Form gesetzt und gedruckt + wird. + +\seealso{\ref{layout}} + Ausf"uhrlichere Hinweise dazu werden in Kapitel~\ref{layout} + angegeben. + +\end{enumerate} + +\section{Die Kunst des Layout-Design} +\label{design} +\label{Layout-Design} +\index{Layout-Design} + +\subsection{Allgemeine Regeln} +\index{Regeln} + +Es gibt fast keine allgemeing"ultigen Regeln, sondern man mu"s f"ur jedes +Schrift"-st"uck oder jede Reihe von Schrift"-st"ucken ein eigenes Layout +entwerfen. + +Dieses Layout mu"s sich vor allem daran orientieren, +{\it wer\/} das Schrift"-st"uck {\it wie\/} lesen wird. + +Ein wichtiges Kriterium ist \zB, ob der Leser es eher von A bis~Z +durchgehend lesen will wie einen Kriminalroman oder ein +"`Tutorial"', oder ob er eher bestimmte Stellen rasch auf"|finden +will wie in einem Telefonbuch oder in einem "`Reference Manual"'. +\index{Manual}\index{Telefonbuch} + +Au"serdem mu"s das Layout die bestehenden Konventionen ber"ucksichtigen, +vor allem die Gewohnheiten des Lesers, aber auch den sogenannten +"`House Style"',\index{House-Style} durch den sich verschiedenartige +Schrift"-st"ucke und die Produkte verschiedener Hersteller oder +Institutionen voneinander unterscheiden sollen.\footnote{Man vergleiche +\zB\ das jeweils typische Layout verschiedener Fachzeitschriften oder +Tageszeitungen.} + +\attention +Der Hauptzweck des Layouts ist stets, da"s der Leser die gesuchten +Informationen gut findet und sie gut lesen kann, und da"s er den Inhalt und +den logischen Aufbau des Schrift"-st"ucks richtig versteht. +Wichtig sind also "Ubersichtlichkeit, Lesbarkeit, Konsistenz und +dergleichen. Die Sch"on"-heit ("Asthetik) steht demgegen"-"uber im +allgemeinen nur an zweiter Stelle.\footnote{Dies gilt nat"urlich nicht +f"ur Werbeprospekte, Bild"-b"ande und dgl.} + +Im folgenden werden ein paar einfache +"`Faustregeln"'\index{Faustregeln} f"ur den Seitenaufbau angef"uhrt, die +f"ur die meisten Anwendungen G"ultigkeit haben. +\begin{description} + +\item[Zeilenabst"ande]\index{Zeilenabst\"ande} + Die Zeilenabst"ande m"ussen gr"o"ser als die Wortabst"ande + sein, damit die Augen des Lesers richtig entlang der Zeilen + gef"uhrt werden. + +\item[Zeilenl"ange]\index{Zeilenl\"ange} + Die Zeilenl"ange + -- bzw.\ bei mehrspaltigem Druck die Spaltenbreite -- + soll m"oglichst bei etwa 60~Zeichen pro Zeile liegen. Zu lange + Zeilen sind schlecht lesbar, weil sie anstrengende + Augenbewegungen erfordern und gleichzeitig die + Wahrscheinlichkeit erh"ohen, beim Zeilenwechsel in die falsche + Zeile zu geraten. Zu kurze Zeilen machen Probleme beim + Randausgleich (Blocksatz) und beim Abteilen (Silbentrennung). + Wenn l"angere Zeilen notwendig sind, dann m"ussen die + Zeilenabst"ande vergr"o"sert werden. + +\item[Seitenaufbau]\index{Seitenaufbau} + Die normalen Textseiten sollen einen m"oglichst einheitlichen + Aufbau haben. Abbildungen, Tabellen und spezielle Seiten wie + Inhaltsverzeichnis, Index usw. sollen aber \emph{nicht} in + dasselbe Schema gepre"st werden, sondern stets so viel Platz + einnehmen, wie f"ur die jeweilige Tabelle etc. am g"unstigsten + ist (also durchaus k"urzer oder l"anger als die normale + Zeilenl"ange, evtl.~mit einem Rahmen darum herum). Wenn m"oglich + sollten bei der Seitenaufteilung auch "asthetische Grundregeln + wie \zB\ der "`Goldene Schnitt"' ($ 13 : 8 \approx 8 : 5 $) + angewendet werden. + +\item[Randnoten]\index{Randnoten} + "`Randnoten"' sind f"ur viele Zwecke besser geeignet als + Fu"s"-noten, weil sie direkt neben dem Text erscheinen, auf den + sie sich beziehen. Dazu z"ahlen auch Symbole wie \zB\ + "`Achtung-Zeichen"', die wichtige Text-Teile markieren bzw.\ + den Leser auf sie hinweisen. + +\item[Kopf- und Fu"szeilen]\index{Kopfzeilen}\index{Fu{\ss}zeilen} + Der Inhalt von Kopf- und Fu"s-Zeilen soll die Orientierung + innerhalb des Schrift"-st"ucks erleichtern. Falls zu erwarten + ist, da"s manche Leser einzelne Seiten aus dem Schrift"-st"uck + herauskopieren (\zB\ einen Artikel aus einer Zeitschrift), + sollte in der Kopf- oder Fu"szeile auch die Information zu + finden sein, aus welchem Schrift"-st"uck die Seiten stammen. + Falls h"aufig neue Versionen eines Schrift"-st"ucks erstellt + werden (\zB\ bei Software-Manuals), sollte auch das Datum oder + die Versionsnummer in der Kopf- oder Fu"szeile erscheinen. + +\end{description} + +\subsection{Spezielle Hinweise f"ur technische Beschreibungen} + +Wir wollen kurz die Eignung von drei verschiedenen Layouts f"ur den an +unserer Universit"at h"aufigen Spezialfall von technischen +Beschreibungen, Users' Guides, Reference Manuals, Mitteilungs"-bl"attern +und "ahnlichen technischen Druckwerken vergleichen:\footnote{Diese +Hinweise stammen von Paul Stiff, der Layout-Design an der University of +Reading unterrichtet.} + + +\begin{description} + +\item[Plain \TeX] + Das Standardformat von Plain \TeX\ hat vor allem den gro"sen + Nachteil, da"s die Zeilen viel zu lang sind, was sich schlecht + auf die Lesbarkeit und "Ubersichtlichkeit auswirkt. Dieses von + Schreibmaschinenschrift gewohnte Schriftbild eignet sich nicht + f"ur die von \TeX\ unterst"utzte "`Druck"'-Schrift. Die an der + TU~Wien vor der Einf"uhrung von \LaTeX\ entwickelten Macros {\tt + EASY.TEX} und \hbox{\tt ARTii.TEX} bzw.\ \hbox{\tt REPii.TEX} + haben au"serdem einige weitere Design-M"angel, \zB\ sind die + Abst"ande zwischen den Kapitel-"""Uberschriften zu gro"s. + +\item[Standard-\LaTeX] + Auch das Standardformat von \LaTeX\ ist f"ur diese Zwecke nicht + ideal. Die Zeilenl"ange ist zwar richtig gew"ahlt, aber die + Seiten enthalten einen zu gro"sen ungen"utzten Rand, insbesondere + oben und unten. Au"serdem werden f"ur die Kapitel-"""Uberschriften + etwas zu gro"se Schriften verwendet. + +\item[Reference-Manual-Style] + Ein f"ur solche Zwecke g"unstigeres Seiten-Layout findet man bei + einigen in den letzten Jahren neu erschienenen Reference + Manuals:\footnote{Ein h"aufig zitiertes -- allerdings in den + konkreten Details auch nicht ganz ideales -- Beispiel ist das + "`PostScript Reference Manual"'.} +\begin{itemize} +\item + Der fortlaufenden Text steht mit einer relativ kurzen, gut + lesbaren Zeilenl"ange im rechten Teil der Seite. Dieser Teil + dient also zum fortlaufenden Lesen einzelner Abschnitte. +\item + Im breiten linken Rand jeder Seite stehen die + "Uberschriften sowie Stichworte und andere "`Randnoten"'. Dieser + Teil dient also zum raschen Auffinden von bestimmten + Informationen innerhalb des gesamten Schrift"-st"ucks. +\item + Abbildungen und Tabellen stehen je nach ihrem Platzbedarf in + der einen oder anderen Spalte oder gehen "uber die gesamte + Seitenbreite. +\end{itemize} +\seealso{\ref{refmanex}} +Eine Anleitung, wie man ein solches Layout mit \LaTeX\ realisieren +kann, wird in Abschnitt~\ref{refmanex} angegeben. + +\end{description} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +\section{Wie kann man das \LaTeX-Layout "andern?} +\label{layout} + +\subsection{Vor und Nachteile des Textsatzsystems \LaTeX} + +\marginlabel{Vorteile:} +Der gro"se Vorteil von \LaTeX\ besteht darin, da"s es ein "`generisches"' +oder "`logisches"' Design \index{Design, logisches}\index{Design, generisches} +unterst"utzt. Darunter versteht man, da"s der +Autor nur mit einigen wenigen Befehlen angeben mu"s, welche +\emph{Bedeutung} die einzelnen Text-Teile haben: "Uberschriften, Zitate, +mathematische Gleichungen, Listen, Aufz"ahlungen, Literaturangaben usw. +Diese logischen Begriffe werden dann vom System automatisch in der +richtigen Art und Weise gesetzt und ausgedruckt. Was "`richtig"' ist, +mu"s dem System vorher in geeigneter Weise mitgeteilt werden, bei +\LaTeX\ durch die Angabe der "`Document Class"' und eventuell weiterer +"`Packages"'. + +Im Gegensatz dazu steht das von "alteren Textverarbeitungsprogrammen und +auch von Plain~\TeX\ unterst"utzte "`visuelle"' Design,\index{Design, +visuelles} bei dem der Autor die sichtbaren Eigenschaften wie +Schriftart, Schriftgr"o"se, vertikale Abst"ande, horizontale Einr"uckungen +usw. angeben mu"s. + +Das Prinzip des logischen Design\index{Design, logisches} macht +einerseits die Anwendung durch den Autor wesentlich einfacher und +"ubersichtlicher und stellt andererseits die logische Konsistenz des +Schrift"-st"ucks sicher (\zB\ einheitliche Schriftart f"ur alle +"Uberschriften des gleichen Levels, einheitliche Numerierung von +Kapiteln und von Gleichungen, einheitliche Darstellung von Listen und +Aufz"ahlungen, usw.). + +\marginlabel{Nachteile:} +Als Nachteil von \LaTeX\ wird immer wieder angef"uhrt, da"s es den Autor +zu sehr einschr"ankt und da"s man das Layout zu wenig "andern kann. Dies +ist nur teilweise richtig, n"amlich nur dann, wenn man sich auf die vier +mit \LaTeX\ mitgelieferten Standard-Layouts beschr"ankt, die sich +selbstverst"andlich nicht f"ur alle Anwendungen eignen und die au"serdem +sehr stark an amerikanische Konventionen angepa"st sind. + +\LaTeX\ ist aber wesentlich m"achtiger und flexibler: Man kann praktisch +beliebige "Anderungen am Layout dadurch erreichen, da"s man die in den +Style-Files enthaltenen Definitionen "andert, die ge"-"an"-derten +Definitionen in privaten Style-Option-Files speichert und diese dann +als zus"atzliche Style-Options aufruft. Der Aufwand daf"ur ist keineswegs +gr"o"ser als bei der Verwendung von Plain \TeX, in manchen F"allen sogar +wesentlich geringer. + +\subsection{Eingabe-Dateien und Class-Dateien} + +In Einklang mit dem Prinzip des logischen Design und der Trennung +von Inhalt und Form verwendet \LaTeX\ grund"-s"atz"-lich zwei Arten +von Dateien: +\begin{itemize} +\item + Der Inhalt einschlie"slich der logischen Struktur des + Schrift"-st"ucks wird in den \LaTeX-""Eingabefiles festgelegt. +\item + Die Form (das Layout) wird in sogenannten Class-Files und + eventuell auch Packages festgelegt. +\end{itemize} +Welche Class- und Package-Files ein Schrift"-st"uck verwendet -- +\dH\ in welchem Layout es gesetzt werden soll -- wird am Beginn des +Eingabefiles mit den Befehlen \verb|\documentclass| bzw. +\verb|\usepackage| angegeben. + +F"ur die Erzeugung eines Schriftst"ucks mit \LaTeX\ sind also +zumindest zwei Files notwendig: ein Eingabefile und ein Class-File. + +Diese Trennung entspricht den in der Einleitung erl"auterten +unterschiedlichen Funktionen von Autor und Layout-Designer. Sie hat +aber auch f"ur den Fall, da"s der Autor selbst das Layout festlegt, +wesentliche Vorteile: +\begin{itemize} +\item + Einerseits wird damit sichergestellt, da"s zusammengeh"orige + Schrift"-st"ucke automatisch im selben Layout gesetzt werden, + auch wenn dieses Layout nach dem Erstellen des Textes noch + ge"-"an"-dert wurde. Dies w"are nur schwer zu erreichen, wenn die + Layout-""Definitionen direkt in jedem einzelnen + Eingabefile enthalten w"aren. +\item + Andererseits ist es auf diese Weise ohne gro"sen Aufwand + m"oglich, denselben Inhalt in verschiedenen Layouts + auszudrucken, \zB\ als Artikel f"ur die eine oder andere + wissenschaftliche Zeitschrift oder als Kapitel einer + Dissertation und eines Forschungsberichts. +\end{itemize} + +\subsection{Class-Files und Package-Files} + +\LaTeX\ unterst"utzt innerhalb der Layout-Definition die folgende +Hierarchie von "`Class"' und "`Option"', die sich in den verschiedenen +Parametern des Befehls \verb|\documentclass| widerspiegelt: +\begin{itemize} +\item + Als erstes wird der Inhalt desjenigen "`Class-Files"' + verarbeitet, dessen Name im \verb|\documentclass|-Befehl + zwischen den geschwungenen Klammern angegeben wurde. Dies gibt + die grunds"atzliche Art des Schriftst"ucks an. +\item + Dann werden der Reihe nach diejenigen "`Class-Option-Files"' + verarbeitet, deren Namen zwischen den eckigen Klammern + angegeben wurden. Damit kann man verschiedene Layout-Varianten + ausw"ahlen. +\item + Als dritter Schritt werden dann die im + \verb|\usepackage|-Befehl angegebenen Packages geladen, die + ihrerseits wieder Optionen laden k"onnen. + +\end{itemize} +Diese mehrstufige Verarbeitung macht es m"oglich, die +Layout-""Definition in mehrere kleinere Einheiten zu zerlegen, wobei in +einem Class-Option-File sowohl Layout-Definitionen der urspr"unglichen +Class-Files abge"-"andert als auch weitere Definitionen hinzuge"-f"ugt +werden k"onnen. + +Class-Files, Class-Option-Files und Packages unterscheiden sich von +"`normalen"' Eingabefiles im wesentlichen durch die folgenden Punkte: +\begin{itemize} +\item + Sie d"urfen nur Definitionen enthalten, aber keine Text-Ausgaben + bewirken. +\item + Das Sonderzeichen "`Klammeraffe"' ({\tt @}) hat in ihnen die + Bedeutung eines Buchstabens ("`letter"'), \dH\ es ist + innerhalb von Befehlsnamen erlaubt. Die meisten von \LaTeX\ + intern verwendeten Befehle enthalten Klammeraffen in ihren + Namen, damit Kollisionen mit den vom Benutzer verwendeten + Befehlen ausgeschlossen werden. +\item + Die Filenamen haben die "`Extension"' {\tt cls} bzw. {\tt clo} + oder {\tt sty} f"ur Packages (nicht {\tt tex}). +\end{itemize} + +\subsection{Vorgangsweise bei Layout-"Anderungen} +\index{Layout-\"Anderungen, Vorgangsweise} + +\subsubsection{Festlegen der "Anderungen gegen"uber dem Original-Layout} + +Im allgemeinen ist es g"unstiger, die Class-Files f"ur das neue Layout +nicht von Null an neu zu erstellen, sondern die bereits bestehenden +\LaTeX-Class-Files als Vorbilder zu verwenden und so viel wie m"oglich +von den darin enthaltenen Definitionen zu "ubernehmen. + +In den meisten F"allen gen"ugt es sogar, ein mehr oder weniger kurzes +Package-File zu erstellen, das nur die Unterschiede des neuen Layouts +gegen"uber einem der originalen \LaTeX-Layouts enth"alt, und diese +"`Option"' dann in Verbindung mit der originalen "`Class"' zu verwenden. + +Im ersten Schritt legt man daher fest, in welchen Bereichen sich das +neue Layout vom originalen \LaTeX-Layout unterscheidet und worin diese +Unterschiede im einzelnen bestehen. Man geht dabei am besten so vor, +da"s man sich f"ur alle als \LaTeX-Befehle oder -Environments definierten +logischen Einheiten "uberlegt, in welchem Layout sie gesetzt werden +sollen. Neue zus"atzliche \LaTeX-Befehle sollte man nach M"oglichkeit +\emph{nicht} erfinden -- und wenn, dann nur im Einklang mit dem Prinzip +des logischen Design und mit der Struktur der anderen \LaTeX-Befehle +(\zB\ neue Environments f"ur spezielle Tabellen, oder eigene Befehle +f"ur spezielle Hervorhebungen). + +\subsubsection{Finden der Original-Definitionen} + +Im zweiten Schritt mu"s man finden, wo und wie alle +die Layout-""Eigenschaften, die man "andern will, im Original definiert +sind. Dazu soll man die folgenden Quellen in der folgenden +Reihenfolge durchsuchen:\footnote{Diese Hinweise stammen von Sue +Brooks, die im Rahmen der \TeX-""Konferenz 1988 in Exeter ein +Work"-shop f"ur "`\LaTeX-Hacker"' leitete.} +\begin{enumerate} +\item das \LaTeX-Manual von Leslie Lamport, +\item die Dokumentations-Files {\tt *.dtx} +\item die Kernal-Files {\tt *.ltx}, +\item das \TeX book von Donald E.~Knuth. +\end{enumerate} +Die beiden B"ucher sind im Buchhandel erh"altlich (Verlag Addison +Wesley). Ob und wo die Files an Ihrem Computer angelegt sind, ist im +"`\LaTeX\ Local Guide"' Ihrer Installation angegeben. Die Files sind +sehr gut kommentiert, soda"s man sich im allgemeinen auch dann gut in +ihnen zurechtfindet, wenn man nicht alle Details der darin enthaltenen +Befehle versteht. + + +\subsubsection{Schreiben eines neuen Package-Files} + +Im dritten Schritt erzeugt man das neue Package-File. Man w"ahlt einen +Namen f"ur die neue Package (\zB~\texttt{refman}) und bildet den +Filenamen aus diesem Namen und der Extension \texttt{sty} (\zB\ +\texttt{refman.sty}). Ausgerechnet f"ur \texttt{refman} trift +diese Vorgehensweise nicht zu, da es sich inzwischen um eine +eigenst"andige Class handelt. + +Dieses File mu"s nur diejenigen Definitionen +(\verb|\def|-Befehle, Wertzuweisungen und dergleichen) enthalten, die +sich gegen"uber der Originalversion unterscheiden, und/oder diejenigen, +die man zus"atzlich definieren will. + +Bei den "Anderungen geht man am besten so vor, da"s man die betreffenden +\verb|\def|-Befehle, Wertzuweisungen usw.\ aus den originalen Files in +das neue File kopiert und dann dort entsprechend modifizert. + +Auch bei neuen Definitionen lehnt man sich am besten an Vorbilder in +den originalen Files an. + +Au"serdem mu"s man den Zweck des Files, seine Verwendung, den +Autor und das letzte "Anderungsdatum sowie alle im File +enthaltenen Definitionen auf Kommentarzeilen innerhalb des Files +dokumentieren. Bei sehr umfangreichen Style-Files kann man dazu +das \texttt{docstrip}-Programm benutzen, mit dem auch alle +\LaTeXe\ Dateien dokumentiert wurden. Das Script +(\texttt{*.ins}) erzeugt aus dem Dokument (\texttt{*.dtx}) dann +eine Package (\texttt{*.sty}) oder Class (\texttt{*.cls}). +Die \texttt{dtx}-Datei dient gleichzeitig als Dokumentation. +Dadurch bleibt gew"ahrleistet das Package und +Dokumentation "ubereinstimmen. In den meisten F"allen gen"ugt es +aber, nur ein \texttt{sty}-File mit allen Kommentaren anzulegen. + + +\subsubsection{Verwendung der neuen Style-Option} + +Durch die Angabe des neuen Package-Namens im \verb|\usepackage|-Befehl +werden die "Anderungen f"ur das betreffende Schrift"-st"uck wirksam, +\dH~dieses wird im neuen Layout gesetzt. +Beispiel: +\begin{verbatim} + %Alte Version: + \documentstyle[11pt,twoside,german,refman]{article} +\end{verbatim} +wird zu: +\begin{verbatim} + %Neue Version: (LaTeX2e) + \documentclass[11pt,twoside,a4paper]{refart} + \usepackage{german} + %\usepackage{mysty} %<- Hier wird meine Package geladen +\end{verbatim} + +Davon abgesehen sollten keine "Anderungen im Eingabefile notwendig +sein -- es sei denn, das Schrift"-st"uck ent"-h"alt spezielle logische +Text-""Elemente, die im neuen Layout vorgesehen sind, aber in +Original-\LaTeX\ nicht unter"-st"utzt werden. + +\attention +Wenn man das Eingabefile an einen anderen Computer "ubertragen will, mu"s +man \emph{alle} darin verwendete Package-Files mit"-"ubertragen, damit +es auch dort verarbeitet werden kann. + +%%%%%% %%%%%%%%%% %%%%%%%%%% %%%%%%%%%% %%%%%%%%% + +\subsection{Ein einfaches Beispiel (Gleichungsnummern)} + +Angenommen, Sie wollen, da"s in einem "`Article"' die Gleichungen innerhalb +jeder "`Section"' separat numeriert werden. + +Im \LaTeX-Manual finden Sie den Hinweis, da"s der "`Report"'-Style +etwas "Ahnliches pro "`Chapter"' macht. + +Sie schauen das File \texttt{report.cls} an und finden darin die +folgenden zwei Befehle, die sich -- wie in den Kommentarzeilen +angegeben ist -- auf die Gleichungsnummern beziehen:\nopagebreak +\begin{verbatim} + \@addtoreset{equation}{chapter} + \def\theequation{\thechapter .\arabic{equation}} + % In LaTeX2e ab 1995/06/01: + \renewcommand\theequation{\thechapter.\@arabic\c@equation} +\end{verbatim} +Es ist nicht notwendig, da"s sie diese beiden Befehle in allen Details +verstehen, +es gen"ugt, wenn Sie erkennen, da"s sich \texttt{chapter} in +beiden F"allen auf die Numerierung pro Kapitel bezieht. + +Sie legen ein File mit dem Namen {\tt eqpersec.sty} an,\footnote + {Je nach dem Computer, an dem Sie arbeiten, kann der Filename + eine andere Syntax haben, + \zB\ {\tt EQPERSEC\_STY} an einer CYBER unter NOS/VE.} +kopieren die Befehle in dieses File, ersetzen darin konsequent {\tt +chapter} durch {\tt section} und erhalten also die neuen +Definitionen\nopagebreak +\begin{verbatim} + % Dies ist equation_per_section.sty + % Kurzname: eqpersec.sty + % + % Gleichungszaehler am Anfang einer section + % zuruecksetzen. + \@addtoreset{equation}{section} + % Gleichungsnummer = sectionnummer.equationnummer + \def\theequation{\thesection .\arabic{equation}} + % oder: + \renewcommand\theequation{\thesection.\@arabic\c@equation} +\end{verbatim} +Nat"urlich f"ugen Sie auch noch Kommentarzeilen hinzu, die den Zweck des +Files erkl"aren und Ihren Namen als den Autor dieses neuen +Style-Option-Files sowie das "Anderungsdatum angeben. + +Wann immer Sie nun in Ihrem \LaTeX-""Eingabefile die Package {\tt +eqpersec} angeben, \zB~mit\nopagebreak +\begin{verbatim} +\documentclass[11pt]{article} +\usepackage{eqpersec} +\end{verbatim} +dann werden die Gleichungen in Ihrem Artikel nach dieser neuen +Konvention numeriert. + + +%%%%%%%%%% %%%%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%% %%%%%%%%%%%% + +\subsection{Ein etwas komplexeres Beispiel (Reference Manual)} +\label{refmanex} + +Wir wollen ein "ahnliches Seiten-Layout wie beim PostScript Reference +Manual erreichen: +mit einem breiten linken Rand, der f"ur "Uberschriften und Randnoten ben"utzt +wird, und mit nur einem eher knappen freien Rand oben, rechts und unten. + +Dies scheint eine sehr grundlegene "Anderung zu sein. Durch die gute +Modularit"at von \LaTeX\ sind aber auch f"ur eine solche Aufgabe nur relativ +wenige "Anderungen notwendig, die im folgenden komplett beschrieben werden. + + +\subsubsection{Seitenaufteilung} + +Die neue Seitenaufteilung wird im wesentlichen mit den im +\LaTeX-Manual beschriebenen Parametern festgelegt. In diesem Beispiel +verwenden wir dazu die Plain-\TeX-Befehle \verb|\newdimen|, +Wertzuweisung und \verb|\advance|, wir k"onnten aber genausogut auch die +entsprechenden \LaTeX-Befehle \verb|\newlength|, \verb|\setlength| +und \verb|\addtolength| verwenden. + +\pagebreak[2] + +\marginlabel{Horizontal:} +Zun"achst definieren wir zwei neue Bezeichnungen f"ur Gr"o"sen, +die im folgenden "ofter verwendet werden: + +\verb|\fullwidth| gibt die komplette Breite (Textbreite + gen"utzter linker +Rand) an und erh"alt denselben Wert wie in Plain~\TeX, n"amlich 6.5~Inch, +soda"s am Papier rechts und links noch jeweils 1~Inch freier Rand bleiben. +(Dies ist jetzt nat"urlich von der Papiergr"o"se abh"angig) + +\verb|\leftmarginwidth| gibt die Breite des Randes an, der links von der +normalen Textbreite f"ur "Uberschriften und Randnoten verwendet wird: +\begin{displaymath} +\texttt{leftmarginwidth} = \texttt{fullwidth} - \texttt{textwidth} +\end{displaymath} + +Da die entsprechenden Ma"se in Abh"angigkeit von der Papierbreite berechnet +werden, m"ochte ich hier auf eine genaue Beschreibung verzichten. Diese +Class wurde mit dem \texttt{docstrip}-Programm erstellt und erlaubt es +eine ausf"uhrliche Dokumentation zu erzeugen. (Allerdings in Englisch) + +\marginlabel{Vertikal:} +Das vertikale Layout wird abh"angig von der Papierh"ohe berechnet. Auch hier +m"ochte ich auf die Dokumentation zur Class verweisen. + +\vspace{0pt plus 1cm} + +\subsubsection{Kapitel-"Uberschriften} + +Die "Uberschriften von Sections, Sub- und Subsubsections sollen so +abge"-"an"-dert werden, da"s sie in den linken Rand hinausragen. + +Im File \texttt{classes.dtx} finden wir, da"s diese "Uberschriften durch +Aufrufe des Befehls \verb|\@startsection| definiert sind, dessen +Funktion auf den Kommentarzeilen beschrieben ist. F"ur uns relevant sind +nur folgende Parameter: +Der Absolutbetrag des vierten und des f"unften Parameters gibt den Abstand +vor bzw.\ nach der "Uberschrift an. Der sechste Parameter gibt an, wie der +Text der "Uberschrift gesetzt werden soll. +Der Befehl f"ur Sections ist \zB\ im Original so definiert:\nopagebreak +\begin{verbatim} +\newcommand\section{\@startsection + {section}{1}{\z@}% + {-3.5ex plus -1ex minus -.2ex}% + {2.3ex plus .2ex}% + {\normalfont\Large\bfseries}} +\end{verbatim} +und analog die Befehle f"ur Sub- und Subsubsections. +Die Anpassung an die jeweilige Schrift"-gr"o"se erfolgt automatisch durch +die Verwendung der relativen Einheit \texttt{ex}. + +Wir definieren zun"achst eine Abk"urzung \verb|\secshape| f"ur das neue +Layout aller dieser "Uberschriften. Die wesentliche "Anderung besteht darin, +da"s die "Uberschriften um die Breite des linken Randes weiter links als der +normale Text beginnen sollen. +Zu diesem Zweck setzen wir den linken Rand auf die entsprechende +negative Gr"o"se. Au"serdem wollen wir, da"s die W"orter in der "Uberschrift +nicht abgeteilt werden und da"s deshalb rechts kein Randausgleich +gemacht wird. +Dies erreichen wir mit den folgenden Befehlen, die im \TeX book +beschrieben sind:\nopagebreak +\begin{verbatim} +\def\secshape{\leftskip=-\leftmarginwidth + \rightskip=0pt plus 1fil + \hyphenpenalty=2000} +\end{verbatim} +Ein Aufruf dieses Befehls soll nun jeweils in den sechsten +Parameter von \verb|\@startsection| eingef"ugt werden. + +Da die "Uberschriften durch das Hinausragen in den linken Rand deutlich +genug vom normalen Text abgesetzt sind, m"ussen sie nicht durch so gro"se +Schrift und Abst"ande wie im Original hervorgehoben werden. +Wir verkleinern daher auch noch die entsprechenden Angaben im vierten, +f"unften und sechsten Parameter und erhalten schlie"slich die neue +Definition\nopagebreak +\begin{verbatim} +\newcommand\section{\@startsection + {section}{1}{\z@}% + {-2ex plus -1ex minus -.2ex}% + {0.5ex plus .2ex}% + {\secshape\normalfont\large\bfseries}} +\end{verbatim} +und analoge neue Definitionen f"ur Sub- und Subsubsections. + +\vspace{0pt plus 1cm} + +\subsubsection{Positionierung der Randnoten} + +Die Positionierung der Randnoten mu"s so abge"andert werden, da"s +\emph{alle} Randnoten in den linken Rand gesetzt werden -- unabh"angig +davon, ob es sich um eine rechte oder linke Seite und um eine normale +oder verkehrte Randnote handelt. + +Im File \texttt{latex.dtx} finden wir die viele Zeilen lange Definition +des Befehls \verb|\@addmarginpar|, der das Setzen der Randnoten +durchf"uhrt. Wir brauchen uns nicht um alle Details dieses komplizierten +Befehls zu k"ummern, wir m"ussen nur eines herausfinden: Im ersten Teil +des Befehls wird eine interne Gr"o"se \verb|\@tempcnta| entweder auf +\verb|\@ne| oder auf \verb|\m@ne| gesetzt, je nachdem, ob die Randnote +rechts oder links vom Text gesetzt werden soll. +Dazu dienen die folgenden Zeilen. +\begin{verbatim} + \@tempcnta\@ne + \if@twocolumn + \if@firstcolumn \@tempcnta\m@ne \fi + \else + \if@mparswitch + \ifodd\c@page \else\@tempcnta\m@ne \fi + \fi + \if@reversemargin \@tempcnta -\@tempcnta \fi + \fi +\end{verbatim} + +Diese Zeilen ersetzen wir also einfach durch die Zuweisung +\begin{verbatim} + \@tempcnta\m@ne +\end{verbatim} + +Die restlichen Zeilen, die das eigentliche Setzen der Randnote je nach +dem Wert von \verb|\@tempcnta| an die richtige Stelle der Seite +bewirken, lassen wir unver"andert. + +\subsubsection{Erweiterungen} + +Die hier angef"uhrten Definitionen gen"ugen durchaus f"ur einfache +Anwendungen. In der Praxis k"onnen allerdings noch einige Erweiterungen +n"utzlich sein. +\seealso{\ref{refman}} +Ein Beispiel f"ur eine solche "`komplette"' Style-Option ist in +Anhang~\ref{refman} beschrieben. + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\input lay_d2 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\printindex + +\end{document} diff --git a/macros/latex/contrib/refman/layout_e.pdf b/macros/latex/contrib/refman/layout_e.pdf Binary files differnew file mode 100644 index 0000000000..95915fc4fd --- /dev/null +++ b/macros/latex/contrib/refman/layout_e.pdf diff --git a/macros/latex/contrib/refman/layout_e.tex b/macros/latex/contrib/refman/layout_e.tex new file mode 100644 index 0000000000..df4815b73c --- /dev/null +++ b/macros/latex/contrib/refman/layout_e.tex @@ -0,0 +1,674 @@ +% % +% LAYOUT_E.TEX - Short description of REFMAN.CLS +% 99-03-20 +% +% Updated for REFMAN.CLS (LaTeX2e) +% +\documentclass[twoside,a4paper]{refart} +\usepackage{makeidx} +\usepackage{ifthen} +% ifthen wird vom Bild von N.Beebe gebraucht! + +\def\bs{\char'134 } % backslash in \tt font. +\newcommand{\ie}{i.\,e.,} +\newcommand{\eg}{e.\,g..} +\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}} + +\title{Changing the layout with \LaTeX} +\author{EDV-Zentrum der TU Wien, Abt.~Digitalrechenanlage \\ +Hubert Partl \\ +1988-10-04 \\ +English translation by\\ +Axel Kielhorn\thanks{a.kielhorn@web.de}\\ +1999-03-20 \\ +H27.0 --- Version 1} + +\date{} +\emergencystretch1em % + +\pagestyle{myfootings} +\markboth{Changing the layout with \textrm{\LaTeX}}% + {Changing the layout with \textrm{\LaTeX}} + +\makeindex + +\setcounter{tocdepth}{2} + +\begin{document} + +\maketitle + +\begin{abstract} + This document describes the capabilities of the + \texttt{refart} and \texttt{refrep} classes for \LaTeXe. + These classes do not work with \LaTeX\ 2.09. They contain some + improvements over the original \texttt{refman} style which may result + in different output and minor incompatibilities, but make refman + work with paper sizes other than ISO A4, which I consider an + improvement. +\end{abstract} + + +This manual is an addition to chapter~5 (``Designing It Yourself'') of +the \LaTeX-manual by Leslie Lamport. It was originally written in +1988 by Hubert Partl and updated by me during the development of +\texttt{refman}~2.0. The translation into English was done in summer +1998, almost 10 years after the initial release in German. + +\tableofcontents + +\newpage + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\section{Introduction} + +\subsection{Author, Layout Designer and Compositor} + +Every piece of writing -- from a short handwritten note to a printed +book -- consists of two components: \textbf{contents} and +\textbf{design.} In most cases the design is only a means to allow +the reader to understand the contents more easily. + +\index{author}\marginlabel{Author:} +The \textbf{contents} will be written by the author of the document. +She usually is supported by the publisher, who issues guidelines +about how the document should be written and conducts proofreading. + +When using \LaTeX\ the contents appears in the main part of the +document -- between \verb|\begin{document}| and \verb|\end{document}| +-- with some additional \LaTeX-commands that describe the meaning of +the different parts. + +\index{designer}\marginlabel{Designer:} +The \textbf{design} of a printed document is usually defined by the +publisher who employs designers for this purpose. + +The layout is defined in so-called class files. When writing a +document you have to specify the class you want to use with the +\verb+\documentclass+ command. + +The document classes distributed with \LaTeX\ have been designed by +American layout designers according to the conventions used in the +USA. The ``Koma-Script'' classes have been adapted to European taste +and contain many small improvements. + +\index{compositor}\marginlabel{Compositor:} +The compositor takes the contents from the author and formats it +according to the layout the designer specified. + +When using \LaTeX, this job is done by the \TeX\ program and the +printing is done by a device driver. + +\subsection{Changing the Layout} + +If you want to use a layout different from the ones distributed with +\LaTeX, you have to take the following steps: + +\begin{enumerate} + +\item + The layout has to be defined. + This is usually a job for a professional designer. + +\seealso{Chapter \ref{design}} + You can find detailed information about how change the design in + chapter~\ref{design}. + +\item + The layout has to be programmed in \LaTeX. This can either result in + a ``package'' that changes the behaviour of a standard class, or + in the definition of a new ``class''. \texttt{Refman} used to be a + package that changed the definition of the \texttt{article} + class but is now a class of its own. When writing a new class, you + will have more work, but as a result more freedom to change things. + +\seealso{Chapter \ref{layout}} + Chapter~\ref{layout} contains more information about the new layout. + +\end{enumerate} + +\section{The Art of Layout-Design} +\label{design} +\label{Layout-Design} +\index{layout design} + +\subsection{Common Rules} +\index{rules} + +There are almost no common rules because every kind of document has +different requirements and needs a specific layout. This layout +should consider \emph{who} will read the document, and \emph{how}. + +An important criteria is if the reader will read the document from +start to end like a detective novel (linear reading) or if he wants to +find certain information as in a telephone directory or a +reference manual. \index{manual}\index{telephone directory} + +In addition to that, the layout has to consider certain conventions, +like the habits of the reader or ``Corporate Design'' \index{corporate +desing} rules that distinguish publications from different publishers. +\footnote{Compare the layout of different daily papers or magazines +like ``page'' or ``invers''.} + +\attention +The main purpose of a layout is to make sure the reader finds the +information he wants and is able to read and understand it easily. +The structure, readability, and consistency of a document is more +important than it's ``beauty''.\footnote{This is not always true for +adverts that usually contain no information at all and, picture +magazines where the beauty of the picture \emph{is} the contents.} + +The following ``rules of thumb''\index{rules of thumb} will be valid +for most applications: + +\begin{description} + +\item[Line spacing]\index{line spacing} + The spacing between two lines should be larger than the spacing + between two words to guide the eyes of the reader. + +\item[Line length]\index{line length} + The length of a line -- or when using multicolumn layout of a + column -- should be about 60 characters. When lines get longer they + are more difficult to read and it is easier to go to the wrong line + after finishing the current one. Increasing the linespacing may help a + little. + When lines get to short it is difficult to set them justified, and you + will get lots of hyphenated words. + +\item[Page layout]\index{page layout} + Normal text pages should look the same throughout the document. + Figures, tables and special pages like the index need not appear in + the same layout but should take as much space as needed. + +\item[Margin notes]\index{margin notes} + Margin notes are often more suitable than footnotes because they + appear right next to the text they refer to. Special margin notes are + the ``attention sign'' or the ``dangerous bend'' that guide the user + to important parts of the text. + +\item[Headings and Footings]\index{headings}\index{footings} + Headings and footings should make it easier for the reader to orient + himself in the document. If you expect readers to copy single pages + from the document they should contain information about the paper as + a whole, just in case you need more information or want to cite the + whole paper. + + If you expect the document to change often (like software manuals), + each page should contain a version information or at least a date. + +\end{description} + +\subsection{Special note for technical descriptions} + +Let us compare three different layouts and check if they are usable for +technical descriptions, user's guides and reference manuals. +\footnote{This hint came from Paul Stiff, who teaches layout design at +the University of Reading.} + +\begin{description} + +\item[Plain \TeX] + The standard format use by plain \TeX\ has the great disadvantage + that the lines are much to long, which reduces the readability. + +\item[Standard-\LaTeX] + The format used by \LaTeX{}s standard classes isn't ideal. The + line length is correct, but that leaves us with a wide unused margin. + The font used for section headings is too large. The Koma-Script + classes improve this and offer many ways to configure the fonts. + This is a good design for a paper one usually reads from start to + end. + +\item[Reference Manual Style] + A new design that appeared some years ago and is used in recent + reference manuals, is much more suited for our purpose. + \footnote{The ``PostScript Reference Manual'' is one document that + uses such a design.} +\begin{itemize} +\item + The text is printed in rather short lines in the right part of the + page. This part is used for continuous reading. +\item + The wide left margin is used for headings and margin notes. Since + you now have a wide margin it is easier to use long margin notes to + supply additional information and to lead the reader to important + parts of the documents. Please note that the margin is always on the + left side thus two-sided printing does not look symmetrical. This is + done on purpose, because the reader will always start reading at the + left side, and with this layout section headers really ``stand out''. + In a symmetrical layout, half the headers would be buried in the text. +\item + Figures and tables are either inside the text column, inside the + margin or, if necessary, fill the whole page. +\end{itemize} + +\seealso{Section \ref{refmanex}} +Section~\ref{refmanex} describes how to implement such a layout in +\LaTeX. + +\end{description} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +\section{How to change a \LaTeX\ layout?} +\label{layout} + +\subsection{Advantages and Disadvantages of the text processing system \LaTeX} + +\marginlabel{Advantages:} The big advantage of \LaTeX\ is, that it +implements a ``generic'' or ``logical'' design.\index{design, +logical}\index{design, generic} This means that the author has to +specify the \emph{meaning} of special parts of the text like: +headings, citations, lists, literature references, and so on. These +logical definitions will be processed by the system and printed in +the ``correct'' way. The meaning of \emph{correct} is defined in the +document class and additional packages. + +The opposite of this is the ``visual'' design\index{design, visual} +that most text processors use. Here the author has to know the correct +way to set certain parts of the text and take care of the correct +printing. + +The logical design makes it easier for the author to write +consistent documents (\ie\ same font and fontsize for section headings +of the same level, same layout for lists and enumerations, \dots). + +\marginlabel{Disadvantages:} +The main disadvantage of \LaTeX\ is that the author has only limited +means to change the layout and that she has only four classes to +choose from. This has changed a great deal with the appearance of the +Script classes for \LaTeX\ 2.09 in 1992, which in turn have been replaced by +the even more improved Koma-Script classes for \LaTeXe. + +Another disadvantage is that \LaTeX\ seems to be tied to the +``Computer modern'' font family. This is simply not true, at least +not when you have a PostScript printer. Setting up different fonts +isn't an easy task, but once they are installed they are as easy +to use as the standard fonts. + +But \LaTeX\ is much more powerful and flexible: you can define an +arbitrary design by changing the definitions in the class files or +overwrite them by packages. This is easier than you may think and +happens more often than you think. Many universities and publishers +have their own \LaTeX\ class but do not distribute it to the +world.\footnote{You can find a generic \texttt{elsevier.cls} on CTAN +which you can use to prepare article before submission. This will be +replaced by the magazine-specific class at the publisher.} + + +\subsection{Input files and class files} + +According to the principle of separation of content and design, +there are two kind of files: + +\begin{itemize} +\item + The content and the logical structure of a document are defined in + the \LaTeX\ input file. +\item + The design (layout) is defined in the class files and packages. +\end{itemize} +Which class and packages files a document will use is defined at the +beginning of the input file. The \verb|\documentclass| command +selects the class and the \verb+\usepackage+ command specifies +additional packages. + +To generate a paper you need at least two files, the input file and a +class file. + +These two files represent the work of the author and designer as +explained in the introduction. Even if the author and the designer are +the same person, this has some advantages: + +\begin{itemize} +\item + Similar documents (that appear in a series) have the same layout + because the layout is defined in a file of its own and not part of + the document. +\item + You can print the same contents without much work in different + layouts, \eg\ as an article for a magazine and as a chapter for a + dissertation. +\end{itemize} + +\subsection{Class files and Packages} + +\LaTeX\ supports a hierarchy of layout definitions. +\begin{itemize} +\item + The first file processed is the class file that is specified inside + the curly braces of the \verb|\documentclass| command. This + defines the kind of document you want to write. +\item + The optional argument of the \verb|\documentclass| command inside + the square brackets defines class options which select variants of + the basic layout,such as different font sizes. +\item + The last step is reading the packages specified by the + \verb|\usepackage| command. This command again takes options to + select the layout. +\item + You can change layout parameters in the input file, but this is + discouraged because it violates the principle of separation of + content and design. + +\end{itemize} + +There are some important differences between class and package files +and ``normal'' input files: +\begin{itemize} +\item + Class and package files should only contain definitions. They must + not output text. +\item + The ``at''-sign \texttt{@} is treated as a letter and therefore may + appear in command names. Most internal commands of \LaTeX\ contain + an \texttt{@} to prevent the author from using them accidentally. +\item + The extension of the file is \texttt{.cls}, \texttt{.clo} or + \texttt{.sty} instead of \texttt{.tex}. +\end{itemize} + +\subsection{Changing the layout, step by step} +\index{changing the layout, step by step} + +It is usually easier to change existing class files instead of +writing a new one from scratch. In many cases it is even sufficient +so replace some definitions and put them into a package instead of +creating a new class. + +Please note that you are \emph{not} allowed to change the standard +classes distributed with \LaTeX. You \emph{have} to change the name +when you want to make changes. That is another reason to put small +changes in packages. + +\subsubsection{Defining the differences between the desired and +the available layout} + +The first step is to define the difference between the layout you have +and the layout you want. + +\subsubsection{Finding the original definition} + +The next step is to find out where the original layout is defined. It +is best to search the files in the following order:\footnote{This hint +came from Sue Brooks, who held a workshop for ``\LaTeX-Hacker'' at the +1988 \TeX-conference in Exeter.} +\begin{enumerate} +\item the \LaTeX\ manual by Leslie Lamport, +\item the \LaTeX\ documentations files \texttt{*.dtx} for the classes +or packages +\item the \LaTeX\ documentations files \texttt{*.dtx} for the kernel, +\item the \TeX book by Donald E.~Knuth. +\end{enumerate} + +The files are usually documented quite well so you should be able to +change things even if you don't understand everything. + + +\subsubsection{Writing a new package file} + +The third step is to create a new package. You choose an appropriate +name for the package (like \texttt{mysty}) and create a filename by +adding the extension \texttt{.sty}. + +This file will only contain the definitions you want to change or the +new commands you want to define. + +If you want to change definitions or certain parameters, the best way +is to copy them from the original file and modify them according to +your liking. + +Defining new commands is easier when you find similar commands in the +original files which you can change. + +It is always a good idea to include the reason you wrote the package, +the changes it makes and the new commands it defines in the file. You +should include the date of the last change and the \LaTeX\ version it +works with, just in case some internal \LaTeX\ commands you use will change. + +When writing larger packages, it is an even better idea to use the +\texttt{docstrip} program which is used to document the \LaTeXe\ files. Thus +you have your code and documentation in one file and it's easier to +keep them from going out of sync. + +\subsubsection{Using the new package} + +To use the new package, you call it with the \verb|\usepackage| command. +This command executes the code of your package and changes the layout +as desired. + +Example: + +\begin{verbatim} + \documentclass[11pt,twoside,a4paper]{article} + \usepackage{mysty} %<- This calls the package "mysty" +\end{verbatim} + +You shouldn't need to change anything else in your input file, unless +you defined new commands or environments that are not available in +standard \LaTeX. + +\attention +When you copy your input file to a different computer you have to +include your new packages as well. Otherwise the document can't be +processed. + +%%%%%% %%%%%%%%%% %%%%%%%%%% %%%%%%%%%% %%%%%%%%% + +\subsection{A simple example (Equation numbers)} + +Let's assume that you want to write an article where the equations are +numbered separately in every section. In the \LaTeX\ manual you find a +notice that the report class does something similar for every chapter. + +Looking into the file \texttt{report.cls} you will find the following +commands that deal with equation numbers:\nopagebreak +\begin{verbatim} + \@addtoreset{equation}{chapter} + \def\theequation{\thechapter .\arabic{equation}} + % or in LaTeX2e since 1995/06/01: + \renewcommand\theequation{ + \thechapter.\@arabic\c@equation + } +\end{verbatim} + +You don't necessarily need to understand these two commands in detail. + +Now you create an new file with the name +\texttt{eqpersec.sty}\footnote{Depending on the computer you are using +the name may be different like \texttt{EQPERSEC\_STY} on a CYBER +running NOS/VE. But note that you must not use spaces in the +filename.} and copy the commands above into that file. After that +you replace every occurrence of \texttt{chapter} with \texttt{section} +and add some comments.\nopagebreak +\begin{verbatim} + % This is equation_per_section.sty + % Short name: eqpersec.sty + % Original file by Hubert Partl 1988 + % Modified by Axel Kielhorn 1996/01/01 + % to support LaTeX 1995/06/01 and later + % + % reset the equation counter at the start + % of a new section + % + \@addtoreset{equation}{section} + % Equationnumber = sectionnummer.equationnummer + % Use only one of the below + % depending on you LaTeX version + % + %\def\theequation{\thesection .\arabic{equation}} + % or in more recent versions of LaTeX + \renewcommand\theequation{ + \thesection.\@arabic\c@equation + } +\end{verbatim} + + +Whenever you use a \verb|\usepacakge{eqpersec}| command as in +\nopagebreak +\begin{verbatim} +\documentclass[11pt]{article} +\usepackage{eqpersec} +\end{verbatim} +you will get equations numbered according to your conventions. + + +%%%%%%%%%% %%%%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%%%%%% %%%%%%%% %%%%%%%%%%%% + +\subsection{A more complex example (Reference Manual)} +\label{refmanex} + +We want to create a layout similar to the one used in the \textit{PostScript +Reference Manual}, with a wide left margin for headings and margin +notes and a small margin at the right and bottom. + +\subsubsection{Page layout} + +To define the new layout we use the commands described in the \LaTeX\ +manual. For full details see the file \texttt{refman.dtx}. + +%\pagebreak[2] + +\marginlabel{Horizontal:} +First we define two new names for length that we will use often: + +\cs{fullwidth} is the width of the whole page minus a margin of 1~inch +on every side. +% +\begin{displaymath} +\texttt{fullwidth} = \texttt{paperwidth} - 2\ \textrm{inch} +\end{displaymath} +% +From this the width of the text is calculated. +% +\begin{displaymath} +\texttt{textwidth} = \texttt{fullwidth} \times \texttt{textfraction} +\end{displaymath} +% +\cs{leftmarginwidth} is the width of the left margin that will be +used for headings and margin notes. +\begin{displaymath} +\texttt{leftmarginwidth} = \texttt{fullwidth} - \texttt{textwidth} +\end{displaymath} +% +This is a little more difficult in reality because the lengths have to +be rounded to full points and a possible two column layout -- as used +in the index -- must be taken into consideration. + +\marginlabel{Vertical:} +The vertical layout is a little more difficult because you have to +deal with the page header and footer. +% +\begin{displaymath} +\texttt{textheight} = \texttt{paperheight} - 2.5\ \textrm{inch} +\end{displaymath} +% +The result of this calculation is rounded to full lines. Depending on +the page style -- headings or footings -- it is shifted up or down by one +line. + +\vspace{0pt plus 1cm} + +\subsubsection{Section headings} + +The headings have to be modified to make them extend into the left +margin. + +In file \texttt{classes.dtx} we find the \verb|\@startsection| command +that defines the layout of the headings. Only parameters 4 to 6 are +relevant for us: parameter 4 is the space above and parameter 5 the +space below the section. The 6th parameter does the actual formatting. + +This is the original definition:\nopagebreak +\begin{verbatim} +\newcommand\section{\@startsection + {section}{1}{\z@}% + {-3.5ex plus -1ex minus -.2ex}% + {2.3ex plus .2ex}% + {\normalfont\Large\bfseries}} +\end{verbatim} + +The commands for sub- and subsubsections are similar. Note that the +measures are all in \texttt{ex}, thus depending on the font size used. + +We define a new command \cs{secshape} to format the headings. This +command uses the whole width of the page for the heading. To discourage +hyphenation of the heading we give it a high penalty. This still +allows hyphenation when absolutely necessary. + +\begin{verbatim} +\newcommand\secshape{% + \leftskip=-\leftmarginwidth% + \rightskip=\@flushglue% + \hyphenpenalty=2000} +\end{verbatim} + +This command is inserted into the 6th parameter of \verb|\@startsection|. + +Since the headings now extend into the left margin, we can use a +smaller font and reduce the space between the text and the heading. The +new definition looks like the following:\nopagebreak +\begin{verbatim} +\newcommand\section{\@startsection + {section}{1}{\z@}% + {-2ex plus -1ex minus -.2ex}% + {0.5ex plus .2ex}% + {\secshape\normalfont\large\bfseries}} +\end{verbatim} + +\vspace{0pt plus 1cm} + +\subsubsection{Setting the margin notes} + +The margin notes should always appear on the left side of the text. +The normal layout puts them into the outer margin in twoside layout. + +The file \texttt{latex.dtx} contains the definition of the +\verb|\@addmarginpar| command which is responsible for the margin +notes. We don't have to understand the whole definition; the important +part is the internal variable \verb|\@tempcnta| that is either +\verb|\@ne| (1) when the note should appear on the right side of the +text or \verb|\m@ne| ($-1$) when it should appear on the left side. + +This is done by the following lines: +\begin{verbatim} + \@tempcnta\@ne + \if@twocolumn + \if@firstcolumn \@tempcnta\m@ne \fi + \else + \if@mparswitch + \ifodd\c@page \else\@tempcnta\m@ne \fi + \fi + \if@reversemargin \@tempcnta -\@tempcnta \fi + \fi +\end{verbatim} + +which we simply replace by: +\begin{verbatim} + \@tempcnta\m@ne +\end{verbatim} + +The remaining lines that handle the setting of the margin note +depending on the parameter \verb|\@tempcnta| are left unchanged. + +\subsubsection{Extensions} + +The definitions described above are sufficient for simple applications +but in practical use one may want some additional commands. +\seealso{Appendix \ref{refman}} You will find the description for the whole new +class in the appendix~\ref{refman}. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\input lay_e2 + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\printindex + +\end{document} diff --git a/macros/latex/contrib/refman/pagepc.sty b/macros/latex/contrib/refman/pagepc.sty new file mode 100644 index 0000000000..e0f2c20895 --- /dev/null +++ b/macros/latex/contrib/refman/pagepc.sty @@ -0,0 +1,99 @@ +%% +%% This is page-per-chapter-package +%% version 2.0 +%% +% Copyright 1998 - 99 by Axel Kielhorn +% +%% This program can be redistributed and/or modified under the terms +%% of the LaTeX Project Public License Distributed from CTAN +%% archives in directory macros/latex/base/lppl.txt; either +%% version 1 of the License, or any later version. +%% +%% Don't use it with repref! +%% Refrep has these commands already implemented +%% +%% This version forces openright!! +%% +%% Index-commands should work in chapters and appedices, +%% they will not work as expected in the preface when the +%% pagenumbering is not arabic. (MakeIndex can't sort roman- +%% numbers) +%% +%% Bugs: +%% The index is sortet according to the pagenumber +%% without looking at the chapternumber. +%% I don't think MakeIndex could handle that. +%% + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{pagepc}[1995/05/13] + +\@ifundefined{chapter} +{\PackageError{pagepc}{% + You can't number your pages per chapter\MessageBreak when you + have no chapters + }{% + Use ``report'' or ``book'' instead. + } +}% +{} + +%% Reset the pagecounter to 1 at the start of a new chapter +%% +\let\ppchapter=\@chapter +\def\@chapter{\if@pageperchapter\setcounter{page}{1}\fi + \ppchapter} + +%% Force a pagebreak at the start of the appendix, otherwise +%% the number of the page right befor the appendix comes +%% out wrong +%% +\let\ppappendix=\appendix +\def\appendix{\if@pageperchapter\newpage\fi\ppappendix} + +\newif\if@pageperchapter \@pageperchapterfalse + +%% This command enables Page-per-Chapter, it is not on by +%% default to allow roman pagenumbers in the preface +%% (see sample-document) +%% +\newcommand{\pageperchapter} + {\@pageperchaptertrue + \@openrighttrue + % Remember old setting for chapter 0 = preface + \let\ppthepage=\thepage + % The new number needs more space + \renewcommand\@pnumwidth{2.55em} + % Here it comes :-) + \renewcommand\thepage{% + \ifnum \c@chapter = \z@ + \ppthepage + \else + \thechapter\ -- \arabic{page} + \fi + } + } + +%% This is a hack to make MakeIndex happy :-( +%% You can't use the |-form of an indexentry because +%% it is used to store the chapternumber. +%% +\def\@wrindex#1{% + \ifnum \c@chapter = \z@ + \protected@write\@indexfile{}% + {\string\indexentry{#1}{\arabic{page}}}% + % The above is wrong if pagenumbering!=arabic, + % but I think this is better than nothing. + \else + \protected@write\@indexfile{}% + {\string\indexentry{#1|ppc{\thechapter}}{\arabic{page}}}% + \fi + \endgroup + \@esphack +} + +%% This prints the pagenumber in the index +%% +\def\ppc#1#2{#1 -- #2} + +\endinput diff --git a/macros/latex/contrib/refman/refman.dtx b/macros/latex/contrib/refman/refman.dtx new file mode 100644 index 0000000000..ebec8d9cd5 --- /dev/null +++ b/macros/latex/contrib/refman/refman.dtx @@ -0,0 +1,3874 @@ +% \iffalse meta-comment +% +% Copyright 1988 - 94 by H. Partl. +% Copyright 1994 - 2006 by Axel Kielhorn +% +% This program can be redistributed and/or modified under the terms +% of the LaTeX Project Public License Distributed from CTAN +% archives in directory macros/latex/base/lppl.txt; either +% version 1 of the License, or any later version. +% +% IMPORTANT NOTICE: +% +% For error reports in case of UNCHANGED versions contact +% A.Kielhorn@web.de +% +% \fi +% \CheckSum{2625} +%% \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 \~} +% +% \iffalse +% \section{Identification} +% +% These document classes can only be used with \LaTeXe, so we make +% sure that an appropriate message is displayed when another \TeX{} +% format is used. +% \begin{macrocode} +%<+refart|refrep>\NeedsTeXFormat{LaTeX2e}[1995/12/01] +% \end{macrocode} +% +% Announce the Class name and its version: +% \begin{macrocode} +%<+refart>\ProvidesClass{refart} +%<+refrep>\ProvidesClass{refrep} +%<*driver> +\ProvidesFile{refman.drv} +%</driver> + [2006/11/13 v2.0e +%<+refart|refrep> LaTeX document class] +% \end{macrocode} +% \fi +% +% \iffalse +% \section{A driver for this document} +% +% The next bit of code contains the documentation driver file for +% \TeX{}, i.e., the file that will produce the documentation you are +% currently reading. It will be extracted from this file by the +% {\sc docstrip} program. +% Whenever I refer to Refman, I'm talking about both classes. +% When I'm talking about things that are special to one class I refer +% to the classnames \file{refart} and \file{refrep}. +% \begin{macrocode} +%<*driver> +] +\documentclass{ltxdoc} +% \end{macrocode} +% +% We don't want everything to appear in the index +% \begin{macrocode} +\DoNotIndex{\',\.,\@M,\@@input,\@addtoreset,\@arabic,\@badmath} +\DoNotIndex{\@centercr,\@cite} +\DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue} +\DoNotIndex{\@input,\@ixpt,\@m} +\DoNotIndex{\@minus,\@mkboth,\@ne,\@nil,\@nomath,\@plus,\@set@topoint} +\DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb} +\DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt} +\DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt} +\DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace} +\DoNotIndex{\advance,\Alph,\alph} +\DoNotIndex{\arabic,\ast,\begin,\begingroup,\bfseries,\bgroup,\box} +\DoNotIndex{\bullet} +\DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption} +\DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass} +\DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist} +\DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup} +\DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter} +\DoNotIndex{\fbox} +\DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef} +\DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule} +\DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi} +\DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi} +\DoNotIndex{\input} +\DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark} +\DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright} +\DoNotIndex{\month,\newcommand,\newcounter,\newenvironment} +\DoNotIndex{\NeedsTeXFormat,\newdimen} +\DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number} +\DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@} +\DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip} +\DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions} +\DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright} +\DoNotIndex{\refstepcounter,\relax,\renewcommand,\reset@font} +\DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily,\roman} +\DoNotIndex{\roman,\secdef,\selectfont,\setbox,\setcounter,\setlength} +\DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space} +\DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase} +\DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt} +\DoNotIndex{\viipt,\vipt,\vskip,\vspace} +\DoNotIndex{\wd,\xiipt,\year,\z@} +% \end{macrocode} +% We do want an index, using linenumbers +% \begin{macrocode} +\EnableCrossrefs +% \end{macrocode} +% We use so many \file{docstrip} modules that we set the +% \texttt{StandardModuleDepth} counter to 1. +% \begin{macrocode} +\setcounter{StandardModuleDepth}{1} +% \end{macrocode} +% The following command retrieves the date and version information +% from the file. +% \begin{macrocode} +\GetFileInfo{refman.drv} +% \end{macrocode} +% Some commonly used abbreviations +% \begin{macrocode} +\newcommand*\Lopt[1]{\textsf {#1}} +\newcommand*\file[1]{\texttt {#1}} +\newcommand*\Lcount[1]{\textsl {\small#1}} +\newcommand*\pstyle[1]{\textsl {#1}} +% \end{macrocode} +% We also want the full details. +% \begin{macrocode} +\begin{document} +\DocInput{refman.dtx} +\PrintIndex +% ^^A\PrintChanges +\end{document} +%</driver> +% \end{macrocode} +% +% \fi +% +% +% \title{Document Class \texttt{refman} for \LaTeX{} version 2e\thanks +% {This file has version number \fileversion, last revised +% \filedate.}} +% +% \author{% +% Copyright (C) 1988 by Hubert Partl \and +% Copyright (C) 1994-2006 by Axel Kielhorn +% } +% \date{\filedate} +% \maketitle +% \tableofcontents +% +% \StopEventually{} ^^A +% +% \section{The {\sc docstrip} modules} +% +% The following modules are used in the implementation to direct +% {\sc docstrip} in generating the external files: +% \begin{center} +% \begin{tabular}{ll} +% refart & produce the documentclass refart\\ +% refrep & produce the documentclass refrep\\ +% driver & produce a documentation driver file \\ +% \end{tabular} +% \end{center} +% +% \section{Initial Code} +% +% In this part we define a few commands that are used later on. +% +% \begin{macro}{\@ptsize} +% This control sequence is used to store the second digit of the +% pointsize we are typesetting in. So, normally, its value is one +% of 0, 1 or 2. +% \begin{macrocode} +%<*refart|refrep> +\newcommand\@ptsize{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\if@restonecol} +% Only the index is printed in two-column layout. +% \begin{macrocode} +\newif\if@restonecol +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\if@titlepage} +% A switch to indicate if a titlepage has to be produced. For the +% \file{refart} document class the default is not to make a separate +% titlepage. +% \begin{macrocode} +\newif\if@titlepage +%<+refart>\@titlepagefalse +%<+refrep>\@titlepagetrue +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\if@openright} +% A switch to indicate if chapters must start on a right-hand page. +% The default for the \file{refrep} class is no. There are no +% chapters in the \file{refart} class. +% \begin{macrocode} +%<+refrep>\newif\if@openright +% \end{macrocode} +% \end{macro} +% +% +% \section{Declaration of Options} +% +% +% \subsection{Setting Paper Sizes} +% +% The variables |\paperwidth| and |\paperheight| should reflect the +% physical paper size after trimming. For desk printer output this +% is usually the real paper size since there is no post-processing. +% Classes for real book production will probably add other paper +% sizes and additionally the production of crop marks for trimming. +% Since \file{repbook} does not exist you may change the +% papersizes in your document if needed. +% \begin{macrocode} +\DeclareOption{a4paper} + {\setlength\paperheight {297mm}% + \setlength\paperwidth {210mm}} +\DeclareOption{a5paper} + {\setlength\paperheight {210mm}% + \setlength\paperwidth {148mm}} +\DeclareOption{b5paper} + {\setlength\paperheight {250mm}% + \setlength\paperwidth {176mm}} +\DeclareOption{letterpaper} + {\setlength\paperheight {11in}% + \setlength\paperwidth {8.5in}} +\DeclareOption{legalpaper} + {\setlength\paperheight {14in}% + \setlength\paperwidth {8.5in}} +\DeclareOption{executivepaper} + {\setlength\paperheight {10.5in}% + \setlength\paperwidth {7.25in}} +% \end{macrocode} +% +% \changes{v2.0e}{2006/08/10}{Added option smallborder with smaller +% margins.} +% +% A new lenght |\papermarginwidth| is allocated and set to 1 in. The +% option \Lopt{smallborder} reduces the margin around the document to 0.25 in. +% This is suitable for documents that are ment to be read on the screen, +% since it wastes less screen area. It is probably no good idea to use +% this option for a printed document. +% +% If you want to change this margin use |\setlength\papermarginwidth| in +% your document and issue a |\settowidth{0.7}| command to recalculate the +% page layouot. +% \begin{macrocode} +\newlength\papermarginwidth +\setlength\papermarginwidth {1in} +\DeclareOption{smallborder} + {\setlength\papermarginwidth {0.25in}} +% \end{macrocode} +% +% The option \Lopt{landscape} switches the values of |\paperheight| +% and |\paperwidth|, assuming the dimensions were given for portrait +% paper. +% \begin{macrocode} +\DeclareOption{landscape} + {\setlength\@tempdima {\paperheight}% + \setlength\paperheight {\paperwidth}% + \setlength\paperwidth {\@tempdima}} +% \end{macrocode} +% +% The option \Lopt{square} assigns the values of |\paperwidth| +% to |\paperheight|, which will result in a square layout. +% If you use \Lopt{landscape} first you will get a square layout +% which uses the height of your original paper. +% \begin{macrocode} +\DeclareOption{square} + {\setlength\paperheight {\paperwidth}} +% \end{macrocode} +% +% \subsection{Telling the DVI-driver what we know} +% +% \changes{v2.0e}{2006/11/13}{Add support for DVIPS} +% \changes{v2.0e}{2006/10/08}{Add support for PDFTEX} +% \changes{v2.0e}{2006/11/13}{Made this an option (cleaner)} +% +% We know the actual paper size, let's tell the dvi-driver about it. +% You have to specify the dvi-driver you are using. These three options +% are compatible to the options of the KOMA-script class, thanks Markus. +% +% \begin{macro}{dvips} +% \begin{macrocode} +\DeclareOption{dvips}{\AtBeginDocument{\AtBeginDvi{% + \special{papersize=\the\paperwidth,\the\paperheight}}}} +% \end{macrocode} +% \end{macro} + +% \begin{macro}{pdftex} +% \begin{macrocode} +\DeclareOption{pdftex}{\AtBeginDocument{% + \pdfpagewidth=\paperwidth \pdfpageheight=\paperheight}} +% \end{macrocode} +% \end{macro} +% +% Since we need to know whether we are generating DVI or PDF we +% can make this information available to the user as well. +% +% \begin{macro}{\ifpdfoutput} +% \begin{macrocode} +\newcommand{\ref@ifpdfoutput}[2]{% + \begingroup\@ifundefined{pdfoutput}{\endgroup #2}{\endgroup% + \ifnum\pdfoutput>0\relax #1\else #2\fi}}% +\@ifundefined{ifpdfoutput}{% + \let\ifpdfoutput\ref@ifpdfoutput}{% +%<*refart> +\PackageInfo{refart} +%</refart> +%<*refrep> +\PackageInfo{refrep} +%</refrep> + {\string\ifpdfoutput\space already defined.\MessageBreak + If \string\ifpdfoutput\space does not behave like\MessageBreak + is is described at the Refman manual, try find out\MessageBreak + at which package \string\ifpdfoutput\space was defined.}} +% \end{macrocode} +% \end{macro} +% +% The option \Lopt{pagesize} will export the correct definition +% for the dvi-driver used. (Unless magic fails, then you need to +% specify the driver manually.) +% +% \begin{macro}{pagesize} +% \begin{macrocode} +\DeclareOption{pagesize}{\AtBeginDocument{% + \ref@ifpdfoutput + {\pdfpagewidth=\paperwidth\pdfpageheight=\paperheight} + {\AtBeginDvi{\special{papersize=\the\paperwidth,\the\paperheight}}}}} +% \end{macrocode} +% \end{macro} +% +% \subsection{Choosing the type size} +% +% The type size options are handled by defining |\@ptsize| to contain +% the last digit of the size in question and branching on |\ifcase| +% statements. This is done for historical reasons, to stay compatible +% with other packages that use the |\@ptsize| variable to select +% special actions. It makes the declarations of size options less +% than 10pt difficult, although one can probably use \texttt{8} +% assuming that a class won't define both \Lopt{8pt} and \Lopt{18pt} +% options. +% +% \begin{macrocode} +\DeclareOption{10pt}{\renewcommand\@ptsize{0}} +\DeclareOption{11pt}{\renewcommand\@ptsize{1}} +\DeclareOption{12pt}{\renewcommand\@ptsize{2}} +% \end{macrocode} +% +% \subsection{Two-side or one-side printing} +% +% For two-sided printing we use the switch |\if@twoside|. +% We set |\if@mparswitch| which does nothing now but +% is kept for compatibility reasons. +% \begin{macrocode} +\DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse} +\DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue} +% \end{macrocode} +% +% +% \subsection{Draft option} +% +% If the user requests \Lopt{draft} we show any overfull boxes. +% We could probably add some more interesting stuff to this option. +% \begin{macrocode} +\DeclareOption{draft}{\setlength\overfullrule{5pt}} +\DeclareOption{final}{\setlength\overfullrule{0pt}} +% \end{macrocode} +% +% \subsection{Titlepage option} +% The \file{refart} usually has no separate +% titlepage, but the user can request one. +% \begin{macrocode} +\DeclareOption{titlepage} {\@titlepagetrue} +\DeclareOption{notitlepage}{\@titlepagefalse} +% \end{macrocode} +% +% +% \subsection{openright option} +% This option determines whether or not a chapter must start on +% a right-hand page and request one. +% \begin{macrocode} +%<+refrep>\DeclareOption{openright}{\@openrighttrue} +%<+refrep>\DeclareOption{openany} {\@openrightfalse} +% \end{macrocode} +% +% \subsection{Twocolumn printing} +% +% Two-column is used in the index. There is no user command +% or option to request two-column printing. Therefore +% \Lopt{twocolumn} will lead to an error message. +% \begin{macrocode} +\DeclareOption{onecolumn}{\@twocolumnfalse} +\DeclareOption{twocolumn}{% +%<+refart> \ClassError{Refart} +%<+refrep> \ClassError{Refrep} + {There is no twocolumn layout in this class!} + {Can you imagine how twocolumn layout will look\MessageBreak + in this class? That's why!} + \@twocolumnfalse} +% \end{macrocode} +% +% \subsection{Equation numbering on the left} +% +% The option \Lopt{leqno} can be used to get the equation numbers +% on the left side of the equation. +% \begin{macrocode} +\DeclareOption{leqno}{\input{leqno.clo}} +% \end{macrocode} +% +% \subsection{Flush left displays} +% +% The option \Lopt{fleqn} redefines the displayed math environmens +% in such a way that they come out flush left, with an indentation +% of |\mathindent| from the prevailing left margin. +% \begin{macrocode} +\DeclareOption{fleqn}{\input{fleqn.clo}} +% \end{macrocode} +% +% \subsection{Open bibliography} +% +% The option \Lopt{openbib} produces the ``open'' bibliography +% style, in which each block starts on a new line, and succeeding +% lines in a block are indented by |\bibindent|. +% \begin{macrocode} +\DeclareOption{openbib}{% +% \end{macrocode} +% First some hook into the bibliography environment is filled. +% \begin{macrocode} + \AtEndOfClass{% + \renewcommand\@openbib@code{% + \advance\leftmargin\bibindent + \itemindent -\bibindent + \listparindent \itemindent + \parsep \z@ + }% +% \end{macrocode} +% In addition the definition of |\newblock| is overwritten. +% \begin{macrocode} + \renewcommand\newblock{\par}}% +} +% \end{macrocode} +% +% \subsection{User flags} +% +% There are some flags the user may change to control the +% behaviour of some commands: +% +% \begin{macro}{\ifdescriptioncolon} +% This switch controls whether there is a colon in the +% description item or not. The default is to include a colon. +% \begin{macrocode} +\newif\ifdescriptioncolon \descriptioncolontrue +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ifdescriptionleft} +% This switch controls whether the description items +% are set left bound or right bound. The default is right bound. +% \begin{macrocode} +\newif\ifdescriptionleft \descriptionleftfalse +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ifmaxipagerule} +% This switch controls whether there is a rule at the +% beginning and end of a maxipage. This flag may later be used +% to select rules at other places (like part or chapter) as well. +% +% \begin{macrocode} +\newif\ifmaxipagerule \maxipageruletrue +% \end{macrocode} +% \end{macro} +% +% +% \section{Executing Options} +% +% Here we execute the default options to initialize certain +% variables. +% \begin{macrocode} +%<*refart> +\ExecuteOptions{letterpaper,10pt,oneside,onecolumn,final} +%</refart> +%<*refrep> +\ExecuteOptions{letterpaper,10pt,oneside,onecolumn,final,openany} +%</refrep> +% \end{macrocode} +% +% The |\ProcessOptions| command causes the execution of the code +% for every option \Lopt{FOO} +% which is declared and for which the user typed +% the \Lopt{FOO} option in his +% |\documentclass| command. For every option \Lopt{BAR} he typed, +% which is not declared, the option is assumed to be a global option. +% All options will be passed as document options to any +% |\usepackage| command in the document preamble. +% \begin{macrocode} +\ProcessOptions +% \end{macrocode} +% +% Now that all the options have been executed we can load the +% chosen class option file that contains all size dependent-code. +% We are using the \file{sizexx.clo} Files from classes.dtx now +% and do the page layout caculation inside the class-file. +% \begin{macrocode} +%<*refart|refrep> +\input{size1\@ptsize.clo} +%</refart|refrep> +% \end{macrocode} +% +% \section{Loading Packages} +% +% The standard class files do not load additional packages. +% +% +% \section{Document Layout} +% \label{sec:maincode} +% +% In this section we are finally dealing with the nasty typographical +% details. +% +% \subsection{Fonts} +% +% \LaTeX\ offers the user commands to change the size of the font, +% relative to the `main' size. Each relative size changing command +% |\size| executes the command +% |\@setfontsize||\size|\meta{font-size}\meta{baselineskip} where: +% +% \begin{description} +% \item[\meta{font-size}] The absolute size of the font to use from +% now on. +% +% \item[\meta{baselineskip}] The normal value of |\baselineskip| +% for the size of the font selected. (The actual value will be +% |\baselinestretch| * \meta{baselineskip}.) +% \end{description} +% +% A number of commands, defined in the \LaTeX{} kernel, shorten the +% following definitions and are used throughout. They are: +% \begin{center} +% \begin{tabular}{ll@{\qquad}ll@{\qquad}ll} +% \verb=\@vpt= & 5 & \verb=\@vipt= & 6 & \verb=\@viipt= & 7 \\ +% \verb=\@viiipt= & 8 & \verb=\@ixpt= & 9 & \verb=\@xpt= & 10 \\ +% \verb=\@xipt= & 10.95 & \verb=\@xiipt= & 12 & \verb=\@xivpt= & 14.4\\ +% ... +% \end{tabular} +% \end{center} +% +% \begin{macro}{\normalsize} +% \begin{macro}{\@normalsize} +% +% The user level command for the main size is |\normalsize|. +% Internally, \LaTeX{} uses |\@normalsize| when it refers to the +% main size. |\@normalsize| will be defined to work like +% |\normalsize| if the latter is redefined from its default +% definition (that just issues an error message). Otherwise +% |\@normalsize| simply selects a 10pt/12pt size. +% +% See \file{classes.dtx} for documentaion on \file{sizexx.clo} +% +% \end{macro} +% \end{macro} +% +% \subsection{Paragraphing} +% +% \begin{macro}{\lineskip} +% \begin{macro}{\normallineskip} +% These parameters control \TeX's behaviour when two lines tend to +% come too close together. +% \begin{macrocode} +%<*refart|refrep> +\setlength\lineskip{1\p@} +\setlength\normallineskip{1\p@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\baselinestretch} +% This is used as a multiplier for |\baselineskip|. The default is +% to {\em not\/} stretch the baselines. +% \begin{macrocode} +\renewcommand\baselinestretch{} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\parskip} +% \begin{macro}{\parindent} +% |\parskip| gives extra vertical space between paragraphs and +% |\parindent| is the width of the paragraph indentation. The value +% of |\parindent| is set to 0. +% \begin{macrocode} +\setlength\parskip {0.5\baselineskip \@plus 2\p@} +\setlength\parindent {\z@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@lowpenalty} +% \begin{macro}{\@medpenalty} +% \begin{macro}{\@highpenalty}% +% The commands |\nopagebreak| and |\nolinebreak| put in penalties +% to discourage these breaks at the point they are put in. +% They use |\@lowpenalty|, |\@medpenalty| or |\@highpenalty|, +% dependent on their argument. +% \begin{macrocode} +\@lowpenalty 51 +\@medpenalty 151 +\@highpenalty 301 +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\clubpenalty} +% \begin{macro}{\widowpenalty} +% These penalties are use to discourage club and widow lines. +% Because we use their default values we only show them here, +% commented out. +% \begin{macrocode} +% \clubpenalty 150 +% \widowpenalty 150 +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\displaywidowpenalty} +% \begin{macro}{\predisplaypenalty} +% \begin{macro}{\postdisplaypenalty} +% Discourrage (but not so much) widows in front of a math display +% and forbid breaking directly in front of a display. Allow break +% after a display without a penalty. Again the default values are +% used, therefore we only show them here. +% \begin{macrocode} +% \displaywidowpenalty 50 +% \predisplaypenalty 10000 +% \postdisplaypenalty 0 +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\interlinepenalty} +% Allow the breaking of a page in the middle of a paragraph. +% \begin{macrocode} +% \interlinepenalty 0 +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\brokenpenalty} +% We allow the breaking of a page after a hyphenated line. +% \begin{macrocode} +% \brokenpenalty 100 +% \end{macrocode} +% \end{macro} +% +% +% \subsection{Page Layout} +% +% All margin dimensions are measured from a point one inch from the +% top and lefthand side of the page. +% +% \subsubsection{Vertical spacing} +% +% \begin{macro}{\headheight} +% \begin{macro}{\headsep} +% \begin{macro}{\topskip} +% The |\headheight| is the height of the box that will contain the +% running head. The |\headsep| is the distance between the bottom +% of the running head and the top of the text. |\topskip| is the +% |\baselineskip| for the first line on a page. Only the definition +% of |\headsep| differs from \file{sizexx} and has to be changed. +% \begin{macrocode} +\setlength\headsep {\baselineskip} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \subsubsection{The dimension of text} +% +% \begin{macro}{\fullwidth} +% \begin{macro}{\textwidth} +% \begin{macro}{\leftmarginwidth} +% There is no need to supply a compatibility mode since the +% independent \texttt{refman.sty} was never released to the +% public. +% +% We will set the dimensions differently, +% taking into account the paper size for instance. +% +% First, we calculate the maximum text width, which will fit on the +% selected paper and store it in |\@tempdima|. +% \begin{macrocode} +\newdimen\leftmarginwidth +\newdimen\fullwidth +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\emptyfoottopmargin} +% \begin{macro}{\emptyheadtopmargin} +% Your document uses either \pstyle{footings} or \pstyle{headings}. +% Depending on this, the whole page is shifted up or down by one line. +% \begin{macrocode} +\newdimen\emptyfoottopmargin +\newdimen\emptyheadtopmargin +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\settextfraction} +% You can specify how much of the |\fullwidth| will be used for the +% text by using the |\settextfraction| command. The argument should +% be between 0 and 1. The remaining width is used for the left margin. +% This command recalculates the page layout. You have to call +% |\settextfraction| with the default value of 0.7 to adjust the layout +% when you want to change the |\papermarginwidth|. +% \begin{macrocode} +\newcommand\settextfraction[1]% +{ + \setlength\fullwidth{\paperwidth} + \addtolength\fullwidth{-2\papermarginwidth} + \@settopoint\fullwidth +% \end{macrocode} +% \end{macro} +% +% Now we can set the |\textwidth|, depending on whether we will be +% setting one or two columns. +% +% \begin{macrocode} + \if@twocolumn + \setlength\textwidth{\fullwidth} + \else + \setlength\textwidth{#1\fullwidth} + \fi +% \end{macrocode} +% +% Here we modify the width of the text a little to be a whole +% number of points and calculate the remaining margin. +% +% \begin{macrocode} + \@settopoint\textwidth + \setlength\leftmarginwidth{\fullwidth} + \addtolength\leftmarginwidth{-\textwidth} +% \end{macrocode} +% +% \subsubsection{Horizontal margins} +% +% \begin{macro}{\oddsidemargin} +% \begin{macro}{\evensidemargin} +% \begin{macro}{\marginparwidth} +% +% The values for |\oddsidemargin| and |\marginparwidth| will be set +% independing on the status of the |\if@twoside|. (We have the same +% layout on odd and even pages.) +% +% The |\oddsidemargin| is simply the |\papermarginwidth| plus the +% |\leftmarginwidth| calculated earlier, adjusted by 1 in for the printer +% driver offset and rounded to full points. +% \begin{macrocode} + \setlength\oddsidemargin {-1in} + \addtolength\oddsidemargin {\papermarginwidth} + \addtolength\oddsidemargin {\leftmarginwidth} + \@settopoint\oddsidemargin +% \end{macrocode} +% +% Then |\evensidemargin| and |\marginparwidth| are set to +% |\oddsidemargin|. |\marginparwidth| will be modified later. +% \begin{macrocode} + \setlength\evensidemargin {\oddsidemargin} + \setlength\marginparwidth {\leftmarginwidth + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\marginparsep} +% \begin{macro}{\marginparpush} +% The horizontal space between the main text and marginal notes is +% determined by |\marginparsep| (defined in \file{sizexx}), +% the minimum vertical separation +% between two marginal notes is controlled by |\marginparpush| which +% is set to 0 because we will have lots of margin notes. The width +% of the |marginpar| is reduced by |marginparsep| to produce flush left +% pages. +% \begin{macrocode} + \addtolength\marginparwidth {-\marginparsep} + \setlength\marginparpush {0\p@} +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% Now we call |\settextfraction| with the default value of 0.7 +% +% \begin{macrocode} +\@onlypreamble\settextfraction +\settextfraction {0.7} +% \end{macrocode} + + +% \begin{macro}{\textheight} +% Now that we have computed the width of the text, we have to take +% care of the height. The |\textheight| is the height of text +% (including footnotes and figures, excluding running head and +% foot). +% +% Again we compute this, depending on the papersize and depending +% on the baselineskip that is used, in order to have a whole number +% of lines on the page. +% \begin{macrocode} +\setlength\@tempdima {\paperheight} +% \end{macrocode} +% +% We leave at least a |\papermarginwidth| margin on the top and the bottom of +% the page. +% \begin{macrocode} +\addtolength\@tempdima{-2\papermarginwidth} +% \end{macrocode} +% +% The running headers and footers extend partly into the top +% and bottom margins. +% \begin{macrocode} +\addtolength\@tempdima{-.5in} +% \end{macrocode} +% +% Then we divide the result by the current |\baselineskip| and +% store this in the count register |\@tempcnta|, which then +% contains the number of lines that fit on this page. +% \begin{macrocode} +\divide\@tempdima\baselineskip +\@tempcnta=\@tempdima +% \end{macrocode} +% +% From this we can calculate the height of the text. +% \begin{macrocode} +\setlength\textheight{\@tempcnta\baselineskip} +% \end{macrocode} +% +% The first line on the page has a height of |\topskip|. +% \begin{macrocode} +\advance\textheight by \topskip +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Vertical margins} +% +% \begin{macro}{\topmargin} +% The |\topmargin| is the distance between the top of `the +% printable area' --which is 1 inch below the top of the paper-- +% and the top of the box which contains the running head. +% +% It can now be computed from the values set above and rounded to +% full points. +% \begin{macrocode} +\setlength\topmargin {\paperheight} +\addtolength\topmargin{-\headheight} +\addtolength\topmargin{-\headsep} +\addtolength\topmargin{-\textheight} +\addtolength\topmargin{-\footskip} % this might be wrong! +\addtolength\topmargin{-.5\topmargin} +\addtolength\topmargin{-1in} +\@settopoint\topmargin +% \end{macrocode} +% By changing the factor in the next line the complete page +% can be shifted vertically. +% +% The contents of the page is shifted up or down by one +% |\baselineskip| depending on the pagestyle. +% Do not combine headings and footings +% in one document! +% \begin{macrocode} +\setlength\emptyfoottopmargin {\topmargin} +\addtolength\emptyfoottopmargin{\baselineskip} +\setlength\emptyheadtopmargin {\topmargin} +\addtolength\emptyheadtopmargin{-\baselineskip} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Float placement parameters} +% +% All float parameters are given default values in the \LaTeXe{} +% kernel. For this reason counters only need to be set with +% |\setcounter| and other parameters are set using |\renewcommand|. +% +% \paragraph{Limits for the placement of floating objects} +% +% \begin{macro}{\c@topnumber} +% The \Lcount{topnumber} counter holds the maximum number of +% floats that can appear on the top of a text page. +% \begin{macrocode} +\setcounter{topnumber} {2} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\topfraction} +% This indicates the maximum part of a text page that can be +% occupied by floats at the top. +% \begin{macrocode} +\renewcommand\topfraction {.7} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\c@bottomnumber} +% The \Lcount{bottomnumber} counter holds the maximum number of +% floats that can appear on the bottom of a text page. +% \begin{macrocode} +\setcounter{bottomnumber} {1} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\bottomfraction} +% This indicates the maximum part of a text page that can be +% occupied by floats at the bottom. +% \begin{macrocode} +\renewcommand\bottomfraction{.3} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\c@totalnumber} +% This indicates the maximum number of floats that can appear on +% any text page. +% \begin{macrocode} +\setcounter{totalnumber} {3} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\textfraction} +% This indicates the minimum part of a text page that has to be +% occupied by text. +% \begin{macrocode} +\renewcommand\textfraction{.2} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\floatpagefraction} +% This indicates the minimum part of a page that has to be +% occupied by floating objects before a `float page' is produced. +% \begin{macrocode} +\renewcommand\floatpagefraction{.5} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\c@dbltopnumber} +% The \Lcount{dbltopnumber} counter holds the maximum number of +% two column floats that can appear on the top of a two column text +% page. +% \begin{macrocode} +\setcounter{dbltopnumber} {2} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dbltopfraction} +% This indicates the maximum part of a two column text page that +% can be occupied by two column floats at the top. +% \begin{macrocode} +\renewcommand\dbltopfraction{.7} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\dblfloatpagefraction} +% This indicates the minimum part of a page that has to be +% occupied by two column wide floating objects before a `float +% page' is produced. +% \begin{macrocode} +\renewcommand\dblfloatpagefraction{.5} +%</refart|refrep> +% \end{macrocode} +% \end{macro} +% +% \subsection{Page Styles} +% +% The page style \pstyle{foo} is defined by defining the command +% |\ps@foo|. This command should make only local definitions. +% There should be no stray spaces in the definition, since they +% could lead to mysterious extra spaces in the output (well, that's +% something that should be always avoided). +% +% \begin{macro}{\@evenhead} +% \begin{macro}{\@oddhead} +% \begin{macro}{\@evenfoot} +% \begin{macro}{\@oddfoot} +% The |\ps@...| command defines the macros |\@oddhead|, +% |\@oddfoot|, |\@evenhead|, and |\@evenfoot| to define the running +% heads and feet---e.g., |\@oddhead| is the macro to produce the +% contents of the heading box for odd-numbered pages. It is called +% inside an |\hbox| of width |\textwidth|. +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{Marking conventions} +% +% To make headings determined by the sectioning commands, the page +% style defines the commands |\chaptermark|, |\sectionmark|, +% \ldots, where |\chaptermark{|\meta{TEXT}|}| is called by +% |\chapter| to set a mark, and so on. +% +% The |\...mark| commands and the |\...head| macros are defined +% with the help of the following macros. (All the |\...mark| +% commands should be initialized to no-ops.) +% +% \LaTeX{} extends \TeX's |\mark| facility by producing two kinds +% of marks, a `left' and a `right' mark, using the following +% commands: +% \begin{flushleft} +% |\markboth{|\meta{LEFT}|}{|\meta{RIGHT}|}|: Adds both marks. +% +% |\markright{|\meta{RIGHT}|}|: Adds a `right' mark. +% +% |\leftmark|: Used in the |\@oddhead|, |\@oddfoot|, |\@evenhead| +% or |\@evenfoot| macros, it gets the current `left' +% mark. |\leftmark| works like \TeX's |\botmark| +% command. +% +% |\rightmark|: Used in the |\@oddhead|, |\@oddfoot|, |\@evenhead| +% or |\@evenfoot| macros, it gets the current +% `right' mark. |\rightmark| works like \TeX's +% |\firstmark| command. +% \end{flushleft} +% +% The marking commands work reasonably well for right marks +% `numbered within' left marks--e.g., the left mark is changed by a +% |\chapter| command and the right mark is changed by a |\section| +% command. However, it does produce somewhat anomalous results if +% two |\markboth|'s occur on the same page. +% +% +% Commands like |\tableofcontents| that should set the marks in some +% page styles use a |\@mkboth| command, which is |\let| by the +% pagestyle command (|\ps@...|) to |\markboth| for setting the +% heading or to |\@gobbletwo| to do nothing. +% +% +% \begin{macrocode} +% %%%\mark{{}{}} % Initializes TeX's marks <--- can vanish +% \end{macrocode} +% +% \subsubsection{Defining the page styles} +% \label{sec:pagestyle} +% +% The pagestyles \pstyle{empty} is defined in +% \file{latex.dtx}. +% +% \begin{macro}{\ps@plain} +% We have to redefine \pstyle{plain} to support \Lopt{twoside} +% layout. +% +% \begin{macrocode} +%<*refart|refrep> +\if@twoside + \def\ps@plain{% + \let\@mkboth\@gobbletwo + \let\@oddhead\@empty + \let\@evenhead\@empty + \def\@oddfoot{\normalfont\hfil\thepage} + \def\@evenfoot{\normalfont\thepage\hfil}} +\else + \def\ps@plain{% + \let\@mkboth\@gobbletwo + \let\@oddhead\@empty + \let\@evenhead\@empty + \def\@oddfoot{\normalfont\hfil\thepage} + \let\@evenfoot\@oddfoot} +\fi +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ps@headings} +% The definition of the page style \pstyle{headings} has to be +% different for two sided printing than it is for one sided +% printing. +% +% \begin{macrocode} +\if@twoside + \def\ps@headings{% +% \end{macrocode} +% The running feet are empty in this page style, the running head +% contains the page number and one of the marks. +% \begin{macrocode} + \let\@oddfoot\@empty\let\@evenfoot\@empty + \def\@evenhead{\hss\vbox to \z@{\vss\hsize=\fullwidth + \hb@xt@\fullwidth{\thepage\hfil\slshape\leftmark} + \vskip 3\p@ \hrule}}% + \def\@oddhead{\hss\vbox to \z@{\vss\hsize=\fullwidth + \hb@xt@\fullwidth{{\slshape\rightmark}\hfil\thepage} + \vskip 3\p@ \hrule}}% +% \end{macrocode} +% +% When using this page style, the contents of the running head is +% determined by the chapter and section titles. So we |\let| +% |\@mkboth| to |\markboth|. +% \begin{macrocode} + \let\@mkboth\markboth +% \end{macrocode} +% +% We shift the page one |\baselineskip| to the bottom to +% compensate for the headings. +% +% \begin{macrocode} + \topmargin\emptyfoottopmargin +%</refart|refrep> +% \end{macrocode} +% +% For the refart document class we define |\sectionmark| to clear +% the right mark and put the number of the section (when it is +% numbered) and its title in the left mark. The rightmark is set by +% |\subsectionmark| to contain the subsection titles. +% +% Note the use of |##1| for the parameter of the |\sectionmark| +% command, which will be defined when |\ps@headings| is executed. +% +% \begin{macrocode} +%<*refart> + \def\sectionmark##1{% + \markboth {\ifnum \c@secnumdepth >\z@ + \thesection\quad\fi + ##1}{}}% + \def\subsectionmark##1{% + \markright {\ifnum \c@secnumdepth >\@ne + \thesubsection\quad\fi + ##1}}} +%</refart> +% \end{macrocode} +% +% In the refrep document class we use the |\chaptermark| +% and |\sectionmark| macros to fill the running heads. +% +% Note the use of |##1| for the parameter of the |\chaptermark| +% command, which will be defined when |\ps@headings| is executed. +% +% \begin{macrocode} +%<*refrep> + \def\chaptermark##1{% + \markboth {\ifnum \c@secnumdepth >\m@ne + \@chapapp\ \thechapter \ \fi + ##1}{}}% + \def\sectionmark##1{% + \markright {\ifnum \c@secnumdepth >\z@ + \thesection \ \fi + ##1}}} +%</refrep> +% \end{macrocode} +% +% The definition of |\ps@headings| for one sided printing can be +% much simpler, because we treat even and odd pages the same. +% Therefore we don't need to define |\@even...|. +% \begin{macrocode} +%<*refart|refrep> +\else + \def\ps@headings{% + \let\@oddfoot\@empty + \def\@oddhead{\hss\vbox to \z@{\vss\hsize=\fullwidth + \hb@xt@\fullwidth{{\slshape\rightmark}\hfil\thepage} + \vskip 3\p@ \hrule}}% + \let\@mkboth\markboth +% \end{macrocode} +% +% We shift the page one |\baselineskip| to the bottom to +% compensate for the headings. +% +% \begin{macrocode} + \topmargin\emptyfoottopmargin +%</refart|refrep> +% \end{macrocode} +% +% We use |\markright| now instead of |\markboth| as we did for two +% sided printing. +% \begin{macrocode} +%<*refart> + \def\sectionmark##1{% + \markright {\ifnum \c@secnumdepth >\m@ne + \thesection\quad\fi + ##1}}} +%</refart> +% \end{macrocode} +% +% \begin{macrocode} +%<*refrep> + \def\chaptermark##1{% + \markright {\ifnum \c@secnumdepth >\m@ne + \@chapapp\ \thechapter \ \fi + ##1}}} +%</refrep> +%<*refart|refrep> +\fi +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\ps@footings} +% The definition of the page style \pstyle{footings} has to be +% different for two sided printing than it is for one sided +% printing. +% +% \begin{macrocode} +\if@twoside + \def\ps@footings{% +% \end{macrocode} +% The running head is empty in this page style, the running foot +% contains the page number and one of the marks. +% \begin{macrocode} + \let\@oddhead\@empty\let\@evenhead\@empty + \def\@evenfoot{\hss\vbox to \z@{\vss\hsize=\fullwidth + \hrule \vskip 3\p@ + \hb@xt@\fullwidth{\thepage\hfil\slshape\leftmark}}}% + \def\@oddfoot{\hss\vbox to \z@{\vss\hsize=\fullwidth + \hrule \vskip 3\p@ + \hb@xt@\fullwidth{{\slshape\rightmark}\hfil\thepage}}}% +% \end{macrocode} +% +% When using this page style, the contents of the running foot is +% determined by the chapter and section titles. So we |\let| +% |\@mkboth| to |\markboth|. +% \begin{macrocode} + \let\@mkboth\markboth +% \end{macrocode} +% +% We shift the page one |\baselineskip| to the top to +% compensate for the footings. +% +% \begin{macrocode} + \topmargin\emptyheadtopmargin +%</refart|refrep> +% \end{macrocode} +% +% For the refart document class we define |\sectionmark| to clear +% the right mark and put the number of the section (when it is +% numbered) and its title in the left mark. The rightmark is set by +% |\subsectionmark| to contain the subsection titles. +% +% Note the use of |##1| for the parameter of the |\sectionmark| +% command, which will be defined when |\ps@headings| is executed. +% +% \begin{macrocode} +%<*refart> + \def\sectionmark##1{% + \markboth {\ifnum \c@secnumdepth >\z@ + \thesection\quad\fi + ##1}{}}% + \def\subsectionmark##1{% + \markright {\ifnum \c@secnumdepth >\@ne + \thesubsection\quad\fi + ##1}}} +%</refart> +% \end{macrocode} +% +% In the refrep document class we use the |\chaptermark| +% and |\sectionmark| macros to fill the running heads. +% +% Note the use of |##1| for the parameter of the |\chaptermark| +% command, which will be defined when |\ps@footings| is executed. +% +% \begin{macrocode} +%<*refrep> + \def\chaptermark##1{% + \markboth {\ifnum \c@secnumdepth >\m@ne + \@chapapp\ \thechapter \ \fi + ##1}{}}% + \def\sectionmark##1{% + \markright {\ifnum \c@secnumdepth >\z@ + \thesection \ \fi + ##1}}} +%</refrep> +% \end{macrocode} +% +% The definition of |\ps@footings| for one sided printing can be +% much simpler, because we treat even and odd pages the same. +% Therefore we don't need to define |\@even...|. +% \begin{macrocode} +%<*refart|refrep> +\else + \def\ps@footings{% + \let\@oddhead\@empty + \def\@oddfoot{\hss\vbox to \z@{\vss\hsize=\fullwidth + \hrule \vskip 3\p@ + \hb@xt@\fullwidth{{\slshape\rightmark}\hfil\thepage}}}% + \let\@mkboth\markboth +% \end{macrocode} +% +% We shift the page one |\baselineskip| to the top to +% compensate for the footings. +% +% \begin{macrocode} + \topmargin\emptyheadtopmargin +%</refart|refrep> +% \end{macrocode} +% +% We use |\markright| now instead of |\markboth| as we did for two +% sided printing. +% \begin{macrocode} +%<*refart> + \def\sectionmark##1{% + \markright {\ifnum \c@secnumdepth >\m@ne + \thesection\quad\fi + ##1}}} +%</refart> +% \end{macrocode} +% +% \begin{macrocode} +%<*refrep> + \def\chaptermark##1{% + \markright {\ifnum \c@secnumdepth >\m@ne + \@chapapp\ \thechapter \ \fi + ##1}}} +%</refrep> +%<*refart|refrep> +\fi +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ps@myheadings} +% The definition of the page style \pstyle{myheadings} is fairly +% simple because the user determines the contents of the running +% head himself by using the |\markboth| and |\markright| commands. +% +% \begin{macrocode} +\def\ps@myheadings{% + \let\@oddfoot\@empty\let\@evenfoot\@empty + \def\@evenhead{\hss\vbox to \z@{\vss\hsize=\fullwidth + \hb@xt@\fullwidth{\thepage\hfil\slshape\leftmark} + \vskip 3\p@ \hrule}}% + \def\@oddhead{\hss\vbox to \z@{\vss\hsize=\fullwidth + \hb@xt@\fullwidth{{\slshape\rightmark}\hfil\thepage} + \vskip 3\p@ \hrule}}% +% \end{macrocode} +% +% We have to make sure that the marking commands that are used by +% the chapter and section headings are disabled. We do this +% |\let|ting them to a macro that gobbles its argument(s). +% \begin{macrocode} + \let\@mkboth\@gobbletwo +%<+refrep> \let\chaptermark\@gobble + \let\sectionmark\@gobble +%<+refart> \let\subsectionmark\@gobble +% \end{macrocode} +% +% We shift the page one |\baselineskip| to the bottom to +% compensate for the headings. +% +% \begin{macrocode} + \topmargin\emptyfoottopmargin + } +% \end{macrocode} +% +% \end{macro} +% +% \begin{macro}{\ps@myfootings} +% The definition of the page style \pstyle{myfootings} is fairly +% simple because the user determines the contents of the running +% head himself by using the |\markboth| and |\markright| commands. +% +% \begin{macrocode} +\def\ps@myfootings{% + \let\@oddhead\@empty\let\@evenhead\@empty + \def\@evenfoot{\hss\vbox to \z@{\vss\hsize=\fullwidth + \hrule \vskip 3\p@ + \hb@xt@\fullwidth{\thepage\hfil\slshape\leftmark}}}% + \def\@oddfoot{\hss\vbox to \z@{\vss\hsize=\fullwidth + \hrule \vskip 3\p@ + \hb@xt@\fullwidth{{\slshape\rightmark}\hfil\thepage}}}% +% \end{macrocode} +% +% We have to make sure that the marking commands that are used by +% the chapter and section footings are disabled. We do this +% |\let|ting them to a macro that gobbles its argument(s). +% \begin{macrocode} + \let\@mkboth\@gobbletwo +%<+refrep> \let\chaptermark\@gobble + \let\sectionmark\@gobble +%<+refart> \let\subsectionmark\@gobble +% \end{macrocode} +% +% We shift the page one |\baselineskip| to the top to +% compensate for the footings. +% +% \begin{macrocode} + \topmargin\emptyheadtopmargin + } +% \end{macrocode} +% +% \end{macro} +% +% \section{Document Markup} +% +% \subsection{The title} +% +% \begin{macro}{\title} +% \begin{macro}{\author} +% \begin{macro}{\date} +% These three macros are provided by \file{latex.dtx} to provide +% information about the title, author(s) and date of the document. +% The information is stored away in internal control sequences. +% It is the task of the |\maketitle| command to use the +% information provided. The definitions of these macros are shown +% here for information. +% \begin{macrocode} +% \newcommand*{\title}[1]{\gdef\@title{#1}} +% \newcommand*{\author}[1]{\gdef\@author{#1}} +% \newcommand*{\date}[1]{\gdef\@date{#1}} +% \end{macrocode} +% The |\date| macro gets today's date by default. +% \begin{macrocode} +% \gdef\@date{\today} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\maketitle} +% The definition of |\maketitle| depends on whether a separate +% title page is made. This is the default for \texttt{refrep}. If +% you want a titlepage with \texttt{refart} you can enable it +% using the \texttt{titlepage} option. +% +% When we are making a title page, we locally redefine +% |\footnotesize| and |footnoterule| to change the appearance of +% the footnotes that are produced by the |\thanks| command. +% \begin{macrocode} +\if@titlepage + \newcommand\maketitle{\begin{titlepage}% + \let\footnotesize\small + \let\footnoterule\relax + \let\footnote\thanks + \renewcommand\thefootnote{\@fnsymbol\c@footnote}% + \def\@makefnmark% + {\rlap{\@textsuperscript{\normalfont\@thefnmark}}}% + \long\def\@makefntext##1{% + \@setpar{\@@par + \@tempdima = \hsize + \advance\@tempdima -1em + \parshape \@ne 1em \@tempdima}% + \par\parindent 1em \noindent + \hb@xt@\z@{\hss\@textsuperscript{\normalfont\@thefnmark}\,}##1} +% \end{macrocode} +% We center the entire title vertically; the centering is set off a +% little by adding a |\vskip|. In compatibility mode the page number +% is set to 0 to keep the behaviour of \LaTeX\ 2.09 style files +% \begin{macrocode} + \null\vfil + \vskip 60\p@ +% \end{macrocode} +% Then we set the title, in a |\LARGE| font; leave a little space +% and set the author(s) in a |\large| font. We do this inside a +% tabular environment to get them in a single column. +% Before the date we leave a little whitespace again. +% \begin{macrocode} + \begin{center}% + {\LARGE \@title \par}% + \vskip 3em% + {\large + \lineskip .75em% + \begin{tabular}[t]{c}% + \@author + \end{tabular}\par}% + \vskip 1.5em% + {\large \@date \par}% % Set date in \large size. + \end{center}\par +% \end{macrocode} +% Then we call |\@thanks| to print the information that goes into +% the footnote and finish the page. +% \begin{macrocode} + \@thanks + \vfil\null + \end{titlepage}% +% \end{macrocode} +% We reset the \Lcount{footnote} counter, disable |\thanks| and +% |\maketitle| and save some storage space by emptying the internal +% information macros. +% \begin{macrocode} + \setcounter{footnote}{0}% + \global\let\thanks\relax + \global\let\maketitle\relax + \global\let\@thanks\@empty + \global\let\@author\@empty + \global\let\@date\@empty + \global\let\@title\@empty +% \end{macrocode} +% After the title is set the declaration commands |\title|, etc.\ +% can vanish. +% The definition of |\and| makes only sense within the argument of +% |\author| so this can go as well. +% \begin{macrocode} + \global\let\title\relax + \global\let\author\relax + \global\let\date\relax + \global\let\and\relax + } +% \end{macrocode} +% When the title is not on a page of its own, the layout of the +% title is a little different. We use symbols to mark the footnotes +% and we have to deal with two column documents. +% +% Therefore we first start a new group to keep changes local. Then +% we redefine |\thefootnote| to use |\fnsymbol|; and change +% |\@makefnmark| so that footnotemarks have zero width (to make the +% centering of the author names look better). +% \changes{v2.0b}{1998/05/09}{Added some space between the footnote symbol +% and footnote text.} +% \begin{macrocode} +\else + \newcommand\maketitle{\par + \begingroup + \renewcommand\thefootnote{\@fnsymbol\c@footnote}% + \def\@makefnmark% + {\rlap{\@textsuperscript{\normalfont\@thefnmark}}}% + \long\def\@makefntext##1{% + \@setpar{\@@par + \@tempdima = \hsize + \advance\@tempdima -1em + \parshape \@ne 1em \@tempdima}% + \par\parindent 1em \noindent + \hb@xt@\z@{\hss\@textsuperscript{\normalfont\@thefnmark}\,}##1} +% \end{macrocode} +% If this is a twocolumn document we start a new page in two-column +% mode, with the title set to the full width of the text. The +% actual printing of the title information is left to +% |\@maketitle|. +% \begin{macrocode} + \if@twocolumn + \ifnum \col@number=\@ne + \@maketitle + \else + \twocolumn[\@maketitle]% + \fi + \else +% \end{macrocode} +% When this is not a two-column document we just start a new page, +% prevent floating objects from appearing on the top of this page +% and print the title information. +% \begin{macrocode} + \newpage + \global\@topnum\z@ % Prevents figures from going at top of page. + \@maketitle + \fi +% \end{macrocode} +% This page gets a \pstyle{empty} layout. We call |\@thanks| to +% produce the footnotes. +% \begin{macrocode} + \thispagestyle{empty}\@thanks +% \end{macrocode} +% Now we can close the group, reset the \Lcount{footnote} counter, +% disable |\thanks|, |\maketitle| and |\@maketitle| and save some +% storage space by emptying the internal information macros. +% \begin{macrocode} + \endgroup + \setcounter{footnote}{0}% + \global\let\thanks\relax + \global\let\maketitle\relax + \global\let\@maketitle\relax + \global\let\@thanks\@empty + \global\let\@author\@empty + \global\let\@date\@empty + \global\let\@title\@empty + \global\let\title\relax + \global\let\author\relax + \global\let\date\relax + \global\let\and\relax +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@maketitle} +% This macro takes care of formatting the title information when we +% have no separate title page. +% +% We always start a new page and put the title flush left +% using a |\Large| bold font with +% thick rules above and below. Then we put the autor information +% flush right in slanted type. This title will allways show the +% date unless it is set to nothing, using the |\date{}| command. +% \begin{macrocode} + \def\@maketitle{% + \newpage + \null + \longthickrule\vskip1.5em% + \let \footnote \thanks + {\secshape \parskip\z@ \parindent\z@ + \Large\bfseries \@title \par}% + \vskip1.5em\longthickrule\vskip1.5em% + {\normalsize + \lineskip .5em% + \begin{flushright}% + {\slshape\@author\par} + \vskip 1em% + {\@date}% + \end{flushright}\par}% + \vskip 1.5em} +\fi +% \end{macrocode} +% \end{macro} +% +% \subsection{Chapters and Sections} +% +% \subsubsection{Building blocks} +% The definitions in this part of the class file make use of two +% macros, |\@startsection| and |\secdef|, which are defined by +% \file{latex.dtx}. They are not described here, see the +% \file{classes.dtx} for more information. +% +% \subsubsection{Mark commands} +% +% \begin{macro}{\chaptermark} +% \begin{macro}{\sectionmark} +% \begin{macro}{\subsectionmark} +% \begin{macro}{\subsubsectionmark} +% \begin{macro}{\paragraphmark} +% \begin{macro}{\subparagraphmark} +% Default initializations of |\...mark| commands. These commands +% are used in the definition of the page styles (see +% section~\ref{sec:pagestyle}) Most of them are already defined by +% \file{latex.dtx}, so they are only shown here. +% +% \begin{macrocode} +%<+refrep>\newcommand*\chaptermark[1]{} +% \newcommand*\sectionmark[1]{} +% \newcommand*\subsectionmark[1]{} +% \newcommand*\subsubsectionmark[1]{} +% \newcommand*\paragraphmark[1]{} +% \newcommand*\subparagraphmark[1]{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{Define Counters} +% +% \begin{macro}{\c@secnumdepth} +% The value of the counter \Lcount{secnumdepth} gives the depth of +% the highest-level sectioning command that is to produce section +% numbers. +% \begin{macrocode} +%<+refart>\setcounter{secnumdepth}{3} +%<+refrep>\setcounter{secnumdepth}{2} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\c@part} +% \begin{macro}{\c@chapter} +% \begin{macro}{\c@section} +% \begin{macro}{\c@subsection} +% \begin{macro}{\c@subsubsection} +% \begin{macro}{\c@paragraph} +% \begin{macro}{\c@subparagraph} +% These counters are used for the section numbers. The macro +% |\newcounter{|\meta{newctr}|}[|\meta{oldctr}|]| defines +% \meta{newctr} to be a counter, which is reset to zero when +% counter \meta{oldctr} is stepped. Counter \meta{oldctr} must +% already be defined. +% +% \begin{macrocode} +\newcounter {part} +%<+refart>\newcounter {section} +%<*refrep> +\newcounter {chapter} +\newcounter {section}[chapter] +%</refrep> +\newcounter {subsection}[section] +\newcounter {subsubsection}[subsection] +\newcounter {paragraph}[subsubsection] +\newcounter {subparagraph}[paragraph] +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\thepart} +% \begin{macro}{\thechapter} +% \begin{macro}{\thesection} +% \begin{macro}{\thesubsection} +% \begin{macro}{\thesubsubsection} +% \begin{macro}{\theparagraph} +% \begin{macro}{\thesubparagraph} +% For any counter \Lcount{CTR}, |\theCTR| is a macro that defines +% the printed version of counter \Lcount{CTR}. It is defined in +% terms of the following macros: +% +% |\arabic{|\Lcount{COUNTER}|}| prints the value of +% \Lcount{COUNTER} as an arabic numeral. +% +% |\roman{|\Lcount{COUNTER}|}| prints the value of +% \Lcount{COUNTER} as a lowercase roman numberal. +% +% |\Roman{|\Lcount{COUNTER}|}| prints the value of +% \Lcount{COUNTER} as an uppercase roman numberal. +% +% |\alph{|\Lcount{COUNTER}|}| prints the value of \Lcount{COUNTER} +% as a lowercase letter: $1 =$~a, $2 =$~ b, etc. +% +% |\Alph{|\Lcount{COUNTER}|}| prints the value of \Lcount{COUNTER} +% as an uppercase letter: $1 =$~A, $2 =$~B, etc. +% +% \begin{macrocode} +\renewcommand\thepart {\@Roman\c@part} +%<+refart>\renewcommand\thesection {\@arabic\c@section} +%<*refrep> +\renewcommand\thechapter {\@arabic\c@chapter} +\renewcommand\thesection {\thechapter.\@arabic\c@section} +%</refrep> +\renewcommand\thesubsection {\thesection.\@arabic\c@subsection} +\renewcommand\thesubsubsection {\thesubsection .\@arabic\c@subsubsection} +\renewcommand\theparagraph {\thesubsubsection.\@arabic\c@paragraph} +\renewcommand\thesubparagraph {\theparagraph.\@arabic\c@subparagraph} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@chapapp} +% |\@chapapp| is initially defined to be empty. The +% |\appendix| command redefines it to be `|\appendixname|'. +% +% \begin{macrocode} +%<+refrep>\newcommand\@chapapp{} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Parts} +% +% \begin{macro}{\part} +% The command to start a new part of our document. +% +% In the refart class the definition of |\part| is rather simple; +% we start a new paragraph, add a little whitespace, suppress the +% indentation of the first paragraph and make use of |\@secdef|. +% As in other sectioning commands (cf.\ |\@startsection| in the +% {\LaTeXe} kernel), we need to check the |@noskipsec| switch and +% force horizontal mode if it is set. +% \changes{v2.0c}{1999/03/28}{Check \texttt{@noskipsec} switch and +% possibly force horizontal mode; see PR/2889.} +% \begin{macrocode} +%<*refart> +\newcommand\part{% + \if@noskipsec \leavevmode \fi + \par + \addvspace{4ex}% + \@afterindentfalse + \secdef\@part\@spart} +%</refart> +% \end{macrocode} +% +% For the refrep class things are a bit different. +% +% We start a new (righthand) page and use the \pstyle{empty}. +% \changes{v2.0}{1997/02/14}{Make this command react to the option +% \texttt{openany}}% \begin{macrocode} +%<*refrep> +\newcommand\part{% + \if@openright + \cleardoublepage + \else + \clearpage + \fi + \thispagestyle{empty}% +% \end{macrocode} +% When we are making a two column document, this will be a one +% column page. We use |@tempswa| to remember to switch back to two +% columns. +% \begin{macrocode} + \if@twocolumn + \onecolumn + \@tempswatrue + \else + \@tempswafalse + \fi +% \end{macrocode} +% We need an empty box to prevent the fill glue from disappearing. +% \begin{macrocode} + \null\vfil +% \end{macrocode} +% Here we use |\secdef| to indicate which commands to use to make +% the actual heading. +% \begin{macrocode} + \secdef\@part\@spart} +%</refrep> +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@part} +% This macro does the actual formatting of the title of the part. +% Again the macro is differently defined for the refart document +% class than for the document class refrep. + +% When \Lcount{secnumdepth} is larger than $-1$ for the +% document class refart or $-2$ for the document class refrep, +% we have a numbered part, otherwise it is unnumbered. +% \begin{macrocode} +%<*refart|refrep> +\def\@part[#1]#2{% +%<+refart> \ifnum \c@secnumdepth >\m@ne +%<+refrep> \ifnum \c@secnumdepth >-2\relax + \refstepcounter{part}% + \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}% + \else + \addcontentsline{toc}{part}{#1}% + \fi +% \end{macrocode} +% We print the title flush left, we also +% prevent breaking between lines and reset the font. +% \begin{macrocode} + \longrule\medskip + {\parindent \z@ \raggedright + \interlinepenalty \@M + \normalfont +% \end{macrocode} +% When this is a numbered part we have to print the number and the +% title. The |\nobreak| should prevent a page break here. +% \begin{macrocode} + \Large +%<+refart> \ifnum \c@secnumdepth >\m@ne +%<+refrep> \ifnum \c@secnumdepth >-2 \relax + \thepart.\quad + \fi + #2\par \medskip + \longrule\bigskip% +% \end{macrocode} +% Then we empty the mark registers, leave some whitespace and call +% |\@afterheading| to takes care of suppressing the indentation. +% \begin{macrocode} + \markboth{}{}\par}% + \nobreak + \vskip 3ex + \@afterheading} +%</refart|refrep> +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@spart} +% This macro does the actual formatting of the title of the part +% when the star form of the user command was used. In this case we +% {\em never} print a number. Otherwise the formatting is the same. +% \begin{macrocode} +%<*refart|refrep> +\def\@spart#1{% + \longrule\medskip + {\parindent \z@ \raggedright + \interlinepenalty \@M + \normalfont + \Large #1\par}% + \medskip\longrule + \nobreak + \vskip 3ex + \@afterheading} +%</refart|refrep> +% \end{macrocode} +% \end{macro} +% +% +% \subsubsection{Chapters} +% +% \begin{macro}{\chapter} +% A chapter should always start on a new page therefore we start by +% calling |\clearpage| and setting the pagestyle for this page to +% \pstyle{plain}. +% \begin{macrocode} +%<*refrep> +\newcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi + \if@pageperchapter\setcounter{page}{1}\fi + \thispagestyle{empty}% +% \end{macrocode} +% Then we prevent floats from appearing at the top of this page +% because it looks weird to see a floating object above a chapter +% title. +% \begin{macrocode} + \global\@topnum\z@ +% \end{macrocode} +% Then we suppress the indentation of the first paragraph by +% setting the switch |\@afterindent| to |false|. We use |\secdef| +% to specify the macros to use for actually setting the chapter +% title. +% \begin{macrocode} + \@afterindentfalse + \secdef\@chapter\@schapter} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@chapter} +% This macro is called when we have a numbered chapter. When +% \Lcount{secnumdepth} is larger than $-1$ we display the chapter +% number. We also inform the user that a new chapter is about to be +% typeset by writing a message to the terminal. +% \begin{macrocode} +\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne + \refstepcounter{chapter}% + \typeout{\@chapapp\space\thechapter.}% + \addcontentsline{toc}{chapter}% + {\protect\numberline{\thechapter}#1}% + \else + \addcontentsline{toc}{chapter}{#1} + \fi +% \end{macrocode} +% After having written an entry to the table of contents we store +% the (alternative) title of this chapter with |\chaptermark| and +% add some whitespace to the lists of figures and tables. +% \begin{macrocode} + \chaptermark{#1}% + \addtocontents{lof}{\protect\addvspace{10\p@}}% + \addtocontents{lot}{\protect\addvspace{10\p@}}% +% \end{macrocode} +% Then we call upon |\@makechapterhead| to format the actual +% chapter title. We have to do this in a special way when we are in +% two-column mode in order to have the chapter title use the entire +% |\textwidth|. In one column mode we call |\@afterheading| which +% takes care of suppressing the indentation. +% \begin{macrocode} + \if@twocolumn + \@topnewpage[\@makechapterhead{#2}]% + \else + \@makechapterhead{#2}% + \@afterheading + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@makechapterhead} +% The macro above uses |\@makechapterhead|\meta{text} to format the +% heading of the chapter. +% +% We begin by leaving some whitespace. The we open a group in +% which we have a paragraph indent of 0pt, and in which we have the +% text set ragged right. We also reset the font. +% \begin{macrocode} +\def\@makechapterhead#1{% + \longthickrule\bigskip% + {\parindent \z@ \secshape \normalfont \Large\bfseries +% \end{macrocode} +% Then we check whether the number of the chapter has to be printed. +% If so we leave some whitespace between the chapternumber and its +% title. +% \begin{macrocode} + \@hangfrom{\ifnum \c@secnumdepth >\m@ne + \@chapapp\space \thechapter\quad + \fi}% +% \end{macrocode} +% Now we set the title in a large bold font. We prevent a page break +% at this point and leave some whitespace before the text begins. +% \begin{macrocode} + #1\par} + \bigskip\longthickrule\bigskip + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@schapter} +% This macro is called when we have an unnumbered chapter. It is +% much simpler than |\@chapter| because it only needs to typeset +% the chapter title. +% \begin{macrocode} +\def\@schapter#1{\if@twocolumn + \@topnewpage[\@makeschapterhead{#1}]% + \else + \@makeschapterhead{#1}% + \@afterheading + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@makeschapterhead} +% The macro above uses |\@makeschapterhead|\meta{text}to format +% the heading of the chapter. It is similar to |\@makechapterhead| +% except that it never has to print a chapter number. +% +% \begin{macrocode} +\def\@makeschapterhead#1{% + \longthickrule\bigskip% + {\parindent \z@ \secshape \normalfont + \Large \bfseries #1\par} + \bigskip\longthickrule\bigskip + } +%</refrep> +% \end{macrocode} +% \end{macro} +% +% +% \subsubsection{Lower level headings} +% \begin{macro}{\secshape} +% \begin{macrocode} +\newcommand\secshape{\leftskip=-\leftmarginwidth% + \rightskip=\@flushglue% + \hyphenpenalty=2000} +% \end{macrocode} +% \end{macro} +% +% These commands all make use of |\@startsection|. +% \begin{macro}{\section} +% This gives a normal heading with whitespace above and below the +% heading, the title set in |\large\bfseries|, and no indentation +% on the first paragraph. +% \begin{macrocode} +\newcommand\section{\@startsection {section}{1}{\z@}% + {-2ex \@plus -1ex \@minus -.2ex}% + {0.5ex \@plus .2ex}% + {\secshape\normalfont\large\bfseries}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\subsection} +% This gives a normal heading with whitespace above and below the +% heading, the title set in |\large\bfseries|, and no indentation +% on the first paragraph. +% \begin{macrocode} +\newcommand\subsection{\@startsection{subsection}{2}{\z@}% + {-1.5ex\@plus -.5ex \@minus -.2ex}% + {0.5ex \@plus .2ex}% + {\secshape\normalfont\normalsize\bfseries}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\subsubsection} +% This gives a normal heading with whitespace above and below the +% heading, the title set in |\normalsize\bfseries|, and no +% indentation on the first paragraph. +% \begin{macrocode} +\newcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% + {-1.5ex\@plus -.5ex \@minus -.2ex}% + {0.5ex \@plus .2ex}% + {\secshape\normalfont\normalsize\mdseries}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\paragraph} +% This gives a run-in heading with whitespace above and to the +% right of the heading, the title set in |\normalsize\bfseries|. +% \begin{macrocode} +\newcommand\paragraph{\@startsection{paragraph}{4}{\z@}% + {2ex\@plus 1ex \@minus .2ex}% + {-1em}% + {\normalfont\normalsize\bfseries}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\subparagraph} +% This gives an indented run-in heading with whitespace above and +% to the right of the heading, the title set in +% |\normalsize\bfseries|. +% \begin{macrocode} +\newcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}% + {2ex \@plus 1ex \@minus .2ex}% + {-1em}% + {\normalfont\normalsize\bfseries}} +% \end{macrocode} +% \end{macro} +% +% \subsection{Lists} +% +% \subsubsection{General List Parameters} +% +% The following commands are used to set the default values for the list +% environment's parameters. See the \LaTeX{} manual for an explanation +% of the meanings of the parameters. Defaults for the list +% environment are set as follows. First, |\rightmargin|, +% |\listparindent| and |\itemindent| are set to 0pt. Then, for a Kth +% level list, the command |\@listK| is called, where `K' denotes `i', +% '`i', ... , `vi'. (I.e., |\@listiii| is called for a third-level +% list.) By convention, |\@listK| should set |\leftmargin| to +% |\leftmarginK|. +% +% \begin{macro}{\leftmargin} +% \begin{macro}{\leftmargini} +% \begin{macro}{\leftmarginii} +% \begin{macro}{\leftmarginiii} +% \begin{macro}{\leftmarginiv} +% \begin{macro}{\leftmarginv} +% \begin{macro}{\leftmarginvi} +% For efficiency, level-one list's values are defined at top level, and +% |\@listi| is defined to set only |\leftmargin|. +% +% When we are in two column mode some of the margins are set somewhat +% smaller. +% \begin{macrocode} +\if@twocolumn + \setlength\leftmargini {2em} +\else + \setlength\leftmargini {2.5em} +\fi +% \end{macrocode} +% The following three are calculated so that they are larger than +% the sum of |\labelsep| and the width of the default labels (which +% are `(m)', `vii.' and `M.'). +% \begin{macrocode} +\setlength\leftmarginii {2.2em} +\setlength\leftmarginiii {1.87em} +\setlength\leftmarginiv {1.7em} +\if@twocolumn + \setlength\leftmarginv {.5em} + \setlength\leftmarginvi {.5em} +\else + \setlength\leftmarginv {1em} + \setlength\leftmarginvi {1em} +\fi +% \end{macrocode} +% Here we set the top level leftmargin. +% \begin{macrocode} +\setlength\leftmargin {\leftmargini} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\labelsep} +% \begin{macro}{\labelwidth} +% |\labelsep| is the distance between the label and the text of an +% item; |\labelwidth| is the width of the label. +% \begin{macrocode} +\setlength \labelsep {.5em} +\setlength \labelwidth{\leftmargini} +\addtolength\labelwidth{-\labelsep} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\@beginparpenalty} +% \begin{macro}{\@endparpenalty} +% These penalties are inserted before and after a list or paragraph +% environment. They are set to a bonus value to encourage page +% breaking at these points. +% \begin{macro}{\@itempenalty} +% This penalty is inserted between list items. +% \begin{macrocode} +%<*refart|refrep> +\@beginparpenalty -\@lowpenalty +\@endparpenalty -\@lowpenalty +\@itempenalty -\@lowpenalty +%</refart|refrep> +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@listI} +% \begin{macro}{\@listi} +% |\@listI| defines top level and |\@listi| values of +% |\leftmargin|, |\parsep|, |\topsep|, and |\itemsep| +% +% \begin{macrocode} +%<*refart|refrep> +\def\@listI{\leftmargin\leftmargini + \parsep \parskip + \topsep \z@ + \itemsep\z@} +\let\@listi\@listI +% \end{macrocode} +% We have to initialise these parameters. +% \begin{macrocode} +\@listi +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@listii} +% \begin{macro}{\@listiii} +% \begin{macro}{\@listiv} +% \begin{macro}{\@listv} +% \begin{macro}{\@listvi} +% Here are the same macros for the higher level lists. +% \begin{macrocode} +\def\@listii {\leftmargin\leftmarginii + \labelwidth\leftmarginii + \advance\labelwidth-\labelsep + \topsep \z@ + \parsep \parskip + \itemsep \z@} +\def\@listiii{\leftmargin\leftmarginiii + \labelwidth\leftmarginiii + \advance\labelwidth-\labelsep + \topsep \z@ + \parsep \parskip + \partopsep \z@ + \itemsep \topsep} +\def\@listiv {\leftmargin\leftmarginiv + \labelwidth\leftmarginiv + \advance\labelwidth-\labelsep} +\def\@listv {\leftmargin\leftmarginv + \labelwidth\leftmarginv + \advance\labelwidth-\labelsep} +\def\@listvi {\leftmargin\leftmarginvi + \labelwidth\leftmarginvi + \advance\labelwidth-\labelsep} +%<*refart|refrep> +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{Enumerate} +% +% The enumerate environment uses four counters: \Lcount{enumi}, +% \Lcount{enumii}, \Lcount{enumiii} and \Lcount{enumiv}, where +% \Lcount{enumN} controls the numbering of the Nth level +% enumeration. +% +% \begin{macro}{\theenumi} +% \begin{macro}{\theenumii} +% \begin{macro}{\theenumiii} +% \begin{macro}{\theenumiv} +% The counters are already defined in \file{latex.dtx}, but their +% representation is changed here. +% +% \begin{macrocode} +%<*refart|refrep> +\renewcommand\theenumi {\@arabic\c@enumi} +\renewcommand\theenumii {\@alph\c@enumii} +\renewcommand\theenumiii{\@roman\c@enumiii} +\renewcommand\theenumiv {\@Alph\c@enumiv} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\labelenumi} +% \begin{macro}{\labelenumii} +% \begin{macro}{\labelenumiii} +% \begin{macro}{\labelenumiv} +% The label for each item is generated by the commands +% |\labelenumi| ... |\labelenumiv|. +% \begin{macrocode} +\newcommand\labelenumi {\theenumi.} +\newcommand\labelenumii {(\theenumii)} +\newcommand\labelenumiii{\theenumiii.} +\newcommand\labelenumiv {\theenumiv.} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\p@enumii} +% \begin{macro}{\p@enumiii} +% \begin{macro}{\p@enumiv} +% The expansion of |\p@enumN||\theenumN| defines the output of a +% |\ref| command when referencing an item of the Nth level of an +% enumerated list. +% \begin{macrocode} +\renewcommand\p@enumii {\theenumi} +\renewcommand\p@enumiii {\theenumi(\theenumii)} +\renewcommand\p@enumiv {\p@enumiii\theenumiii} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{Itemize} +% +% \begin{macro}{\labelitemi} +% \begin{macro}{\labelitemii} +% \begin{macro}{\labelitemiii} +% \begin{macro}{\labelitemiv} +% \changes{v2.0}{1997/02/14}{Replaced -{}- with \cs{textendash} +% Changed to \cs{textbullet}, +% \cs{textasteriskcentered} and \cs{textperiodcentered}} +% Itemization is controlled by four commands: |\labelitemi|, +% |\labelitemii|, |\labelitemiii|, and |\labelitemiv|, which define +% the labels of the various itemization levels: the symbols used are +% bullet, bold en-dash, asterisk and centred dot. +% +% \begin{macrocode} +\newcommand\labelitemi {\textbullet} +\newcommand\labelitemii {\normalfont\bfseries \textendash} +\newcommand\labelitemiii{\textasteriskcentered} +\newcommand\labelitemiv {\textperiodcentered} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{Description} +% +% \begin{environment}{description} +% The description environment is defined here -- while the itemize +% and enumerate environments are defined in \file{latex.dtx}. +% +% \begin{macrocode} +\newenvironment{description} + {\list{}{% + \labelsep\marginparsep + \labelwidth\leftmarginwidth + \advance\labelwidth by \leftmargin + \advance\labelwidth by -\labelsep + \let\makelabel\descriptionlabel}} + {\endlist} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\descriptionlabel} +% To change the formatting of the label, you must redefine +% |\descriptionlabel|. +% +% \begin{macrocode} +\newcommand*\descriptionlabel[1]{% + \ifdescriptionleft\else \hfil\fi + \normalfont #1 \ifdescriptioncolon :\fi + \ifdescriptionleft \hfil \fi} +% \end{macrocode} +% \end{macro} +% +% \subsection{Defining new environments} +% +% \subsubsection{Abstract} +% +% \begin{environment}{abstract} +% When we are producing a separate titlepage we also put the +% abstract on a page of its own. It will be centred vertically on +% the page. +% +% \begin{macrocode} +\if@titlepage + \newenvironment{abstract}{% + \titlepage + \null\vfil + \@beginparpenalty\@lowpenalty + \begin{center} + \bfseries \abstractname + \@endparpenalty\@M + \end{center}} + {\par\vfil\null\endtitlepage} +% \end{macrocode} +% When we are not making a separate titlepage --the default for the +% refart document class-- we have to check if we are in twocolumn +% mode. In that case the abstract is as a |\section*|, otherwise +% the quote environment is used to typeset the abstract. +% \begin{macrocode} +\else + \newenvironment{abstract}{% + \if@twocolumn + \section*{\abstractname}% + \else + \small + \begin{center}% + {\bfseries \abstractname\vspace{-.5em}\vspace{\z@}}% + \end{center}% + \quote + \fi} + {\if@twocolumn\else\endquote\fi} +\fi +% \end{macrocode} +% \end{environment} +% +% \subsubsection{Verse} +% +% \begin{environment}{verse} +% The verse environment is defined by making clever use of the +% list environment's parameters. The user types |\\| to end a line. +% This is implemented by |\let|'ing |\\| equal |\@centercr|. +% +% \begin{macrocode} +\newenvironment{verse} + {\let\\=\@centercr + \list{}{\itemsep \z@ + \itemindent -1.5em% + \listparindent\itemindent + \rightmargin \leftmargin + \advance\leftmargin 1.5em}% + \item\relax} + {\endlist} +% \end{macrocode} +% \end{environment} +% +% \subsubsection{Quotation} +% +% \begin{environment}{quotation} +% The quotation environment is also defined by making clever use of +% the list environment's parameters. The lines in the environment +% are set smaller than |\textwidth|. The first line of a paragraph +% inside this environment is indented. +% +% \begin{macrocode} +\newenvironment{quotation} + {\list{}{\listparindent 1.5em% + \itemindent \listparindent + \rightmargin \leftmargin + \parsep \z@ \@plus\p@}% + \item\relax} + {\endlist} +% \end{macrocode} +% \end{environment} +% +% \subsubsection{Quote} +% +% \begin{environment}{quote} +% The quote environment is like the quotation environment except +% that paragraphs are not indented. +% +% \begin{macrocode} +\newenvironment{quote} + {\list{}{\rightmargin\leftmargin}% + \item\relax} + {\endlist} +% \end{macrocode} +% \end{environment} +% +% \subsubsection{Example} +% +% \begin{macro}{\example} +% The example environment is a verse environment with tt font +% which tries to avoid page brakes at the |\begin{example}|. +% +% \begin{macrocode} +\newenvironment{example} + {\@beginparpenalty=\@highpenalty + \let\\=\@centercr + \list{}{\itemsep \z@ + \itemindent -1.5em% + \listparindent\itemindent + \rightmargin \leftmargin + \advance\leftmargin 1.5em}% + \ttfamily + \item\relax} + {\endlist} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Theorem} +% +% This document class does not define its own theorem environments, +% the defaults supplied by \file{latex.dtx} are available. +% +% \subsubsection{Titlepage} +% +% \begin{environment}{titlepage} +% In the normal environments, the titlepage environment does nothing +% but start and end a page, and inhibit page numbers. It also resets +% the page number to zero. In two-column style, it still makes a +% one-column page. +% +% \begin{macrocode} +\newenvironment{titlepage} + {\if@twocolumn + \@restonecoltrue\onecolumn + \else + \@restonecolfalse\newpage + \fi + \thispagestyle{empty}% + \setcounter{page}\@ne + } + {\if@restonecol\twocolumn \else \newpage \fi + \if@twoside\else + \setcounter{page}\@ne + \fi + } +% \end{macrocode} +% \end{environment} +% +% \subsubsection{Appendix} +% +% \begin{macro}{\appendix} +% +% The |\appendix| command is not really an environment, it is a +% macro that makes some changes in the way things are done. +% +% In the article document class the |\appendix| command must do the +% following: +% \begin{itemize} +% \item reset the section and subsection counters to zero, +% \item redefine |\thesection| to produce alphabetic appendix +% numbers. +% \end{itemize} +% +% \changes{2.0c}{1999/03/28}{Redefine \cs{thesection} globally (pr/2862)} +% \begin{macrocode} +%<*refart> +\newcommand\appendix{\par + \setcounter{section}{0}% + \setcounter{subsection}{0}% + \gdef\thesection{\@Alph\c@section}} +%</refart> +% \end{macrocode} +% +% In the report and book document classes the |\appendix| command +% must do the following: +% \begin{itemize} +% \item issue a |\newpage| if pageperchapter is defined, +% otherwise the page number would come out wrong. +% \item reset the chapter and section counters to zero, +% \item set |\@chapapp| to |\appendixname| (for messages), +% \item redefine the chapter counter to produce appendix numbers, +% \item possibly redefine the |\chapter| command if appendix titles +% and headings are to look different from chapter titles and +% headings. +% \end{itemize} +% +% \changes{2.0c}{1999/03/28}{Redefine \cs{thechapter} and +% \cs{@chapapp} globally (pr/2862)} +% \begin{macrocode} +%<*refrep> +\newcommand\appendix{\par + \if@pageperchapter\newpage\fi + \setcounter{chapter}{0}% + \setcounter{section}{0}% + \gdef\@chapapp{\appendixname}% + \gdef\thechapter{\@Alph\c@chapter}} +%</refrep> +% \end{macrocode} +% \end{macro} +% +% \subsection{Setting parameters for existing environments} +% +% \subsubsection{Array and tabular} +% +% \begin{macro}{\arraycolsep} +% The columns in an array environment are separated by +% 2|\arraycolsep|. +% \begin{macrocode} +\setlength\arraycolsep {5\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\tabcolsep} +% The columns in an tabular environment are separated by +% 2|\tabcolsep|. +% \begin{macrocode} +\setlength\tabcolsep {6\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\arrayrulewidth} +% The width of rules in the array and tabular environments is given +% by |\arrayrulewidth|. +% \begin{macrocode} +\setlength\arrayrulewidth{.4\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\doublerulesep} +% The space between adjacent rules in the array and tabular +% environments is given by |\doublerulesep|. +% \begin{macrocode} +\setlength\doublerulesep {2\p@} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Tabbing} +% +% \begin{macro}{\tabbingsep} +% This controls the space that the |\'| command puts in. (See +% \LaTeX{} manual for an explanation.) +% \begin{macrocode} +\setlength\tabbingsep {\labelsep} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Minipage} +% +% \begin{macro}{\@minipagerestore} +% The macro |\@minipagerestore| is called upon entry to a minipage +% environment to set up things that are to be handled differently +% inside a minipage environment. In the current styles, it does +% nothing. +% \end{macro} +% +% \begin{macro}{\@mpfootins} +% Minipages have their own footnotes; |\skip||\@mpfootins| plays +% same r\^ole for footnotes in a minipage as |\skip||\footins| does +% for ordinary footnotes. +% +% \begin{macrocode} +\skip\@mpfootins = \skip\footins +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Framed boxes} +% +% \begin{macro}{\fboxsep} +% The space left by |\fbox| and |\framebox| between the box and the +% text in it. +% \begin{macro}{\fboxrule} +% The width of the rules in the box made by |\fbox| and |\framebox|. +% \begin{macrocode} +\setlength\fboxsep {3\p@} +\setlength\fboxrule{.4\p@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsubsection{Equation and eqnarray} +% +% \begin{macro}{\theequation} +% The equation counter will be reset at beginning of a new chapter +% and the equation number will be prefixed by the chapter number. +% \changes{v2.0}{1997/02/14}{Added test for non-zero chapter number} +% +% This code must follow the |\chapter| definition, or more exactly +% the definition of the chapter counter. +% \begin{macrocode} +%<+refart>\renewcommand\theequation{\@arabic\c@equation} +%<*refrep> +\@addtoreset{equation}{chapter} +\renewcommand\theequation +{\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@equation} +%</refrep> +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\jot} +% |\jot| is the extra space added between lines of an eqnarray +% environment. The default value is used. +% \begin{macrocode} +% \setlength\jot{3pt} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@eqnnum} +% The macro |\@eqnnum| defines how equation numbers are to appear in +% equations. Again the default is used. +% +% \begin{macrocode} +% \def\@eqnnum{(\theequation)} +% \end{macrocode} +% \end{macro} +% +% \subsection{Floating objects} +% +% The file \file{latex.dtx} only defines a number of tools with +% which floating objects can be defined. This is done in the +% document class. It needs to define the following macros for each +% floating object of type \texttt{TYPE} (e.g., \texttt{TYPE} = +% figure). +% +% \begin{description} +% \item[\texttt{\bslash fps@TYPE}] +% The default placement specifier for floats of type +% \texttt{TYPE}. +% +% \item[\texttt{\bslash ftype@TYPE}] +% The type number for floats of type \texttt{TYPE}. Each +% \texttt{TYPE} has associated a unique positive {\texttt +% TYPE} number, which is a power of two. E.g., figures might +% have type number 1, tables type number 2, programs type +% number 4, etc. +% +% \item[\texttt{\bslash ext@TYPE}] +% The file extension indicating the file on which the contents +% list for float type \texttt{TYPE} is stored. For example, +% |\ext@figure| = `lof'. +% +% \item[\texttt{\bslash fnum@TYPE}] +% A macro to generate the figure number for a caption. For +% example, |\fnum@TYPE| == `Figure |\thefigure|'. +% +% \item[\texttt{\bslash @makecaption{\meta{num}}{\meta{text}}}] +% A macro to make a caption, with \meta{num} the value produced +% by |\fnum@...| and \meta{text} the text of the caption. It +% can assume it's in a |\parbox| of the appropriate width. +% This will be used for {\em all} floating objects. +% +% \end{description} +% +% The actual environment that implements a floating object such as +% a figure is defined using the macros |\@float| and |\end@float|, +% which are defined in \file{latex.dtx}. +% +% An environment that implements a single column floating object is +% started with |\@float{|\texttt{TYPE}|}[|\meta{placement}|]| of type +% \texttt{TYPE} with \meta{placement} as the placement specifier. +% The default value of \meta{PLACEMENT} is defined by |\fps@TYPE|. +% +% The environment is ended by |\end@float|. E.g., |\figure| == +% |\@float|{figure}, |\endfigure| == |\end@float|. +% +% \subsubsection{Figure} +% +% Here is the implementation of the figure environment. +% +% \begin{macro}{\c@figure} +% First we have to allocate a counter to number the figures. In the +% report and book document classes the figures are numbered per +% chapter. +% \changes{v2.0}{1997/02/14}{Added test for non-zero chapter number} +% \begin{macrocode} +%<*refart> +\newcounter{figure} +\renewcommand \thefigure {\@arabic\c@figure} +%</refart> +%<*refrep> +\newcounter{figure}[chapter] +\renewcommand\thefigure + {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@figure} +%</refrep> +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\fps@figure} +% \begin{macro}{\ftype@figure} +% \begin{macro}{\ext@figure} +% \begin{macro}{\num@figure} +% Here are the parameters for the floating objects of type `figure'. +% \begin{macrocode} +\def\fps@figure{tbp} +\def\ftype@figure{1} +\def\ext@figure{lof} +\def\fnum@figure{\figurename~\thefigure} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{environment}{figure} +% \begin{environment}{figure*} +% Here is the definition of the actual environment. The form with the +% |*| is used for double column figures. +% \begin{macrocode} +\newenvironment{figure} + {\@float{figure}} + {\end@float} +\newenvironment{figure*} + {\@dblfloat{figure}} + {\end@dblfloat} +% \end{macrocode} +% \end{environment} +% \end{environment} +% +% \subsubsection{Table} +% +% Here is the implementation of the table environment. It is very +% much the same as the figure environment. +% +% \begin{macro}{\c@table} +% First we have to allocate a counter to number the tables. In the +% report and book document classes the tables are numbered per +% chapter. +% \changes{v2.0}{1997/02/14}{Added test for non-zero chapter number} +% \changes{v2.0a}{1997/04/01}{Corrected definition of \cs{\thetable}} +% \begin{macrocode} +%<*refart> +\newcounter{table} +\renewcommand\thetable{\@arabic\c@table} +%</refart> +%<*refrep> +\newcounter{table}[chapter] +\renewcommand\thetable% + {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@table} +%</refrep> +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\fps@table} +% \begin{macro}{\ftype@table} +% \begin{macro}{\ext@table} +% \begin{macro}{\num@table} +% Here are the parameters for the floating objects of type `table'. +% \begin{macrocode} +\def\fps@table{tbp} +\def\ftype@table{2} +\def\ext@table{lot} +\def\fnum@table{\tablename~\thetable} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{environment}{table} +% \begin{environment}{table*} +% Here is the definition of the actual environment. The form with the +% |*| is used for double column tables. +% \begin{macrocode} +\newenvironment{table} + {\@float{table}} + {\end@float} +\newenvironment{table*} + {\@dblfloat{table}} + {\end@dblfloat} +% \end{macrocode} +% \end{environment} +% \end{environment} +% +% \subsubsection{Captions} +% +% \begin{macro}{\@makecaption} +% The |\caption| command calls |\@makecaption| to format the +% caption of floating objects. It gets two arguments, +% \meta{number}, the number of the floating object and \meta{text}, +% the text of the caption. Usually \meta{number} contains a string +% such as `Figure 3.2'. The macro can assume it is called inside a +% |\parbox| of right width, with |\normalsize|. +% +% \begin{macro}{\abovecaptionskip} +% \begin{macro}{\belowcaptionskip} +% These lengths contain the amount of whitespace to leave above +% and below the caption. +% \begin{macrocode} +\newlength\abovecaptionskip +\newlength\belowcaptionskip +\setlength\abovecaptionskip{10\p@} +\setlength\belowcaptionskip{0\p@} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% The definition of this macro is |\long| in order to allow more +% then one paragraph in a caption. +% \begin{macrocode} +\long\def\@makecaption#1#2{% + \vskip\abovecaptionskip +% \end{macrocode} +% We want to see if the caption fits on one line on the page, +% therefore we first typeset it in a temporary box. +% \begin{macrocode} + \sbox\@tempboxa{#1: #2}% +% \end{macrocode} +% We can the measure its width. If that is larger than the current +% |\hsize| we typeset the caption as an ordinary paragraph. +% \begin{macrocode} + \ifdim \wd\@tempboxa >\hsize + #1: #2\par +% \end{macrocode} +% If the caption fits, we center it. +% \begin{macrocode} + \else + \global \@minipagefalse + \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% + \fi + \vskip\belowcaptionskip} +% \end{macrocode} +% \end{macro} +% +% \subsection{Font changing} +% +% Here we supply the declarative font changing commands that were +% common in \LaTeX\ version 2.09 and earlier. These commands work +% in text mode \emph{and} in math mode. They are provided for +% compatibility, but one should start using the |\text...| and +% |\math...| commands instead. These commands are defined using +% |\@newfontswitch|, a command with three arguments: the user +% command to be defined; \LaTeX\ commands to execute in text mode +% and \LaTeX\ commands to execute in math mode. +% +% \begin{macro}{\rm} +% \begin{macro}{\tt} +% \begin{macro}{\sf} +% +% The commands to change the family. When in compatibility mode we +% select the `default' font first, to get \LaTeX2.09 behviour. +% \begin{macrocode} +\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm} +\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf} +\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\bf} +% The command to change to the bold series. One should use +% |\mdseries| to explicitly switch back to medium series. +% \begin{macrocode} +\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\sl} +% \begin{macro}{\it} +% \begin{macro}{\sc} +% +% Here are the commands to change the shape of the font. The slanted and +% small caps shapes are not available by default as math alphabets, +% so those changes do nothing in math mode. One should use +% |\upshape| to explicitly change back to the upright shape. +% \begin{macrocode} +\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit} +\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl} +\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\cal} +% \begin{macro}{\mit} +% +% The commands |\cal| and |\mit| should only be used in math mode, +% outside math mode they have no effect. Currently the New Font +% Selection Scheme defines these commands to generate warning +% messages. Therefore we have to define them `by hand'. +% \begin{macrocode} +\DeclareRobustCommand*{\cal}{\@fontswitch\relax\mathcal} +\DeclareRobustCommand*{\mit}{\@fontswitch\relax\mathnormal} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \section{Cross Referencing} +% \subsection{Table of Contents, etc.} +% +% A |\section| command writes a +% |\contentsline{section}{|\meta{title}|}{|\meta{page}|}| command +% on the \file{.toc} file, where \meta{title} contains the +% contents of the entry and \meta{page} is the page number. If +% sections are being numbered, then \meta{title} will be of the +% form |\numberline{|\meta{num}|}{|\meta{heading}|}| where +% \meta{num} is the number produced by |\thesection|. Other +% sectioning commands work similarly. +% +% A |\caption| command in a `figure' environment writes +% +% |\contentsline{figure}{\numberline{|\meta{num}|}{|% +% \meta{caption}|}}{|\meta{page}|}| +% +% on the .\file{lof} file, where \meta{num} is the number produced +% by |\thefigure| and \meta{caption} is the figure caption. It +% works similarly for a `table' environment. +% +% The command |\contentsline{|\meta{name}|}| expands to +% |\l@|\meta{name}. So, to specify the table of contents, we must +% define |\l@chapter|, |\l@section|, |\l@subsection|, ... ; to +% specify the list of figures, we must define |\l@figure|; and so +% on. Most of these can be defined with the |\@dottedtocline| +% command, which works as follows. +% +% |\@dottedtocline{|\meta{level}|}{|\meta{indent}|}{|^^A +% \meta{numwidth}|}{|^^A +% \meta{title}|}{|\meta{page}|}| +% +% \begin{description} +% \item[\meta{level}] An entry is produced only if\meta{ level} +% $<=$ value of the \Lcount{tocdepth} counter. Note, +% |\chapter| is level 0, |\section| is level 1, etc. +% \item[\meta{indent}] The indentation from the outer left margin +% of the start of the contents line. +% \item[\meta{numwidth}] The width of a box in which the section +% number is to go, if \meta{title} includes a |\numberline| +% command. +% \end{description} +% +% \begin{macro}{\@pnumwidth} +% \begin{macro}{\@tocrmarg} +% \begin{macro}{\@dotsep} +% This command uses the following three parameters, which are set +% with a |\newcommand| (so em's can be used to make them depend upon +% the font). +% \begin{description} +% \item[\texttt{\bslash @pnumwidth}] The width of a box in which the +% page number is put. +% \item[\texttt{\bslash @tocrmarg}] The right margin for multiple +% line entries. One wants |\@tocrmarg| $\ge$ |\@pnumwidth| +% \item[\texttt{\bslash @dotsep}] Separation between dots, in mu +% units. Should be defined as a number like 2 or 1.7 +% \end{description} +% +% \begin{macrocode} +\newcommand\@pnumwidth{1.55em} +\newcommand\@tocrmarg {2.55em} +\newcommand\@dotsep {4.5} +%<+refart>\setcounter{tocdepth}{3} +%<+refrep>\setcounter{tocdepth}{2} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{Table of Contents} +% +% \begin{macro}{\tableofcontents} +% This macro is used to request that \LaTeX{} produces a table of +% contents. In the report and book document classes the tables of +% contents, figures, etc. are always set in single-column style. +% +% \begin{macrocode} +\newcommand\tableofcontents{% +%<*refrep> + \if@twocolumn + \@restonecoltrue\onecolumn + \else + \@restonecolfalse + \fi +% \end{macrocode} +% The title is set using the |\chapter*| command, making sure that +% the running head --if one is required-- contains the right +% information. +% \begin{macrocode} + \chapter*{\contentsname +%</refrep> +%<+refart> \section*{\contentsname + \@mkboth{\contentsname}{\contentsname}}% +% \end{macrocode} +% The the actual table of contents is made by calling +% |\@starttoc{toc}|. After that, we restore twocolumn mode if +% necessary. +% \begin{macrocode} + \@starttoc{toc}% + \if@restonecol\twocolumn\fi + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@part} +% Each sectioning command needs an additional macro to format its +% entry in the table of contents, as described above. The macro for +% the entry for parts is defined in a special way. +% +% First we make sure that if a page break should occur, it occurs +% {\em before} this entry. Also a little whitespace is added and a +% group begun to keep changes local. +% \changes{v2.0c}{1999/03/28}{Removed setting of \cs{@tempdima} as +% this macro does not use \cs{numberline} to set the toc line.} +% \begin{macrocode} +\newcommand*\l@part[2]{% + \ifnum \c@tocdepth >-2\relax +%<+refart> \addpenalty\@secpenalty +%<+refrep> \addpenalty{-\@highpenalty}% + \addvspace{2.25em \@plus\p@}% + \begingroup +% \end{macrocode} +% The we set |\parindent| to 0pt and use |\rightskip| to leave +% enough room for the page numbers. To prevent overfull box messages +% the |\parfillskip| is set to a negative value. +% \begin{macrocode} + \parindent \z@ \rightskip \@pnumwidth + \parfillskip -\@pnumwidth +% \end{macrocode} +% Now we can set the entry, in a large bold font. We make sure to +% leave vertical mode, set the part title and add the page number, +% set flush right. +% \begin{macrocode} + {\leavevmode + \large \bfseries #1\hfil \hbox to\@pnumwidth{\hss #2}}\par +% \end{macrocode} +% Prevent a page break immediately after this entry, but use +% |\everypar| to reset the |\if@nobreak| switch. Finally we close +% the group. +% \begin{macrocode} + \nobreak + \global\@nobreaktrue + \everypar{\global\@nobreakfalse\everypar{}}% + \endgroup + \fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@chapter} +% This macro formats the entries in the table of contents for +% chapters. It is very similar to |\l@part| +% +% First we make sure that if a page break should occur, it occurs +% {\em before} this entry. Also a little whitespace is added and a +% group begun to keep changes local. +% \begin{macrocode} +%<*refrep> +\newcommand*\l@chapter[2]{% + \ifnum \c@tocdepth >\m@ne + \addpenalty{-\@highpenalty}% + \vskip 1.0em \@plus\p@ +% \end{macrocode} +% +% The macro |\numberline| requires that the width of the box that +% holds the part number is stored in \LaTeX's scratch register +% |\@tempdima|. Therefore we put it there. We begin a group, and +% change some of the paragraph parameters. +% \begin{macrocode} + \setlength\@tempdima{1.5em}% + \begingroup + \parindent \z@ \rightskip \@pnumwidth + \parfillskip -\@pnumwidth +% \end{macrocode} +% Then we leave vertical mode and switch to a bold font. +% \begin{macrocode} + \leavevmode \bfseries +% \end{macrocode} +% Because we do not use |\numberline| here, we have do some fine +% tuning `by hand', before we can set the entry. We discourage but +% not disallow a page break immediately after a chapter entry. +% \begin{macrocode} + \advance\leftskip\@tempdima + \hskip -\leftskip + #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par + \penalty\@highpenalty + \endgroup + \fi} +%</refrep> +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@section} +% In the article document class the entry in the table of contents +% for sections looks much like the chapter entries for the report +% and book document classes. +% +% First we make sure that if a page break should occur, it occurs +% {\em before} this entry. Also a little whitespace is added and a +% group begun to keep changes local. +% \begin{macrocode} +%<*refart> +\newcommand*\l@section[2]{% + \ifnum \c@tocdepth >\z@ + \addpenalty\@secpenalty + \addvspace{1.0em \@plus\p@}% +% \end{macrocode} +% +% The macro |\numberline| requires that the width of the box that +% holds the part number is stored in \LaTeX's scratch register +% |\@tempdima|. Therefore we put it there. We begin a group, and +% change some of the paragraph parameters. +% \begin{macrocode} + \setlength\@tempdima{1.5em}% + \begingroup + \parindent \z@ \rightskip \@pnumwidth + \parfillskip -\@pnumwidth +% \end{macrocode} +% Then we leave vertical mode and switch to a bold font. +% \begin{macrocode} + \leavevmode \bfseries +% \end{macrocode} +% Because we do not use |\numberline| here, we have do some fine +% tuning `by hand', before we can set the entry. We discourage but +% not disallow a page break immediately after a chapter entry. +% \begin{macrocode} + \advance\leftskip\@tempdima + \hskip -\leftskip + #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par + \endgroup + \fi} +%</refart> +% \end{macrocode} +% In the report and book document classes the definition for +% |\l@section| is much simpler. +% \begin{macrocode} +%<*refrep> +\newcommand*\l@section {\@dottedtocline{1}{1.5em}{2.3em}} +%</refrep> +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@subsection} +% \begin{macro}{\l@subsubsection} +% \begin{macro}{\l@paragraph} +% \begin{macro}{\l@subparagraph} +% All lower level entries are defined using the macro +% |\@dottedtocline| (see above). +% \begin{macrocode} +%<*refart> +\newcommand*\l@subsection {\@dottedtocline{2}{1.5em}{2.3em}} +\newcommand*\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}} +\newcommand*\l@paragraph {\@dottedtocline{4}{7.0em}{4.1em}} +\newcommand*\l@subparagraph {\@dottedtocline{5}{10em}{5em}} +%</refart> +%<*refrep> +\newcommand*\l@subsection {\@dottedtocline{2}{3.8em}{3.2em}} +\newcommand*\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}} +\newcommand*\l@paragraph {\@dottedtocline{4}{10em}{5em}} +\newcommand*\l@subparagraph {\@dottedtocline{5}{12em}{6em}} +%</refrep> +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsubsection{List of figures} +% +% \begin{macro}{\listoffigures} +% This macro is used to request that \LaTeX{} produces a list of +% figures. It is very similar to |\tableofcontents|. +% +% \begin{macrocode} +\newcommand\listoffigures{% +%<*refrep> + \if@twocolumn + \@restonecoltrue\onecolumn + \else + \@restonecolfalse + \fi + \chapter*{\listfigurename +%</refrep> +%<+refart> \section*{\listfigurename + \@mkboth{\listfigurename}% + {\listfigurename}}% + \@starttoc{lof}% +%<+refrep> \if@restonecol\twocolumn\fi + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@figure} +% This macro produces an entry in the list of figures. +% \begin{macrocode} +\newcommand*\l@figure{\@dottedtocline{1}{1.5em}{2.3em}} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{List of tables} +% +% \begin{macro}{\listoftables} +% This macro is used to request that \LaTeX{} produces a list of +% tables. It is very similar to |\tableofcontents|. +% +% \begin{macrocode} +\newcommand\listoftables{% +%<*refrep> + \if@twocolumn + \@restonecoltrue\onecolumn + \else + \@restonecolfalse + \fi + \chapter*{\listtablename +%</refrep> +%<+refart> \section*{\listtablename + \@mkboth{\listtablename}{\listtablename}}% + \@starttoc{lot}% +%<+refrep> \if@restonecol\twocolumn\fi + } +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\l@table} +% This macro produces an entry in the list of tables. +% \begin{macrocode} +\let\l@table\l@figure +% \end{macrocode} +% \end{macro} +% +% \subsection{Bibliography} +% +% \begin{macro}{\bibindent} +% The ``open'' bibliography format uses an indentation of +% |\bibindent|. +% \begin{macrocode} +\newdimen\bibindent +\bibindent=1.5em +% \end{macrocode} +% \end{macro} +% +% \begin{environment}{thebibliography} +% The `thebibliography' environment executes the following +% commands: +% +% |\renewcommand\newblock{\hskip .11em \@plus .33em \@minus .07em}| +% -- Defines the ``closed'' format, where the blocks (major units +% of information) of an entry run together. +% +% |\sloppy| -- Used because it's rather hard to do line breaks in +% bibliographies, +% +% |\sfcode`\.=1000\relax| -- +% Causes a `.' (period) not to produce an end-of-sentence space. +% +% The implementation of this environment is based on the generic +% list environment. It uses the \Lcount{enumiv} counter internally +% to generate the labels of the list. +% +% When an empty `thebibliography' environment is found, a warning +% is issued. +% +% \begin{macrocode} +\newenvironment{thebibliography}[1] +%<+refart> {\section*{\refname +%<+refart> \@mkboth{\refname}{\refname}}% +%<+refrep> {\chapter*{\bibname +%<+refrep> \@mkboth{\bibname}{\bibname}}% + \list{\@biblabel{\@arabic\c@enumiv}}% + {\settowidth\labelwidth{\@biblabel{#1}}% + \leftmargin\labelwidth + \advance\leftmargin\labelsep + \@openbib@code + \usecounter{enumiv}% + \let\p@enumiv\@empty + \renewcommand\theenumiv{\@arabic\c@enumiv}}% + \sloppy + \clubpenalty4000 + \@clubpenalty \clubpenalty + \widowpenalty4000% + \sfcode`\.=\@m} + {\def\@noitemerr + {\@latex@warning{Empty `thebibliography' environment}}% + \endlist} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\newblock} +% The default definition for |\newblock| is to produce a small space. +% \begin{macrocode} +\newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@openbib@code} +% The default definition for |\@openbib@code| is to do nothing. +% It will be changed by the \Lopt{openbib} option. +% \begin{macrocode} +\let\@openbib@code\@empty +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@biblabel} +% The label for a |\bibitem[...]| command is produced by this +% macro. The default from \file{latex.dtx} is used. +% \begin{macrocode} +% \renewcommand*{\@biblabel}[1]{[#1]\hfill} +%( \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@cite} +% The output of the |\cite| command is produced by this macro. The +% default from \file{latex.dtx} is used. +% \begin{macrocode} +% \renewcommand*{\@cite}[1]{[#1]} +% \end{macrocode} +% \end{macro} +% +% \subsection{The index} +% +% \begin{environment}{theindex} +% The environment `theindex' can be used for indices. It makes an +% index with two columns, with each entry a separate paragraph. At +% the user level the commands |\item|, |\subitem| and |\subsubitem| +% are used to produce index entries of various levels. When a new +% letter of the alphabet is encountered an amount of |\indexspace| +% whitespace can be added. +% +% +% \begin{macrocode} +\newenvironment{theindex} + {\if@twocolumn + \@restonecolfalse + \else + \@restonecoltrue + \fi + \begin{fullpage} + \let\twocolumn\REF@twocolumn + \columnseprule \z@ + \columnsep 35\p@ +%<+refart> \twocolumn[\section*{\indexname}]% +%<*refrep> + \if@pageperchapter + \setcounter{page}{1} + \ifnum \c@secnumdepth >\m@ne + \refstepcounter{chapter}% + \typeout{\@chapapp\space\thechapter.}% + \addcontentsline{toc}{chapter} + {\protect\numberline{\thechapter}\indexname}% + \else + \addcontentsline{toc}{chapter}{\indexname}% + \fi + \addtocontents{lof}{\protect\addvspace{10\p@}}% + \addtocontents{lot}{\protect\addvspace{10\p@}}% + \twocolumn[\@makechapterhead{\indexname}]% + \else + \twocolumn[\@makeschapterhead{\indexname}]% + \fi +%</refrep> + \@mkboth{\indexname}% + {\indexname}% + \parindent\z@ + \parskip\z@ \@plus .3\p@\relax + \let\item\@idxitem} +% \end{macrocode} +% When the document continues after the index and it was a one +% column document we have to switch back to one column after the +% index. +% \begin{macrocode} + {\end{fullpage}\if@restonecol\onecolumn\else\clearpage\fi} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\@idxitem} +% \begin{macro}{\subitem} +% \begin{macro}{\subsubitem} +% Thsee macros are used to format the entries in the index. ^^AA ??? +% \begin{macrocode} +\newcommand\@idxitem {\par\hangindent 40\p@} +\newcommand\subitem {\@idxitem \hspace*{20\p@}} +\newcommand\subsubitem{\@idxitem \hspace*{30\p@}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\indexspace} +% The amount of whitespace that is inserted between `letter +% blocks' in the index. +% \begin{macrocode} +\newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax} +% \end{macrocode} +% \end{macro} +% +% \subsection{Footnotes} +% +% \begin{macro}{\footnoterule} +% Usually, footnotes are separated from the main body of the text +% by a small rule. This rule is drawn by the macro |\footnoterule|. +% We have to make sure that the rule takes no vertical space (see +% \file{plain.tex}) so we compensate for the natural heigth of the +% rule of 0.4pt by adding the right amount of vertical skip. +% +% To prevent the rule from colliding with the footnote we first add +% a little negative vertical skip, then we put the rule and make +% sure we end up at the same point where we begun this operation. +% \begin{macrocode} +\renewcommand\footnoterule{% + \kern-3\p@ + \hrule\@width.4\columnwidth + \kern 2.6\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\c@footnote} +% Footnotes are numbered within chapters in the report and book +% document styles. +% \begin{macrocode} +% \newcounter{footnote} +%<+refrep>\@addtoreset{footnote}{chapter} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@makefntext} +% The footnote mechanism of \LaTeX{} calls the macro |\@makefntext| +% to produce the actual footnote. The macro gets the text of the +% footnote as its argument and should use |\@thefnmark| as the mark +% of the footnote. The macro |\@makefntext|is called when +% effectively inside a |\parbox| of width |\columnwidth| (i.e., +% with |\hsize| = |\columnwidth|). +% +% An example of what can be achieved is given by the following piece +% of \TeX\ code. +% \begin{verbatim} +% \long\def\@makefntext#1{% +% \@setpar{\@@par +% \@tempdima = \hsize +% \advance\@tempdima-10\p@ +% \parshape \@ne 10\p@ \@tempdima}% +% \par +% \parindent 1em\noindent +% \hb@xt@\z@{\hss\@makefnmark}#1} +% \end{verbatim} +% The effect of this definition is that all lines of the footnote +% are indented by 10pt, while the first line of a new paragraph is +% indented by 1em. To change these dimensions, just substitute the +% desired value for `10pt' (in both places) or `1em'. The mark is +% flushright against the footnote. +% +% In these document classes we use a simpler macro, in which the +% footnote text is set like an ordinary text paragraph, with no +% indentation except on the first line of a paragraph, and the +% first line of the footnote. Thus, all the macro must do is set +% |\parindent| to the appropriate value for succeeding paragraphs +% and put the proper indentation before the mark. +% +% \changes{v2.0b}{1998/05/09}{Added some space between the footnote symbol +% and footnote text.} +% \begin{macrocode} +\long\def\@makefntext#1{% + \@setpar{\@@par + \@tempdima = \hsize + \advance\@tempdima -1em + \parshape \@ne 1em \@tempdima}% + \par\parindent 1em \noindent + \hb@xt@\z@{\hss\@textsuperscript{\normalfont\@thefnmark}\,}#1} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@makefnmark} +% The footnote markers that are printed in the text to point to the +% footnotes should be produced by the macro |\@makefnmark|. We use +% the default definition for it. +% \begin{macrocode} +%\def\@makefnmark{\hbox{\@textsuperscript{\normalfont\@thefnmark}}} +% \end{macrocode} +% \end{macro} +% +% \section{New commands} +% +% \begin{macro}{\@addmarginpar} +% Redefine the |\@addmarginpar| command to only use the left +% margin. +% +% \begin{macrocode} +\def\@addmarginpar{\@next\@marbox\@currlist{\@cons\@freelist\@marbox + \@cons\@freelist\@currbox}\@latexbug\@tempcnta\@ne + \if@twocolumn + \if@firstcolumn \@tempcnta\m@ne \fi + \else + \@tempcnta\m@ne + \fi + \ifnum\@tempcnta <\z@ \global\setbox\@marbox\box\@currbox \fi + \@tempdima\@mparbottom + \advance\@tempdima -\@pageht + \advance\@tempdima\ht\@marbox + \ifdim\@tempdima >\z@ + \@@warning{Marginpar on page \thepage\space moved}% + \else + \@tempdima\z@ + \fi + \global\@mparbottom\@pageht + \global\advance\@mparbottom\@tempdima + \global\advance\@mparbottom\dp\@marbox + \global\advance\@mparbottom\marginparpush + \advance\@tempdima -\ht\@marbox + \global\setbox \@marbox + \vbox {\vskip \@tempdima \box \@marbox}% + \global \ht\@marbox \z@ + \global \dp\@marbox \z@ + \kern -\@pagedp + \nointerlineskip + \hb@xt@\columnwidth + {\ifnum \@tempcnta >\z@ + \hskip\columnwidth \hskip\marginparsep + \else + \hskip -\marginparsep \hskip -\marginparwidth + \fi + \box\@marbox \hss}% + \nointerlineskip + \hbox{\vrule \@height\z@ \@width\z@ \@depth\@pagedp}} +% \end{macrocode} +% \end{macro} +% +% \subsection{Margin commands} +% +% \begin{macro}{\marginlable} +% \begin{macro}{\seealso} +% \begin{macro}{\attention} +% \begin{macro}{\attentionsymbol} +% +% This defines three commands to put information in the margin: +% |\marginlabel| buts the argument into a flush right marginpar, +% |\attention| puts |\attentionsymbol| to the left of the text to mark +% an important piece of text and |\seealso| puts a $\rightarrow$ to +% the left of the margin to mark a reference within the text. +% |\attentionsymbol| is defined as \large\bfseries ! $\rightarrow$ +% but can be changed with a |\renewcommand{\attentionsymbol}{:-)}| +% command. +% +% \changes{v2.0b}{1998/05/12}{Changed the definition of +% \cs{marginlabel}, \cs{seeealso} and \cs{attention} to use +% \cs{newcommand} to prevent runaway arguments.} +% \changes{v2.0c}{1999/03/20}{Added \cs{attentionsymbol} to change +% the symbol use for the \cs{attention} command.} +% \changes{v2.0c}{1999/03/20}{\cs{attention} now takes an optional +% argument} +% +% \begin{macrocode} +\newcommand*{\marginlabel}[1] + {\mbox{}\marginpar{\raggedleft #1}\ignorespaces} +\newcommand*{\seealso}[1] + {\mbox{}\marginpar{\small $\rightarrow$ #1}\ignorespaces} +\newcommand*{\attention}[1][\attentionsymbol] + {\mbox{}\marginpar{\raggedleft #1}} +\newcommand*{\attentionsymbol}{\large\bfseries ! $\rightarrow$} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Rules} +% +% \begin{macro}{\longrule} +% \begin{macro}{\longthickrule} +% +% These rules are used in several places, like the title, new +% parts and chapters and for maxi- and fullpages. +% \begin{macrocode} +\def\longrule{\par\hb@xt@\linewidth{\hss + \vrule width \fullwidth height 0.4\p@ depth \z@}\par} +\def\longthickrule{\par\hb@xt@\linewidth{\hss + \vrule width \fullwidth height 1.0\p@ depth \z@}\par} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Pages} +% +% \begin{environment}{maxipage} +% \begin{environment}{fullpage} +% +% The |\maxipage| is a minipage which uses the full width of +% the page with optional rules on the top and bottom. A maxipage +% can not split over pages. You can use it for wide tables, long +% math equations and the like. It can be used in floats. +% +% The |\fullpage| changes the page layout such that normal text +% and all environments use the full width of the page. Inside +% the |\fullpage|-environment, the |\leftmarginwidth| is reset +% to 0, thus it is possible to start a new chapter inside a +% |\fullpage|. This will be used in the index. +% +% \begin{macrocode} +\newenvironment{maxipage}{\par + \mbox{}\kern-\leftmarginwidth %\kern-\@totalleftmargin + \begin{minipage}{\fullwidth} + \medskip \ifmaxipagerule \hrule\medskip \fi + \parskip = 0.5\baselineskip + \def\marginpar{% +%<+refart> \ClassError{Refart} +%<+refrep> \ClassError{Refrep} + {Marginpar not allowed within Maxipage.} + {Where should I put them?\MessageBreak + I'm using the full pagewidth.}}} + {\par \vskip\parskip + \medskip \ifmaxipagerule \hrule\medskip \fi + \end{minipage}\par} +\newenvironment{fullpage}{% + \clearpage + \textwidth=\fullwidth + \addtolength\oddsidemargin {-\leftmarginwidth} + \setlength\evensidemargin{\oddsidemargin} + \leftmarginwidth=\z@ + \hsize=\fullwidth + \linewidth=\fullwidth + \columnwidth=\fullwidth + \def\marginpar{% +%<+refart> \ClassError{Refart} +%<+refrep> \ClassError{Refrep} + {Marginpar not allowed within Fullpage.} + {Where should I put them? I'm already\MessageBreak + using the whole page for text.}}} + {\clearpage} +% \end{macrocode} +% \end{environment} +% \end{environment} +% +% \subsection{Miscellaneous} +% +% \begin{macro}{\condbreak} +% \begin{macro}{\noparskip} +% The |\condbreak{length}| controls page breaks: +% If less then length is left on this page it will be moved +% to the next page. Thus it will remain together, either on +% this page or on the next. +% +% |\noparskip| removes the vertical parskip like |\noindent| +% removes the parindent. +% \begin{macrocode} +\def\condbreak#1{\vskip \z@ plus #1\pagebreak[3]\vskip \z@ plus -#1\relax} +\def\noparskip{\vskip-\parskip} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\REF@twocolumn} +% \begin{macro}{\twocolumn} +% Since this layout does not support |\twocolumn| the +% command is disabled but saved in |\REF@twocolumn|. The +% saved version will be used in the index. This is still +% experimental! Don't rely on it in future releases. +% \begin{macrocode} +\let\REF@twocolumn\twocolumn +\def\twocolumn{% +%<+refart>\ClassError{Refart} +%<+refrep>\ClassError{Refrep} +{Sorry, there is no twocolumn layout in this class} +{Can you imagine how twocolumn layout will look?\MessageBreak + That's why!}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \subsection{Obsolete commands} +% +% Well, these comands are not really obsolete, but they are not +% implemented in this version and will not be implemented later +% unless there is popular demand. +% +% |\makeauthor|: The author is printed when |\maketitle| is +% executed thus there is no need for this command. +% +% |\setleftmarginwidth| has been used in version 1.1 to +% change the horizontal layout. I would prefer to set the +% |leftmarginfraction| instead but I'm still open to +% suggestions from users. +% +% \subsection{Future commands} +% +% The following commands are not yet implemented but sound +% like a good idea. +% +% \begin{macro}{\ppc} +% \begin{macro}{\pageperchapter} +% This gives you a page count per chapter like 1-1, 1-2, 2-1. +% Since this is often requested and would be usefull in a +% reference manual style. |\pageperchapter| is only supported +% in refrep.cls. +% +% This version redefines the \LaTeX\ |\@wrindex| command +% which writes the indexentry. This hack is needed to keep +% MakeIndex happy when processing the index-file. The |\ppc| +% command is responsible to extract the chapter number from the +% index-entry and reformat it. The chapter number can be a +% Roman or Alpha number but the page has to be arabic. +% +% \begin{macrocode} +%<+refrep>\newif\if@pageperchapter \@pageperchapterfalse +%<+refrep>\newcommand{\pageperchapter} +%<+refrep> {\@pageperchaptertrue +%<+refrep> \let\ppthepage=\thepage +%<+refrep> \renewcommand\@pnumwidth{2.55em} +%<+refrep> \@openrighttrue +%<+refrep> \renewcommand\thepage{% +%<+refrep> \ifnum \c@chapter = \z@ +%<+refrep> \ppthepage +%<+refrep> \else +%<+refrep> \thechapter\ -- \arabic{page} +%<+refrep> \fi +%<+refrep> } +%<+refrep> \def\@wrindex##1{% +%<+refrep> \ifnum \c@chapter = \z@ +%<+refrep> \protected@write\@indexfile{}% +%<+refrep> {\string\indexentry{##1}{\arabic{page}}}% +%<+refrep> \else +%<+refrep> \protected@write\@indexfile{}% +%<+refrep> {\string\indexentry{##1|ppc{\thechapter}}% +%<+refrep> {\arabic{page}}}% +%<+refrep> \fi +%<+refrep> \endgroup +%<+refrep> \@esphack +%<+refrep> } +%<+refrep> \def\ppc##1##2{##1 -- ##2} +%<+refrep> } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\leftmarginfraction} +% This provides an interface to change the horizontal layout. +% In this version, the margin is set to 0.3 |fullwidth|, this +% may change in future versions. +% +% \end{macro} +% +% +% \section{Initialization} +% +% \subsection{Words} +% +% \begin{macro}{\contentsname} +% \begin{macro}{\listfigurename} +% \begin{macro}{\listtablename} +% \begin{macro}{\refname} +% \begin{macro}{\bibname} +% \begin{macro}{\indexname} +% \begin{macro}{\figurename} +% \begin{macro}{\tablename} +% \begin{macro}{\partname} +% \begin{macro}{\chaptername} +% \begin{macro}{\appendixname} +% \begin{macro}{\abstractname} +% This document class is for documents prepared in the English language. +% To prepare a version for another language, various English words must +% be replaced. All the English words that require replacement are +% defined below in command names. +% +% \begin{macrocode} +\newcommand\contentsname{Contents} +\newcommand\listfigurename{List of Figures} +\newcommand\listtablename{List of Tables} +%<+refart>\newcommand\refname{References} +%<+refrep>\newcommand\bibname{Bibliography} +\newcommand\indexname{Index} +\newcommand\figurename{Figure} +\newcommand\tablename{Table} +\newcommand\partname{Part} +%<+refrep>\newcommand\chaptername{Chapter} +\newcommand\appendixname{Appendix} +\newcommand\abstractname{Abstract} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \subsection{Date} +% +% \begin{macro}{\today} +% This macro uses the \TeX\ primitives |\month|, |\day| and |\year| +% to provide the date of the \LaTeX-run. +% \begin{macrocode} +\def\today{\ifcase\month\or + January\or February\or March\or April\or May\or June\or + July\or August\or September\or October\or November\or December\fi + \space\number\day, \number\year} +% \end{macrocode} +% \end{macro} +% +% \subsection{Two column mode} +% +% \begin{macro}{\columnsep} +% This gives the distance between two columns in two column mode. +% \begin{macrocode} +\setlength\columnsep{10\p@} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\columnseprule} +% This gives the width of the rule between two columns in two +% column mode. We have no visible rule. +% \begin{macrocode} +\setlength\columnseprule{0\p@} +% \end{macrocode} +% \end{macro} +% +% \subsection{The page style} +% We have \pstyle{plain} pages in the document classes refart +% and refrep unless the user specified otherwise. +% We use arabic page numbers. +% \begin{macrocode} +\pagestyle{plain} +\pagenumbering{arabic} % Arabic page numbers +% \end{macrocode} +% +% \subsection{Single or double sided printing} +% +% When the \Lopt{twoside} option wasn't specified, we don't try to +% make each page as long as all the others. +% \begin{macrocode} +\if@twoside +\else + \raggedbottom +\fi +% \end{macrocode} +% When the \Lopt{twocolumn} option was specified we call +% |\twocolumn| to activate this mode. We try to make each column as +% long as the others, but call |sloppy| to make our life easier. +% \begin{macrocode} +\if@twocolumn + \twocolumn + \sloppy + \flushbottom +% \end{macrocode} +% Normally we call |\onecolumn| to initiate typesetting in one +% column. +% \begin{macrocode} +\else + \onecolumn +\fi +%</refart|refrep> +% \end{macrocode} +% +% \Finale +% +\endinput diff --git a/macros/latex/contrib/refman/refman.ins b/macros/latex/contrib/refman/refman.ins new file mode 100644 index 0000000000..b200aeb4f9 --- /dev/null +++ b/macros/latex/contrib/refman/refman.ins @@ -0,0 +1,64 @@ +%% +%% 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 1988 - 94 by H. Partl. +% Copyright 1994 - 99 by Axel Kielhorn +% +% This program can be redistributed and/or modified under the terms +% of the LaTeX Project Public License Distributed from CTAN +% archives in directory macros/latex/base/lppl.txt; either +% version 1 of the License, or any later version. +% +% --------------- start of docstrip commands ------------------ +% +\def\batchfile{refman.ins} +\input docstrip.tex +\preamble + +Copyright (C) 1988-1994 by H. Partl. +Copyright (C) 1994-1999 by Axel Kielhorn. All rights reserved. +For additional copyright information see further down in this file. + +This file is to be used with the LaTeX2e system. +------------------------------------------------ + +This program can be redistributed and/or modified under the terms +of the LaTeX Project Public License Distributed from CTAN +archives in directory macros/latex/base/lppl.txt; either +version 1 of the License, or any later version. + +\endpreamble +\def\batchfile{refman.dst} % ignored in distribution +\input docstrip.tex % ignored in distribution + +\keepsilent + +\Msg{*** Generating the document class files ***} + +\generate{\file{refart.cls}{\from{refman.dtx}{refart}} + \file{refrep.cls}{\from{refman.dtx}{refrep}} + } + +\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 refart.cls} +\Msg{* \space\space refrep.cls} +\Msg{*} +\Msg{* To produce the documentation run refman.dtx} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Layout_e.tex contains an english guide to refman.} +\Msg{* Layout_d.tex enth"alt die deutsche Anleitung} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{***********************************************************} +} + +\endinput diff --git a/macros/latex/contrib/refman/refman.pdf b/macros/latex/contrib/refman/refman.pdf Binary files differnew file mode 100644 index 0000000000..981d932202 --- /dev/null +++ b/macros/latex/contrib/refman/refman.pdf diff --git a/macros/latex/contrib/refman/refman.upl b/macros/latex/contrib/refman/refman.upl new file mode 100644 index 0000000000..2252e75399 --- /dev/null +++ b/macros/latex/contrib/refman/refman.upl @@ -0,0 +1,159 @@ +This is version 2.0e[2006/11/18] of the refman class family for LaTeX2e + +Refman is based on classes.dtx (1.4a) and the Refman.sty version 1.1. + +This new class is a class by it's own and no style-option. +I've made this change to support some things which would have +been difficult with a style-option. + +The new class consists of +refart.cls an article-like style (former refman-s) +refrep.cls a report-like style (former refman) + +There is only a little difference between refart and refrep: + +Refrep supports chapters, has a titlepage by default and uses +chaptermark and sectionmark in footings and headings. +Refrep supports \pageperchapter + +Refart supports an optional titlepage and uses sectionmark +and subsectionmark in footings and headings. + +Changes: +======== + +Both classes support different papersizes in the same way as the +original LaTeX2e-classes, including the landscape option. +There is a new option to produce a square-layout. + +The pagelayout is not 100% compatible to refman.sty due to the +multiple-papersize-support. +The running head and foot is not compatible to refman.sty. + +I've changed the footnote-layout since a not indended footnote- +layout fits better to a not indended textlayout. (There have been lots of +fixed for the footnote layout, seems to be a reall problem.) + +I've tried to support an index-environment. +The index is set in twocolumn-layout. + +The maketitle-command sets title *and* autor *and* date. If you +don't want the date use \date{} before calling \maketitle. + +I've followed the example of Markus Kohm and renamed the classes +to refart.cls and refrep.cls. Thus it is easier to remember what is +what and it can't be confused with refman.sty + +Obsolete commands: +================== + +The command setleftmarginwidth is no longer supported. There is no +use setting the leftmargin to a fixed value if you don't know +the fullwidth. (See new commands) + +The makeauthor is no longer supported, this is done by maketitle. + +New commands (not in refman.sty v. 1.1) +======================================= +There are some commands I consider usefull in a reference +manual style: + +\pageperchapter +This will give you new pagenumbers each chapter, +looking like 1-1, 1-2, 1-3, 2-1 ... +Prefacepages will be numberer 1,2,3 since 0-1 is not desireable. +The pagepc-package will implement this for the LaTeX-standard +classes. (This is still experimental and does not work well +with MakeIndex) + +A hack to make MakeIndex happy is included, but sadly MakeIndex +can no longer use the "|" command anymore since it is used to +format the indexentries. + +\settextfraction{fraction} +This will reset the horizontal layout, giving you a textwidth +of fraction*fullwidth. The restriction to lines with 60-70 chars has +been removed. + +Both commands should only be used in the preamble. + +A new option smallborder has been introduced. It reduces the border +around the page from 1 in to 0.25 in (1/4 in for users in the USA). This +will reduce the amout of screen area wasted when preparing online +documentation. Since the result are rather long lines, you should use this +only with smaller papersizes, like a5paper. + +History: +======== + +1.9 a Included redefinition of pagestyle{plain} for twoside printing +1.9 b Refman now works with LaTeX2e [1994/06/01] and is in sync + with classes 1.2 s +1.9 c Fixed refman: There should be an opening { in markright + (every pagestyle, except for plain and empty) + Moved changing of topmargin inside ps definition +1.9 d Fixed the pagestyles for oneside printing + Changed chapter layout (uses fullwidth now) + Changed typeout to ClassError where needed +1.9 e Renamed refman to refrep and refman-s to refart. + Cleaned up fullwidth-environment, now it works on + even-sides too:-) + Added \pageperchapter to refrep.cls + Added \settextfraction + Removed ref{10|11|12}.clo. Refman is now using the + size{10|11|12}.clo files. +1.9 f Synced with classes.dtx v. 1.2x + Ref{art,rep} needs now LaTeX2e[1994/12/01] + Pagestyle plain does not center the pagenumber, it is + always printed at the outside-margin. + Documentation added (layout.tex layout2.tex) +1.9 g Final test release synced with LaTeX2e[1995/06/01] + (Classes.dtx v.1.3e) + Pagestyle plain did center the pagenumber in one-side + documents, fixed it this time. + Fixed fullpage-environment to reset leftmarginwidth and + set hsize to the correct value. (You may now start a new + chapter inside a fullpage environment.(Not encouraged)) + Made settextfraction an onlypreamble-command. + Changed the \pageperchapter-command and included pagepc.sty + which can be used with other LaTeX2e-classes (like report + and scrreprt) In pageperchapter-mode, the index will be in + a chapter of it's own and no longer belong to the last + appendix. +1.9 h Corrected some typos where the a in normalfont was missing + Added my e-mail address to the dtx-file, so bug reports can + reach me faster. Corrected typo in condbreak (There is seems to + be at least one user who uses it) + Synced with classes 1.3p, thus saving some memory. +1.9 i Corrected footnote in titlepage (refart only) + Removed . after the chapternumber. + Changed format of chapter-title. It now hangs after the + chapter number. +1.9 k Corrected appendix in refrep. Now the chapter-counter is used + to generate the chapter-number +1.9 l Again fixes to to the footnote-layout of refart. Now titlepage + and normal text use the same code. +1.9 m Added a forgotten \ to listfigurename +2.0 Synced with Classes 1.3u +2.0a Added missing \renewcommand\thetable in refrep +2.0b Added english documentation, changed layout of footnote again + (Added more space between footnotesymbol and text) Changed the + footnote layout on the titlepage to be compatible with the + footnotelayout used within the class. +2.0c Changed the licence to "LaTeX Project Public License" + Fixed some typos in the documentation + \attention now takes an optional argument + Added \attentionsymbol to allow the use of different symbols for the + \attention command + Added the manfnt package to access symbols from the manfnt font + The manfnt package has been removed from refman. it is now a package + of it's own. No other file has changed, the version number is + unchanged. +2.0d Fixed a typo using the wrong penalty, updated e-mail address. +2.0e Fixed many typos in the documentation, added option smallborder + Changed calculation of textheight and textwidth, please report + errors. + Added option dvips, pdftex and pagesize to export the pagesize. + Changes pagestyle for titlepage to empty since plain does not work + with pagestyle{headings}. No longer change the pagestyle for the + index. |