fpc.sty 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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{fpc}[1996/12/09]
  22. \NeedsTeXFormat{LaTeX2e}
  23. \RequirePackage{xspace}
  24. \ExecuteOptions{titlepage}
  25. % Some style elements
  26. \parindent 0pt%
  27. \parskip 0.35\baselineskip%
  28. % First, all definitions for latex only.
  29. \newcommand{\docdescription}[1]{\def\@FPCDescription{#1}}
  30. \gdef\@FPCDescription{}%
  31. \newcommand{\docversion}[1]{\def\@FPCVersion{#1}}
  32. \gdef\@FPCVersion{}%
  33. % For backwards compatibility
  34. \newcommand{\unitdescription}[1]{\def\@FPCDescription{#1}}
  35. \newcommand{\unitversion}[1]{\def\@FPCVersion{#1}}
  36. \renewcommand\maketitle{\begin{titlepage}%
  37. \let\footnotesize\small
  38. \let\footnoterule\relax
  39. \null\vfil
  40. \vskip 4cm%
  41. {\noindent\raggedright\Large\@title\\}%
  42. \noindent \rule{\linewidth}{1.5mm}\\%
  43. {\raggedleft\large%
  44. \begin{tabular}[t]{r}%
  45. \@FPCDescription \\
  46. \@FPCVersion \\
  47. \@date
  48. \end{tabular}\par}%
  49. \vskip 5cm%
  50. {\noindent \large \textsf{\@author} \\%
  51. \rule{\linewidth}{0.5mm}}
  52. \@thanks
  53. \vfil\null
  54. \end{titlepage}%
  55. \setcounter{footnote}{0}%
  56. \let\thanks\relax\let\maketitle\relax
  57. \gdef\@thanks{}\gdef\@author{}\gdef\@title{}}
  58. % end of \maketitle
  59. % For the \procedure and \function commands, we don't want heading numbers.
  60. \setcounter{secnumdepth}{1}
  61. % redefine the subsection command to leave less space,
  62. %and to use sans serif
  63. \renewcommand\subsection{\@startsection%
  64. {subsection}%
  65. {2}%
  66. {\z@}%
  67. {-4.25ex\@plus -1ex \@minus -.2ex}%
  68. {1pt}%
  69. {\normalfont\large\sffamily\bfseries}}
  70. % Now, Let's define the \procedure and \function commands.
  71. \newcommand{\FPClabel}[1]{%
  72. \raggedleft\makebox[0pt][r]{\textsf{#1:}}
  73. }
  74. \newenvironment{FPCList}
  75. {\begin{list}{}{%
  76. \renewcommand{\makelabel}[1]{\FPClabel{##1}\hfil\relax}
  77. \setlength{\labelwidth}{0pt}%
  78. \setlength{\leftmargin}{0pt}}%
  79. \setlength{\labelsep}{0pt}%
  80. }
  81. {\end{list}}
  82. %
  83. % define a version of \procedure and \function
  84. % which allows you to give a label.
  85. %
  86. \newcommand{\functionl}[7]{
  87. \subsection{#1}
  88. \raisebox{1ex}{\rule{\linewidth}{0.5mm}}
  89. \label{fu:#2}
  90. \index{#1}
  91. \begin{FPCList}
  92. \item[Declaration]
  93. \texttt {Function #1 #3 : #4;}
  94. \item[Description]
  95. #5
  96. \item[Errors]
  97. #6
  98. \item[See also]
  99. #7
  100. \end{FPCList}
  101. }
  102. \newcommand{\procedurel}[6]{
  103. \subsection{#1}
  104. \raisebox{1ex}{\rule{\linewidth}{0.5mm}}
  105. \label{pro:#2}
  106. \index{#1}
  107. \begin{FPCList}
  108. \item[Declaration]
  109. \texttt {Procedure #1 #3;}
  110. \item[Description]
  111. #4
  112. \item[Errors]
  113. #5
  114. \item[See also]
  115. #6
  116. \end{FPCList}
  117. }
  118. % define a capital version,
  119. % for function/command which has no options passed to it.
  120. \newcommand{\Functionl}[6]{\functionl{#1}{#2}{}{#3}{#4}{#5}{#6}}
  121. \newcommand{\Procedurel}[5]{\procedurel{#1}{#2}{}{#3}{#4}{#5}}
  122. %
  123. % These versions take the function name as the label.
  124. %
  125. \newcommand{\function}[6]{\functionl{#1}{#1}{#2}{#3}{#4}{#5}{#6}}
  126. \newcommand{\procedure}[5]{\procedurel{#1}{#1}{#2}{#3}{#4}{#5}}
  127. % define a capital version,
  128. % for function/command which has no options passed to it.
  129. \newcommand{\Function}[5]{\function{#1}{}{#2}{#3}{#4}{#5}}
  130. \newcommand{\Procedure}[4]{\procedure{#1}{}{#2}{#3}{#4}}
  131. % Now the referencing commands.
  132. %
  133. % First, the ones with alternate label (second argument}
  134. %
  135. \newcommand{\seefl}[2]{
  136. \textsf{#1} (\pageref{fu:#2})}
  137. \newcommand{\seepl}[2]{
  138. \textsf{#1} (\pageref{pro:#2})}
  139. %
  140. % Now the ones with label.
  141. %
  142. \newcommand{\seef}[1]{\seefl{#1}{#1}}
  143. \newcommand{\seep}[1]{\seepl{#1}{#1}}
  144. %
  145. % man page references don't need labels.
  146. %
  147. \newcommand{\seem}[2]{\texttt{#1} (#2) }
  148. %
  149. % for easy typesetting of variables.
  150. %
  151. \newcommand{\var}[1]{\texttt {#1}}
  152. \newcommand{\file}[1]{\textsf {#1}}
  153. %
  154. % Useful references.
  155. %
  156. \newcommand{\progref}{\htmladdnormallink{Programmers' guide}{../prog/prog.html}\xspace}
  157. \newcommand{\refref}{\htmladdnormallink{Reference guide}{../ref/ref.html}\xspace}
  158. \newcommand{\userref}{\htmladdnormallink{Users' guide}{../user/user.html}\xspace}
  159. \newcommand{\unitsref}{\htmladdnormallink{Unit reference}{../units/units.html}\xspace}
  160. \newcommand{\seecrt}{\htmladdnormallink{CRT}{../crt/crt.html}\xspace}
  161. \newcommand{\seelinux}{\htmladdnormallink{Linux}{../linux/linux.html}\xspace}
  162. \newcommand{\seestrings}{\htmladdnormallink{strings}{../strings/strings.html}\xspace}
  163. \newcommand{\seedos}{\htmladdnormallink{DOS}{../dos/dos.html}\xspace}
  164. \newcommand{\seegetopts}{\htmladdnormallink{getopts}{../getopts/getopts.html}\xspace}
  165. \newcommand{\seeobjects}{\htmladdnormallink{objects}{../objects/objects.html}\xspace}
  166. \newcommand{\seegraph}{\htmladdnormallink{graph}{../graph/graph.html}\xspace}
  167. \newcommand{\seeprinter}{\htmladdnormallink{printer}{../printer/printer.html}\xspace}
  168. \newcommand{\seego}{\htmladdnormallink{GO32}{../go32/go32.html}\xspace}
  169. \newcommand{\seec}[1]{chapter \ref{ch:#1}\xspace}
  170. \newcommand{\sees}[1]{section \ref{se:#1}\xspace}
  171. %
  172. % Nice environments
  173. %
  174. % For Code examples (complete programs only)
  175. \newenvironment{CodEx}{\begin{quote}}{\end{quote}}
  176. % For Tables.
  177. \newenvironment{FPCtable}[2]{\begin{table}\caption{#2}\begin{center}\begin{tabular}{#1}}{\end{tabular}\end{center}\end{table}}
  178. % The same, but with label in third argument (tab:#3)
  179. \newenvironment{FPCltable}[3]{\begin{table}\caption{#2}\label{tab:#3}\begin{center}\begin{tabular}{#1}}{\end{tabular}\end{center}\end{table}}
  180. %
  181. % Commands to reference these things.
  182. %
  183. \newcommand{\seet}[1]{table (\ref{tab:#1}) }
  184. %
  185. % some OSes
  186. %
  187. \newcommand{\linux}{\textsc{linux}\xspace}
  188. \newcommand{\dos} {\textsc{dos}\xspace}
  189. \newcommand{\msdos}{\textsc{ms-dos}\xspace}
  190. \newcommand{\ostwo}{\textsc{os/2}\xspace}
  191. \newcommand{\windows}{\textsc{Windows}\xspace}
  192. \newcommand{\windowsnt}{\textsc{WindowsNT}\xspace}
  193. \newcommand{\fpc}{Free Pascal\xspace}
  194. \newcommand{\gnu}{\textsc{gnu}\xspace}
  195. %
  196. % Some versions
  197. %
  198. \newcommand{\fpcversion}{0.99.8}
  199. % end of fpc.sty