~ubuntu-branches/ubuntu/wily/coq-doc/wily

« back to all changes in this revision

Viewing changes to tools/coqdoc/coqdoc.sty

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu, Stéphane Glondu, Samuel Mimram
  • Date: 2010-01-07 22:50:39 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100107225039-n3cq82589u0qt0s2
Tags: 8.2pl1-1
[ Stéphane Glondu ]
* New upstream release (Closes: #563669)
  - remove patches
* Packaging overhaul:
  - use git, advertise it in Vcs-* fields of debian/control
  - use debhelper 7 and dh with override
  - use source format 3.0 (quilt)
* debian/control:
  - set Maintainer to d-o-m, set Uploaders to Sam and myself
  - add Homepage field
  - bump Standards-Version to 3.8.3
* Register PDF documentation into doc-base
* Add debian/watch
* Update debian/copyright

[ Samuel Mimram ]
* Change coq-doc's description to mention that it provides documentation in
  pdf format, not postscript, closes: #543545.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
% This is coqdoc.sty, by Jean-Christophe Filli�tre
 
3
% This LaTeX package is used by coqdoc (http://www.lri.fr/~filliatr/coqdoc)
 
4
%
 
5
% You can modify the following macros to customize the appearance
 
6
% of the document.
 
7
 
 
8
\NeedsTeXFormat{LaTeX2e}
 
9
\ProvidesPackage{coqdoc}[2002/02/11]
 
10
 
 
11
% % Headings
 
12
% \usepackage{fancyhdr}
 
13
% \newcommand{\coqdocleftpageheader}{\thepage\ -- \today}
 
14
% \newcommand{\coqdocrightpageheader}{\today\ -- \thepage}
 
15
% \pagestyle{fancyplain}
 
16
 
 
17
% %BEGIN LATEX
 
18
% \headsep 8mm
 
19
% \renewcommand{\plainheadrulewidth}{0.4pt}
 
20
% \renewcommand{\plainfootrulewidth}{0pt}
 
21
% \lhead[\coqdocleftpageheader]{\leftmark}
 
22
% \rhead[\leftmark]{\coqdocrightpageheader}
 
23
% \cfoot{}
 
24
% %END LATEX
 
25
 
 
26
% Hevea puts to much space with \medskip and \bigskip
 
27
%HEVEA\renewcommand{\medskip}{}
 
28
%HEVEA\renewcommand{\bigskip}{}
 
29
 
 
30
 
 
31
%HEVEA\newcommand{\lnot}{\coqwkw{not}}
 
32
%HEVEA\newcommand{\lor}{\coqwkw{or}}
 
33
%HEVEA\newcommand{\land}{\&}
 
34
 
 
35
% own name
 
36
\newcommand{\coqdoc}{\textsf{coqdoc}}
 
37
 
 
38
% pretty underscores (the package fontenc causes ugly underscores)
 
39
%BEGIN LATEX
 
40
\def\_{\kern.08em\vbox{\hrule width.35em height.6pt}\kern.08em}
 
41
%END LATEX
 
42
 
 
43
% macro for typesetting keywords
 
44
\newcommand{\coqdockw}[1]{\texttt{#1}}
 
45
 
 
46
% macro for typesetting variable identifiers
 
47
\newcommand{\coqdocvar}[1]{\textit{#1}}
 
48
 
 
49
% macro for typesetting constant identifiers
 
50
\newcommand{\coqdoccst}[1]{\textsf{#1}}
 
51
 
 
52
% macro for typesetting module identifiers
 
53
\newcommand{\coqdocmod}[1]{\textsc{\textsf{#1}}}
 
54
 
 
55
% macro for typesetting module constant identifiers (e.g. Parameters in
 
56
% module types)
 
57
\newcommand{\coqdocax}[1]{\textsl{\textsf{#1}}}
 
58
 
 
59
% macro for typesetting inductive type identifiers
 
60
\newcommand{\coqdocind}[1]{\textbf{\textsf{#1}}}
 
61
 
 
62
% macro for typesetting constructor identifiers
 
63
\newcommand{\coqdocconstr}[1]{\textsf{#1}}
 
64
 
 
65
% macro for typesetting tactic identifiers
 
66
\newcommand{\coqdoctac}[1]{\texttt{#1}}
 
67
 
 
68
 
 
69
% Environment encompassing code fragments
 
70
% !!! CAUTION: This environment may have empty contents
 
71
\newenvironment{coqdoccode}{}{}
 
72
 
 
73
% Environment for comments
 
74
\newenvironment{coqdoccomment}{\tt(*}{*)}
 
75
 
 
76
% newline and indentation 
 
77
%BEGIN LATEX
 
78
% Base indentation length
 
79
\newlength{\coqdocbaseindent}
 
80
\setlength{\coqdocbaseindent}{0em}
 
81
 
 
82
% Beginning of a line without any Coq indentation
 
83
\newcommand{\coqdocnoindent}{\noindent\kern\coqdocbaseindent}
 
84
% Beginning of a line with a given Coq indentation
 
85
\newcommand{\coqdocindent}[1]{\noindent\kern\coqdocbaseindent\noindent\kern#1}
 
86
% End-of-the-line
 
87
\newcommand{\coqdoceol}{\hspace*{\fill}\setlength\parskip{0pt}\par}
 
88
% Empty lines (in code only)
 
89
\newcommand{\coqdocemptyline}{\vskip 0.4em plus 0.1em minus 0.1em}
 
90
 
 
91
% macro for typesetting the title of a module implementation
 
92
\newcommand{\coqdocmodule}[1]{\chapter{Module #1}\markboth{Module #1}{}
 
93
}
 
94
\usepackage{ifpdf}
 
95
\ifpdf
 
96
  \RequirePackage{hyperref}
 
97
  \hypersetup{raiselinks=true,colorlinks=true,linkcolor=black}
 
98
 
 
99
  % To do indexing, use something like:
 
100
  % \usepackage{multind}
 
101
  % \newcommand{\coqdef}[3]{\hypertarget{coq:#1}{\index{coq}{#1@#2|hyperpage}#3}}
 
102
 
 
103
  \newcommand{\coqdef}[3]{\phantomsection\hypertarget{coq:#1}{#3}}
 
104
  \newcommand{\coqref}[2]{\hyperlink{coq:#1}{#2}}
 
105
  \newcommand{\identref}[2]{\hyperlink{coq:#1}{\textsf {#2}}}
 
106
  \newcommand{\coqlibrary}[2]{\cleardoublepage\phantomsection
 
107
    \hypertarget{coq:#1}{\chapter{Library \texorpdfstring{\coqdoccst}{}{#2}}}}
 
108
\else
 
109
  \newcommand{\coqdef}[3]{#3}
 
110
  \newcommand{\coqref}[2]{#2}
 
111
  \newcommand{\texorpdfstring}[2]{#1}
 
112
  \newcommand{\identref}[2]{\textsf{#2}}
 
113
  \newcommand{\coqlibrary}[2]{\cleardoublepage\chapter{Library \coqdoccst{#2}}}
 
114
\fi
 
115
\usepackage{xr}
 
116
 
 
117
\newif\if@coqdoccolors
 
118
  \@coqdoccolorsfalse
 
119
 
 
120
\DeclareOption{color}{\@coqdoccolorstrue}
 
121
\ProcessOptions
 
122
 
 
123
\if@coqdoccolors
 
124
\RequirePackage{xcolor}
 
125
\definecolor{varpurple}{rgb}{0.4,0,0.4}
 
126
\definecolor{constrmaroon}{rgb}{0.6,0,0}
 
127
\definecolor{defgreen}{rgb}{0,0.4,0}
 
128
\definecolor{indblue}{rgb}{0,0,0.8}
 
129
\definecolor{kwred}{rgb}{0.8,0.1,0.1}
 
130
 
 
131
\def\coqdocvarcolor{varpurple}
 
132
\def\coqdockwcolor{kwred}
 
133
\def\coqdoccstcolor{defgreen}
 
134
\def\coqdocindcolor{indblue}
 
135
\def\coqdocconstrcolor{constrmaroon}
 
136
\def\coqdocmodcolor{defgreen}
 
137
\def\coqdocaxcolor{varpurple}
 
138
\def\coqdoctaccolor{black}
 
139
 
 
140
\def\coqdockw#1{{\color{\coqdockwcolor}{\texttt{#1}}}}
 
141
\def\coqdocvar#1{{\color{\coqdocvarcolor}{\textit{#1}}}}
 
142
\def\coqdoccst#1{{\color{\coqdoccstcolor}{\textrm{#1}}}}
 
143
\def\coqdocind#1{{\color{\coqdocindcolor}{\textsf{#1}}}}
 
144
\def\coqdocconstr#1{{\color{\coqdocconstrcolor}{\textsf{#1}}}}
 
145
\def\coqdocmod#1{{{\color{\coqdocmodcolor}{\textsc{\textsf{#1}}}}}}
 
146
\def\coqdocax#1{{{\color{\coqdocaxcolor}{\textsl{\textrm{#1}}}}}}
 
147
\def\coqdoctac#1{{\color{\coqdoctaccolor}{\texttt{#1}}}}
 
148
\fi
 
149
 
 
150
\newcommand{\coqdefinition}[2]{\coqdef{#1}{#2}{\coqdoccst{#2}}}
 
151
\newcommand{\coqdefinitionref}[2]{\coqref{#1}{\coqdoccst{#2}}}
 
152
 
 
153
\newcommand{\coqvariable}[2]{\coqdocvar{#2}}
 
154
\newcommand{\coqvariableref}[2]{\coqref{#1}{\coqdocvar{#2}}}
 
155
 
 
156
\newcommand{\coqinductive}[2]{\coqdef{#1}{#2}{\coqdocind{#2}}}
 
157
\newcommand{\coqinductiveref}[2]{\coqref{#1}{\coqdocind{#2}}}
 
158
 
 
159
\newcommand{\coqconstructor}[2]{\coqdef{#1}{#2}{\coqdocconstr{#2}}}
 
160
\newcommand{\coqconstructorref}[2]{\coqref{#1}{\coqdocconstr{#2}}}
 
161
 
 
162
\newcommand{\coqlemma}[2]{\coqdef{#1}{#2}{\coqdoccst{#2}}}
 
163
\newcommand{\coqlemmaref}[2]{\coqref{#1}{\coqdoccst{#2}}}
 
164
 
 
165
\newcommand{\coqclass}[2]{\coqdef{#1}{#2}{\coqdocind{#2}}}
 
166
\newcommand{\coqclassref}[2]{\coqref{#1}{\coqdocind{#2}}}
 
167
 
 
168
\newcommand{\coqinstance}[2]{\coqdef{#1}{#2}{\coqdoccst{#2}}}
 
169
\newcommand{\coqinstanceref}[2]{\coqref{#1}{\coqdoccst{#2}}}
 
170
 
 
171
\newcommand{\coqmethod}[2]{\coqdef{#1}{#2}{\coqdoccst{#2}}}
 
172
\newcommand{\coqmethodref}[2]{\coqref{#1}{\coqdoccst{#2}}}
 
173
 
 
174
\newcommand{\coqabbreviation}[2]{\coqdef{#1}{#2}{\coqdoccst{#2}}}
 
175
\newcommand{\coqabbreviationref}[2]{\coqref{#1}{\coqdoccst{#2}}}
 
176
 
 
177
\newcommand{\coqrecord}[2]{\coqdef{#1}{#2}{\coqdocind{#2}}}
 
178
\newcommand{\coqrecordref}[2]{\coqref{#1}{\coqdocind{#2}}}
 
179
 
 
180
\newcommand{\coqprojection}[2]{\coqdef{#1}{#2}{\coqdoccst{#2}}}
 
181
\newcommand{\coqprojectionref}[2]{\coqref{#1}{\coqdoccst{#2}}}
 
182
 
 
183
\newcommand{\coqnotationref}[2]{\coqref{#1}{\coqdockw{#2}}}
 
184
 
 
185
\newcommand{\coqsection}[2]{\coqdef{sec:#1}{#2}{\coqdoccst{#2}}}
 
186
\newcommand{\coqsectionref}[2]{\coqref{sec:#1}{\coqdoccst{#2}}}
 
187
 
 
188
%\newcommand{\coqlibrary}[2]{\chapter{Library \coqdoccst{#2}}\label{coq:#1}}
 
189
  
 
190
%\newcommand{\coqlibraryref}[2]{\ref{coq:#1}}
 
191
 
 
192
\newcommand{\coqlibraryref}[2]{\coqref{#1}{\coqdoccst{#2}}}
 
193
 
 
194
\newcommand{\coqaxiom}[2]{\coqdef{#1}{#2}{\coqdocax{#2}}}
 
195
\newcommand{\coqaxiomref}[2]{\coqref{#1}{\coqdocax{#2}}}
 
196
 
 
197
\newcommand{\coqmodule}[2]{\coqdef{mod:#1}{#2}{\coqdocmod{#2}}}
 
198
\newcommand{\coqmoduleref}[2]{\coqref{mod:#1}{\coqdocmod{#2}}}
 
199
 
 
200
\endinput