|
| 1 | +% Default Haddock style definitions. To use your own style, invoke |
| 2 | +% Haddock with the option --latex-style=mystyle. |
| 3 | + |
| 4 | +\usepackage{tabulary} % see below |
| 5 | + |
| 6 | +% make hyperlinks in the PDF, and add an expandabale index |
| 7 | +\usepackage[pdftex,bookmarks=true]{hyperref} |
| 8 | + |
| 9 | +\newenvironment{haddocktitle} |
| 10 | + {\begin{center}\bgroup\large\bfseries} |
| 11 | + {\egroup\end{center}} |
| 12 | +\newenvironment{haddockprologue}{\vspace{1in}}{} |
| 13 | + |
| 14 | +\newcommand{\haddockmoduleheading}[1]{\chapter{\texttt{#1}}} |
| 15 | + |
| 16 | +\newcommand{\haddockbeginheader}{\hrulefill} |
| 17 | +\newcommand{\haddockendheader}{\noindent\hrulefill} |
| 18 | + |
| 19 | +% a little gap before the ``Methods'' header |
| 20 | +\newcommand{\haddockpremethods}{\vspace{2ex}} |
| 21 | + |
| 22 | +% inserted before \\begin{verbatim} |
| 23 | +\newcommand{\haddockverb}{\small} |
| 24 | + |
| 25 | +% an identifier: add an index entry |
| 26 | +\newcommand{\haddockid}[1]{\haddocktt{#1}\index{#1@\texttt{#1}}} |
| 27 | + |
| 28 | +% The tabulary environment lets us have a column that takes up ``the |
| 29 | +% rest of the space''. Unfortunately it doesn't allow |
| 30 | +% the \end{tabulary} to be in the expansion of a macro, it must appear |
| 31 | +% literally in the document text, so Haddock inserts |
| 32 | +% the \end{tabulary} itself. |
| 33 | +\newcommand{\haddockbeginconstrs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}} |
| 34 | +\newcommand{\haddockbeginargs}{\begin{tabulary}{\linewidth}{@{}llJ@{}}} |
| 35 | + |
| 36 | +\newcommand{\haddocktt}[1]{{\small \texttt{#1}}} |
| 37 | +\newcommand{\haddockdecltt}[1]{{\small\bfseries \texttt{#1}}} |
| 38 | + |
| 39 | +\makeatletter |
| 40 | +\newenvironment{haddockdesc} |
| 41 | + {\list{}{\labelwidth\z@ \itemindent-\leftmargin |
| 42 | + \let\makelabel\haddocklabel}} |
| 43 | + {\endlist} |
| 44 | +\newcommand*\haddocklabel[1]{\hspace\labelsep\haddockdecltt{#1}} |
| 45 | +\makeatother |
| 46 | + |
| 47 | +% after a declaration, start a new line for the documentation. |
| 48 | +% Otherwise, the documentation starts right after the declaration, |
| 49 | +% because we're using the list environment and the declaration is the |
| 50 | +% ``label''. I tried making this newline part of the label, but |
| 51 | +% couldn't get that to work reliably (the space seemed to stretch |
| 52 | +% sometimes). |
| 53 | +\newcommand{\haddockbegindoc}{\hfill\\[1ex]} |
| 54 | + |
| 55 | +% spacing between paragraphs and no \parindent looks better |
| 56 | +\parskip=10pt plus2pt minus2pt |
| 57 | +\setlength{\parindent}{0cm} |
0 commit comments