fpc.sty 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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. \RequirePackage{ifthen}
  25. \ExecuteOptions{titlepage}
  26. % Some style elements
  27. \parindent 0pt%
  28. \parskip 0.35\baselineskip%
  29. % First, all definitions for latex only.
  30. \newcommand{\docdescription}[1]{\def\@FPCDescription{#1}}
  31. \gdef\@FPCDescription{}%
  32. \newcommand{\docversion}[1]{\def\@FPCVersion{#1}}
  33. \gdef\@FPCVersion{}%
  34. % For backwards compatibility
  35. \newcommand{\unitdescription}[1]{\def\@FPCDescription{#1}}
  36. \newcommand{\unitversion}[1]{\def\@FPCVersion{#1}}
  37. \renewcommand\maketitle{\begin{titlepage}%
  38. \let\footnotesize\small
  39. \let\footnoterule\relax
  40. \null\vfil
  41. \vskip 4cm%
  42. {\noindent\raggedright\Large\@title\\}%
  43. \noindent \rule{\linewidth}{1.5mm}\\%
  44. {\raggedleft\large%
  45. \begin{tabular}[t]{r}%
  46. \@FPCDescription \\
  47. \@FPCVersion \\
  48. \@date
  49. \end{tabular}\par}%
  50. \vskip 5cm%
  51. {\noindent \large \textsf{\@author} \\%
  52. \rule{\linewidth}{0.5mm}}
  53. \@thanks
  54. \vfil\null
  55. \end{titlepage}%
  56. \setcounter{footnote}{0}%
  57. \let\thanks\relax\let\maketitle\relax
  58. \gdef\@thanks{}\gdef\@author{}\gdef\@title{}}
  59. % end of \maketitle
  60. % For the \procedure and \function commands, we don't want heading numbers.
  61. \setcounter{secnumdepth}{1}
  62. % redefine the subsection command to leave less space,
  63. %and to use sans serif
  64. \renewcommand\subsection{\@startsection%
  65. {subsection}%
  66. {2}%
  67. {\z@}%
  68. {-4.25ex\@plus -1ex \@minus -.2ex}%
  69. {1pt}%
  70. {\normalfont\large\sffamily\bfseries}}
  71. % Now, Let's define the \procedure and \function commands.
  72. \newcommand{\FPClabel}[1]{%
  73. \raggedleft\makebox[0pt][r]{\textsf{#1:}}
  74. }
  75. %
  76. % FPC environments
  77. %
  78. % Lists
  79. \newenvironment{FPCList}
  80. {\begin{list}{}{%
  81. \renewcommand{\makelabel}[1]{\FPClabel{##1}\hfil\relax}
  82. \setlength{\labelwidth}{0pt}%
  83. \setlength{\leftmargin}{0pt}}%
  84. \setlength{\labelsep}{0pt}%
  85. }
  86. {\end{list}}
  87. % For Tables.
  88. \newenvironment{FPCtable}[2]{\begin{table}\caption{#2}\begin{center}\begin{tabular}{#1}}{\end{tabular}\end{center}\end{table}}
  89. % The same, but with label in third argument (tab:#3)
  90. \newenvironment{FPCltable}[3]{\begin{table}\caption{#2}\label{tab:#3}\begin{center}\begin{tabular}{#1}}{\end{tabular}\end{center}\end{table}}
  91. %
  92. % Refs
  93. %
  94. \newcommand{\seefl}[2]{\textsf{#1} (\pageref{fu:#2})}
  95. \newcommand{\seepl}[2]{\textsf{#1} (\pageref{pro:#2})}
  96. \newcommand{\seetyl}[2]{\textsf{#1} (\pageref{ty:#2})}
  97. \newcommand{\seec}[1]{chapter \ref{ch:#1}, page \pageref{ch:#1}\xspace}
  98. \newcommand{\sees}[1]{section \ref{se:#1}, page \pageref{se:#1}\xspace}
  99. \newcommand{\seeo}[1]{See \ref{option:#1}}
  100. \newcommand{\seet}[1]{table (\ref{tab:#1}) }
  101. %
  102. % Function/procedure environments
  103. %
  104. \newenvironment{functionl}[2]{\subsection{#1}\index{#1}\label{fu:#2}\begin{FPCList}}{\end{FPCList}}
  105. \newenvironment{procedurel}[2]{\subsection{#1}\index{#1}\label{pro:#2}\begin{FPCList}}{\end{FPCList}}
  106. \newenvironment{function}[1]{\begin{functionl}{#1}{#1}}{\end{functionl}}
  107. \newenvironment{procedure}[1]{\begin{procedurel}{#1}{#1}}{\end{procedurel}}
  108. \newenvironment{typel}[2]{\subsection{#1}\index{#1}\label{ty:#2}\begin{FPCList}}{\end{FPCList}}
  109. \newenvironment{type}[1]{\begin{typel}{#1}{#1}}{\end{typel}}
  110. \newcommand{\Declaration}{\item[Declaration]\ttfamily}
  111. \newcommand{\Description}{\item[Description]\rmfamily}
  112. \newcommand{\Errors}{\item[Errors]\rmfamily}
  113. \newcommand{\SeeAlso}{\item[See also]\rmfamily}
  114. %
  115. % Ref without labels
  116. %
  117. \newcommand{\seef}[1]{\seefl{#1}{#1}}
  118. \newcommand{\seep}[1]{\seepl{#1}{#1}}
  119. \newcommand{\seety}[1]{\seetyl{#1}{#1}}
  120. %
  121. % man page references don't need labels.
  122. %
  123. \newcommand{\seem}[2]{\texttt{#1} (#2) }
  124. %
  125. % for easy typesetting of variables.
  126. %
  127. \newcommand{\var}[1]{\texttt {#1}}
  128. \newcommand{\file}[1]{\textsf {#1}}
  129. %
  130. % Useful references.
  131. %
  132. \newcommand{\progref}{\htmladdnormallink{Programmers' guide}{../prog/prog.html}\xspace}
  133. \newcommand{\refref}{\htmladdnormallink{Reference guide}{../ref/ref.html}\xspace}
  134. \newcommand{\userref}{\htmladdnormallink{Users' guide}{../user/user.html}\xspace}
  135. \newcommand{\unitsref}{\htmladdnormallink{Unit reference}{../units/units.html}\xspace}
  136. \newcommand{\seecrt}{\htmladdnormallink{CRT}{../crt/crt.html}\xspace}
  137. \newcommand{\seelinux}{\htmladdnormallink{Linux}{../linux/linux.html}\xspace}
  138. \newcommand{\seestrings}{\htmladdnormallink{strings}{../strings/strings.html}\xspace}
  139. \newcommand{\seedos}{\htmladdnormallink{DOS}{../dos/dos.html}\xspace}
  140. \newcommand{\seegetopts}{\htmladdnormallink{getopts}{../getopts/getopts.html}\xspace}
  141. \newcommand{\seeobjects}{\htmladdnormallink{objects}{../objects/objects.html}\xspace}
  142. \newcommand{\seegraph}{\htmladdnormallink{graph}{../graph/graph.html}\xspace}
  143. \newcommand{\seeprinter}{\htmladdnormallink{printer}{../printer/printer.html}\xspace}
  144. \newcommand{\seego}{\htmladdnormallink{GO32}{../go32/go32.html}\xspace}
  145. %
  146. % Commands to reference these things.
  147. %
  148. \newcommand{\remark}[1]{\par$\rightarrow$\textbf{#1}\par}
  149. \newcommand{\olabel}[1]{\label{option:#1}}
  150. %
  151. % some OSes
  152. %
  153. \newcommand{\linux}{\textsc{linux}\xspace}
  154. \newcommand{\dos} {\textsc{dos}\xspace}
  155. \newcommand{\msdos}{\textsc{ms-dos}\xspace}
  156. \newcommand{\ostwo}{\textsc{os/2}\xspace}
  157. \newcommand{\windows}{\textsc{Windows}\xspace}
  158. \newcommand{\windowsnt}{\textsc{Windows NT}\xspace}
  159. \newcommand{\fpc}{Free Pascal\xspace}
  160. \newcommand{\gnu}{\textsc{gnu}\xspace}
  161. \newcommand{\atari}{\textsc{Atari}\xspace}
  162. \newcommand{\amiga}{\textsc{Amiga}\xspace}
  163. \newcommand{\win}{\textsc{Win32}\xspace}
  164. \newcommand{\freebsd}{\textsc{FreeBSD}\xspace}
  165. %
  166. % Some versions
  167. %
  168. \newcommand{\fpcversion}{0.99.12}
  169. %
  170. % PDF support
  171. %
  172. \latex{%
  173. \newif\ifpdf
  174. \ifx\pdfoutput\undefined
  175. \pdffalse
  176. \else
  177. \pdfoutput=1
  178. \pdftrue
  179. \fi
  180. }
  181. %
  182. % end of fpc.sty