fpc.sty 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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. \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. \renewcommand\subsection{\@startsection%
  60. {subsection}%
  61. {2}%
  62. {\z@}%
  63. {-4.25ex\@plus -1ex \@minus -.2ex}%
  64. {1pt}%
  65. {\normalfont\large\sffamily\bfseries}}
  66. % Now, Let's define the \procedure and \function commands.
  67. \newcommand{\FPClabel}[1]{%
  68. \raggedleft\makebox[0pt][r]{\textsf{#1:}}
  69. }
  70. \newenvironment{FPCList}
  71. {\begin{list}{}{%
  72. \renewcommand{\makelabel}[1]{\FPClabel{##1}\hfil\relax}
  73. \setlength{\labelwidth}{0pt}%
  74. \setlength{\leftmargin}{0pt}}%
  75. \setlength{\labelsep}{0pt}%
  76. }
  77. {\end{list}}
  78. %
  79. % define a version of \procedure and \function
  80. % which allows you to give a label.
  81. %
  82. \newcommand{\functionl}[7]{
  83. \subsection{#1}
  84. \raisebox{1ex}{\rule{\linewidth}{0.5mm}}
  85. \label{fu:#2}
  86. \index{#1}
  87. \begin{FPCList}
  88. \item[Declaration]
  89. \texttt {Function #1 #3 : #4;}
  90. \item[Description]
  91. #5
  92. \item[Errors]
  93. #6
  94. \item[See also]
  95. #7
  96. \end{FPCList}
  97. }
  98. \newcommand{\procedurel}[6]{
  99. \subsection{#1}
  100. \raisebox{1ex}{\rule{\linewidth}{0.5mm}}
  101. \label{pro:#2}
  102. \index{#1}
  103. \begin{FPCList}
  104. \item[Declaration]
  105. \texttt {Procedure #1 #3;}
  106. \item[Description]
  107. #4
  108. \item[Errors]
  109. #5
  110. \item[See also]
  111. #6
  112. \end{FPCList}
  113. }
  114. % define a capital version,
  115. % for function/command which has no options passed to it.
  116. \newcommand{\Functionl}[6]{\functionl{#1}{#2}{}{#3}{#4}{#5}{#6}}
  117. \newcommand{\Procedurel}[5]{\procedurel{#1}{#2}{}{#3}{#4}{#5}}
  118. %
  119. % These versions take the function name as the label.
  120. %
  121. \newcommand{\function}[6]{\functionl{#1}{#1}{#2}{#3}{#4}{#5}{#6}}
  122. \newcommand{\procedure}[5]{\procedurel{#1}{#1}{#2}{#3}{#4}{#5}}
  123. % define a capital version,
  124. % for function/command which has no options passed to it.
  125. \newcommand{\Function}[5]{\function{#1}{}{#2}{#3}{#4}{#5}}
  126. \newcommand{\Procedure}[4]{\procedure{#1}{}{#2}{#3}{#4}}
  127. % Now the referencing commands.
  128. %
  129. % First, the ones with alternate label (second argument}
  130. %
  131. \newcommand{\seefl}[2]{
  132. \textsf{#1} (\pageref{fu:#2})}
  133. \newcommand{\seepl}[2]{
  134. \textsf{#1} (\pageref{pro:#2})}
  135. %
  136. % Now the ones with label.
  137. %
  138. \newcommand{\seef}[1]{\seefl{#1}{#1}}
  139. \newcommand{\seep}[1]{\seepl{#1}{#1}}
  140. %
  141. % man page references don't need labels.
  142. %
  143. \newcommand{\seem}[2]{\texttt{#1} (#2) }
  144. %
  145. % for easy typesetting of variables.
  146. %
  147. \newcommand{\var}[1]{\texttt {#1}}
  148. \newcommand{\file}[1]{\textsf {#1}}
  149. %
  150. % Useful references.
  151. %
  152. \newcommand{\progref}{\htmladdnormallink{Programmers' guide}{../prog/prog.html}\ }
  153. \newcommand{\refref}{\htmladdnormallink{Reference guide}{../ref/ref.html}\ }
  154. \newcommand{\userref}{\htmladdnormallink{Users' guide}{../user/user.html}\ }
  155. \newcommand{\unitsref}{\htmladdnormallink{Unit reference}{../units/units.html}\ }
  156. \newcommand{\seecrt}{\htmladdnormallink{CRT}{../crt/crt.html}}
  157. \newcommand{\seelinux}{\htmladdnormallink{Linux}{../linux/linux.html}}
  158. \newcommand{\seestrings}{\htmladdnormallink{strings}{../strings/strings.html}}
  159. \newcommand{\seedos}{\htmladdnormallink{DOS}{../dos/dos.html}}
  160. \newcommand{\seegetopts}{\htmladdnormallink{getopts}{../getopts/getopts.html}}
  161. \newcommand{\seeobjects}{\htmladdnormallink{objects}{../objects/objects.html}}
  162. \newcommand{\seegraph}{\htmladdnormallink{graph}{../graph/graph.html}}
  163. \newcommand{\seeprinter}{\htmladdnormallink{printer}{../printer/printer.html}}
  164. \newcommand{\seego}{\htmladdnormallink{GO32}{../go32/go32.html}}
  165. %
  166. % Nice environments
  167. %
  168. % For Code examples (complete programs only)
  169. \newenvironment{CodEx}{}{}
  170. % For Tables.
  171. \newenvironment{FPCtable}[2]{\begin{table}\caption{#2}\begin{center}\begin{tabular}{#1}}{\end{tabular}\end{center}\end{table}}
  172. % The same, but with label in third argument (tab:#3)
  173. \newenvironment{FPCltable}[3]{\begin{table}\caption{#2}\label{tab:#3}\begin{center}\begin{tabular}{#1}}{\end{tabular}\end{center}\end{table}}
  174. %
  175. % Commands to reference these things.
  176. %
  177. \newcommand{\seet}[1]{table (\ref{tab:#1}) }
  178. %
  179. % some OSes
  180. %
  181. \newcommand{\linux}{\textsc{linux}\ }
  182. \newcommand{\dos} {\textsc{dos}\ }
  183. \newcommand{\msdos}{\textsc{ms-dos}\ }
  184. \newcommand{\ostwo}{\textsc{os/2}\ }
  185. \newcommand{\windows}{\textsc{Windows}\ }
  186. \newcommand{\windowsnt}{\textsc{WindowsNT}\ }
  187. \newcommand{\fpc}{Free Pascal\ }
  188. \newcommand{\gnu}{\textsc{gnu}\ }
  189. %
  190. % Some versions
  191. %
  192. \newcommand{\fpcversion}{0.99.7}
  193. % end of fpc.sty