fpcman.sty 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. %
  2. % $Id$
  3. % This file is part of the FPC documentation.
  4. % Copyright (C) 1997, by Michael Van Canneyt
  5. %
  6. % The FPC documentation is free text; you can redistribute it and/or
  7. % modify it under the terms of the GNU Library General Public License as
  8. % published by the Free Software Foundation; either version 2 of the
  9. % License, or (at your option) any later version.
  10. %
  11. % The FPC Documentation is distributed in the hope that it will be useful,
  12. % but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. % Library General Public License for more details.
  15. %
  16. % You should have received a copy of the GNU Library General Public
  17. % License along with the FPC documentation; see the file COPYING.LIB. If not,
  18. % write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19. % Boston, MA 02111-1307, USA.
  20. %
  21. \ProvidesPackage{fpcman}[1997/06/25]
  22. \NeedsTeXFormat{LaTeX2e}
  23. \ExecuteOptions{titlepage}
  24. % First, all definitions for latex only.
  25. \newcommand{\docdescription}[1]{\def\@FPCDescription{#1}}
  26. \gdef\@FPCDescription{}%
  27. \newcommand{\docversion}[1]{\def\@FPCVersion{#1}}
  28. \gdef\@FPCVersion{}%
  29. % For backwards compatibility
  30. \newcommand{\unitdescription}[1]{\def\@FPCDescription{#1}}
  31. \newcommand{\unitversion}[1]{\def\@FPCVersion{#1}}
  32. \renewcommand\maketitle{\begin{titlepage}%
  33. \let\footnotesize\small
  34. \let\footnoterule\relax
  35. \null\vfil
  36. \vskip 4cm%
  37. {\noindent\raggedright\Large\@title\\}%
  38. \noindent \rule{\linewidth}{1.5mm}\\%
  39. {\raggedleft\large%
  40. \begin{tabular}[t]{r}%
  41. \@FPCDescription \\
  42. \@FPCVersion \\
  43. \@date
  44. \end{tabular}\par}%
  45. \vskip 5cm%
  46. {\noindent \large \textsf{\@author} \\%
  47. \rule{\linewidth}{0.5mm}}
  48. \@thanks
  49. \vfil\null
  50. \end{titlepage}%
  51. \setcounter{footnote}{0}%
  52. \let\thanks\relax\let\maketitle\relax
  53. \gdef\@thanks{}\gdef\@author{}\gdef\@title{}}
  54. % end of \maketitle
  55. % For the \procedure and \function commands, we don't want heading numbers.
  56. \setcounter{secnumdepth}{1}
  57. % redefine the subsection command to leave less space,
  58. %and to use sans serif
  59. % Now, Let's define the \procedure and \function commands.
  60. \newcommand{\FPClabel}[1]{%
  61. \raggedleft\makebox[0pt][r]{\textsf{#1:}}
  62. }
  63. \newenvironment{FPCList}
  64. {\begin{list}{}{%
  65. \renewcommand{\makelabel}[1]{\FPClabel{##1}\hfil\relax}
  66. \setlength{\labelwidth}{0pt}%
  67. \setlength{\leftmargin}{0pt}}%
  68. \setlength{\labelsep}{0pt}%
  69. }
  70. {\end{list}}
  71. \newcommand{\function}[6]{
  72. \subsection{#1}
  73. \raisebox{1ex}{\rule{\linewidth}{0.5mm}}
  74. \label{fu:#1}
  75. \index{#1}
  76. \begin{FPCList}
  77. \item[Declaration]
  78. \texttt {Function #1 #2 : #3;}
  79. \item[Description]
  80. #4
  81. \item[Errors]
  82. #5
  83. \item[See also]
  84. #6
  85. \end{FPCList}
  86. }
  87. \newcommand{\procedure}[5]{
  88. \subsection{#1}
  89. \raisebox{1ex}{\rule{\linewidth}{0.5mm}}
  90. \label{pro:#1}
  91. \index{#1}
  92. \begin{FPCList}
  93. \item[Declaration]
  94. \texttt {Function #1 #2;}
  95. \item[Description]
  96. #3
  97. \item[Errors]
  98. #4
  99. \item[See also]
  100. #5
  101. \end{FPCList}
  102. }
  103. % define a capital version,
  104. % for function/command which has no options passed to it.
  105. \newcommand{\Function}[5]{\function{#1}{}{#2}{#3}{#4}{#5}}
  106. \newcommand{\Procedure}[4]{\procedure{#1}{}{#2}{#3}{#4}}
  107. % Now the referencing commands.
  108. \newcommand{\seef}[1]{
  109. \textsf{#1} (\pageref{fu:#1})}
  110. \newcommand{\seep}[1]{
  111. \textsf{#1} (\pageref{pro:#1})}
  112. % man page references...
  113. \newcommand{\seem}[2] {#1(#2) }
  114. % for easy typesetting of variables and files.
  115. \newcommand{\var}[1]{\texttt {#1}}
  116. \newcommand{\file}[1]{\textsf {#1}}
  117. %
  118. % Useful references.
  119. %
  120. \newcommand{\progref}{\htmladdnormallink{Programmer's guide}{../prog/prog.html}\ }
  121. \newcommand{\refref}{\htmladdnormallink{Reference guide}{../ref/ref.html}\ }
  122. \newcommand{\userref}{\htmladdnormallink{Users' guide}{../user/user.html}\ }
  123. \newcommand{\unitsref}{\htmladdnormallink{Unit reference}{../units/units.html}\ }
  124. \newcommand{\seecrt}{\htmladdnormallink{CRT}{../crt/crt.html}}
  125. \newcommand{\seelinux}{\htmladdnormallink{Linux}{../linux/linux.html}}
  126. \newcommand{\seestrings}{\htmladdnormallink{strings}{../strings/strings.html}}
  127. \newcommand{\seedos}{\htmladdnormallink{DOS}{../dos/dos.html}}
  128. \newcommand{\seegetopts}{\htmladdnormallink{getopts}{../getopts/getopts.html}}
  129. \newcommand{\seeobjects}{\htmladdnormallink{objects}{../objects/objects.html}}
  130. \newcommand{\seegraph}{\htmladdnormallink{graph}{../graph/graph.html}}
  131. \newcommand{\seeprinter}{\htmladdnormallink{printer}{../printer/printer.html}}
  132. \newcommand{\seego}{\htmladdnormallink{GO32}{../go32/go32.html}}
  133. \newcommand{\seec}[1]{chapter \ref{ch:#1}}
  134. \newcommand{\sees}[1]{section \ref{se:#1}}
  135. %
  136. % Nice environments
  137. %
  138. % For Code examples (complete programs only)
  139. \newenvironment{CodEx}{}{}
  140. % For Tables.
  141. \newenvironment{FPCtable}[2]{\begin{table}\caption{#2}\begin{center}\begin{tabular}{#1}}{\end{tabular}\end{center}\end{table}}
  142. % The same, but with label in third argument (tab:#3)
  143. \newenvironment{FPCltable}[3]{\begin{table}\caption{#2}\label{tab:#3}\begin{center}\begin{tabular}{#1}}{\end{tabular}\end{center}\end{table}}
  144. %
  145. % Commands to reference these things.
  146. %
  147. \newcommand{\seet}[1]{table (\ref{tab:#1}) }
  148. % some OSes
  149. \newcommand{\linux}{\textsc{linux}\ }
  150. \newcommand{\dos} {\textsc{dos}\ }
  151. \newcommand{\msdos}{\textsc{ms-dos}\ }
  152. \newcommand{\ostwo}{\textsc{os/2}\ }
  153. \newcommand{\windowsnt}{\textsc{WindowsNT}\ }
  154. \newcommand{\windows}{\textsc{Windows}\ }
  155. \newcommand{\fpc}{Free Pascal\ }
  156. \newcommand{\gnu}{\textsc{gnu}\ }
  157. %
  158. \newcommand{\fpcversion}{0.99.1}
  159. % end of fpcman.sty