fpcman.sty 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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. \RequirePackage{xspace}
  23. \NeedsTeXFormat{LaTeX2e}
  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. % Now, Let's define the \procedure and \function commands.
  64. \newcommand{\FPClabel}[1]{%
  65. \raggedleft\makebox[0pt][r]{\textsf{#1:}}
  66. }
  67. \newenvironment{FPCList}
  68. {\begin{list}{}{%
  69. \renewcommand{\makelabel}[1]{\FPClabel{##1}\hfil\relax}
  70. \setlength{\labelwidth}{0pt}%
  71. \setlength{\leftmargin}{0pt}}%
  72. \setlength{\labelsep}{0pt}%
  73. }
  74. {\end{list}}
  75. \newcommand{\function}[6]{
  76. \subsection{#1}
  77. \raisebox{1ex}{\rule{\linewidth}{0.5mm}}
  78. \label{fu:#1}
  79. \index{#1}
  80. \begin{FPCList}
  81. \item[Declaration]
  82. \texttt {Function #1 #2 : #3;}
  83. \item[Description]
  84. #4
  85. \item[Errors]
  86. #5
  87. \item[See also]
  88. #6
  89. \end{FPCList}
  90. }
  91. \newcommand{\procedure}[5]{
  92. \subsection{#1}
  93. \raisebox{1ex}{\rule{\linewidth}{0.5mm}}
  94. \label{pro:#1}
  95. \index{#1}
  96. \begin{FPCList}
  97. \item[Declaration]
  98. \texttt {Function #1 #2;}
  99. \item[Description]
  100. #3
  101. \item[Errors]
  102. #4
  103. \item[See also]
  104. #5
  105. \end{FPCList}
  106. }
  107. % define a capital version,
  108. % for function/command which has no options passed to it.
  109. \newcommand{\Function}[5]{\function{#1}{}{#2}{#3}{#4}{#5}}
  110. \newcommand{\Procedure}[4]{\procedure{#1}{}{#2}{#3}{#4}}
  111. % Now the referencing commands.
  112. \newcommand{\seef}[1]{
  113. \textsf{#1} (\pageref{fu:#1})}
  114. \newcommand{\seep}[1]{
  115. \textsf{#1} (\pageref{pro:#1})}
  116. % man page references...
  117. \newcommand{\seem}[2] {#1(#2) }
  118. % for easy typesetting of variables and files.
  119. \newcommand{\var}[1]{\texttt {#1}}
  120. \newcommand{\file}[1]{\textsf {#1}}
  121. %
  122. % Useful references.
  123. %
  124. \newcommand{\progref}{\htmladdnormallink{Programmer's guide}{../prog/prog.html}\xspace}
  125. \newcommand{\refref}{\htmladdnormallink{Reference guide}{../ref/ref.html}\xspace}
  126. \newcommand{\userref}{\htmladdnormallink{Users' guide}{../user/user.html}\xspace}
  127. \newcommand{\unitsref}{\htmladdnormallink{Unit reference}{../units/units.html}\xspace}
  128. \newcommand{\seecrt}{\htmladdnormallink{CRT}{../crt/crt.html}\xspace}
  129. \newcommand{\seelinux}{\htmladdnormallink{Linux}{../linux/linux.html}\xspace}
  130. \newcommand{\seestrings}{\htmladdnormallink{strings}{../strings/strings.html}\xspace}
  131. \newcommand{\seedos}{\htmladdnormallink{DOS}{../dos/dos.html}\xspace}
  132. \newcommand{\seegetopts}{\htmladdnormallink{getopts}{../getopts/getopts.html}\xspace}
  133. \newcommand{\seeobjects}{\htmladdnormallink{objects}{../objects/objects.html}\xspace}
  134. \newcommand{\seegraph}{\htmladdnormallink{graph}{../graph/graph.html}\xspace}
  135. \newcommand{\seeprinter}{\htmladdnormallink{printer}{../printer/printer.html}\xspace}
  136. \newcommand{\seego}{\htmladdnormallink{GO32}{../go32/go32.html}\xspace}
  137. \newcommand{\seec}[1]{chapter \ref{ch:#1}\xspace}
  138. \newcommand{\sees}[1]{section \ref{se:#1}\xspace}
  139. %
  140. % Nice environments
  141. %
  142. % For Tables.
  143. \newenvironment{FPCtable}[2]{\begin{table}[h]\caption{#2}\begin{center}\begin{tabular}{#1}}{\end{tabular}\end{center}\end{table}}
  144. % The same, but with label in third argument (tab:#3)
  145. \newenvironment{FPCltable}[3]{\begin{table}\caption{#2}\label{tab:#3}\begin{center}\begin{tabular}{#1}}{\end{tabular}\end{center}\end{table}}
  146. %
  147. % Commands to reference these things.
  148. %
  149. \newcommand{\seet}[1]{table (\ref{tab:#1}) }
  150. % some OSes
  151. \newcommand{\linux}{\textsc{linux}\xspace}
  152. \newcommand{\dos} {\textsc{dos}\xspace}
  153. \newcommand{\msdos}{\textsc{ms-dos}\xspace}
  154. \newcommand{\ostwo}{\textsc{os/2}\xspace}
  155. \newcommand{\windowsnt}{\textsc{WindowsNT}\xspace}
  156. \newcommand{\windows}{\textsc{Windows}\xspace}
  157. \newcommand{\fpc}{Free Pascal\xspace}
  158. \newcommand{\gnu}{\textsc{gnu}\xspace}
  159. \newcommand{\atari}{\textsc{Atari}\xspace}
  160. \newcommand{\amiga}{\textsc{Amiga}\xspace}
  161. \newcommand{\win}{\textsc{Win32}\xspace}
  162. \newcommand{\freebsd}{\textsc{FreeBSD}\xspace}
  163. %
  164. \newcommand{\fpcversion}{0.99.12}
  165. %
  166. % PDF support
  167. %
  168. \newif\ifpdf
  169. \ifx\pdfoutput\undefined
  170. \pdffalse
  171. \else
  172. \pdfoutput=1
  173. \pdftrue
  174. \fi
  175. %
  176. % end of fpcman.sty