/[escript]/trunk/doc/user/esysdoc.cls
ViewVC logotype

Contents of /trunk/doc/user/esysdoc.cls

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3302 - (show annotations)
Mon Oct 25 01:50:07 2010 UTC (8 years, 10 months ago) by jfenwick
File size: 3969 byte(s)
Fixed appendix so hyperref generates links properly
1 %
2 % A class for ESSCC documentation
3 %
4
5 \NeedsTeXFormat{LaTeX2e}
6 \ProvidesClass{esysdoc}
7 \LoadClass[a4paper, twoside]{book}
8
9 \usepackage[a4paper, left=2.5cm, right=2.5cm, nohead, vcentering, scale=0.8]{geometry}
10 \usepackage{times}
11 \usepackage{listings}
12 \usepackage{ifpdf}
13
14 %\usepackage{avant}
15 %\renewcommand{\familydefault}{\sfdefault} % Switch to san seriff
16 \usepackage{url}
17 \usepackage{xspace}
18 \usepackage{graphicx,color}
19 \usepackage{amsmath} %For equation*
20 \usepackage{amsfonts,amssymb} % see http://www.ams.org/tex/amslatex.html
21 \usepackage[nohyphen, strings]{underscore}
22
23 %Blue was chosen here because it looks ok when printed
24 \usepackage[pdfborder={0 0 0},pdfdisplaydoctitle=true,linktocpage=false, colorlinks=true,linkcolor=blue,citecolor=blue,urlcolor=blue]{hyperref}
25
26
27 \usepackage{fancyhdr}
28 \renewcommand{\footrulewidth}{0.4pt}
29 \renewcommand{\headrulewidth}{0pt}
30
31 \fancypagestyle{plain}{%
32 \fancyhead{}
33 \cfoot{}
34 \fancyfoot[LE,RO]{\thepage} %left on even pages right on odd pages
35 \fancyfoot[RE]{\nouppercase{\rightmark}}
36 \fancyfoot[LO]{\nouppercase{\leftmark}}
37 }
38 \pagestyle{plain}
39
40 \usepackage[Bjarne]{fncychap}
41 % \ChRuleWidth{1pt}
42 \ChNameVar{\raggedleft\large\sffamily} % The word chapter
43 \ChNumVar{\raggedleft\bfseries\Large} % The number of the chapter
44 \ChTitleVar{\raggedleft \Huge\sffamily} % title of the chapter
45 \ChTitleAsIs
46
47 %Ensures that latex doesn't have an error if we don't specify the version
48 \providecommand{\RepVersion}{Unknown\xspace}
49
50 \DeclareUrlCommand\email{}
51
52 \newcommand{\module}[1]{\mbox{\texttt{#1}}}
53
54 \newcommand*{\optional}[1]{[ #1 ]}
55 %This should be converted into a two arg form so we can have different fonts for different parts
56 \newcommand*{\programopt}[1]{#1}
57
58 \newenvironment{bigdef}[1]{%
59 \noindent
60 \setlength{\hangindent}{2cm}
61 \textbf{#1}
62
63 \setlength{\hangindent}{1cm}%
64 \setlength{\hangafter}{0}%
65 \noindent%
66 }%
67 {%
68
69 \vspace{0.5cm}
70 }
71
72 \newenvironment{classdesc}[2]{%
73 \begin{bigdef}{class #1}}{\end{bigdef}}
74
75 \newenvironment{methoddesc}[3][{}]{%
76 \begin{bigdef}{#2(#3)}}{\end{bigdef}}
77 \newenvironment{funcdesc}[2]{%
78 \begin{bigdef}{#1(#2)}%
79 }
80 {%
81 \end{bigdef}
82 }
83
84 % {
85 % \begin{bigdef}[#1(#2)]
86 % \noindent
87 % \setlength{\hangindent}{2cm}
88 % \textbf{#1(#2)}
89 %
90 % }
91 % \setlength{\hangindent}{1cm}
92 % \setlength{\hangafter}{0}
93 % \noindent
94 % }%
95 % {%
96 %
97 % \mbox{}\\
98 % }
99
100 \setlength{\itemindent}{-1cm}\setlength{\leftmargin}{1cm}
101
102 \newenvironment{memberdesc}[2][{}]{\begin{description}\item[\textbf{#2}]\mbox{}\\}{\end{description}}
103 \newenvironment{datadesc}[1]{\begin{description}\item[\textbf{#1}]\mbox{}\\}{\end{description}}
104
105 \newcommand{\file}[1]{\texttt{#1}\xspace}
106 \newcommand{\program}[1]{\textbf{\texttt{#1}}\xspace}
107 % \newcommand{\env}[1]{\texttt{#1}\xspace}
108 \newcommand{\var}[1]{\texttt{#1}\xspace}
109 \newcommand{\kbd}[1]{\texttt{#1}}
110 \newcommand{\function}[1]{\texttt{#1}}
111 \newcommand{\class}[1]{\texttt{#1}}
112 \newcommand{\constant}[1]{\textsl{#1}}
113 \newcommand{\method}[1]{\texttt{#1}}
114 \newcommand{\member}[1]{\texttt{#1}}
115 \newcommand{\code}[1]{%
116 \ifmmode%
117 \mbox{\texttt{#1}}%
118 \else%
119 \texttt{#1}%
120 \fi % Because people try to put code in maths mode
121 }
122
123 \newenvironment{abstract}{\newpage\mbox{}\vfill\begin{center}\textbf{Abstract}\end{center}}{\vfill\newpage}
124
125 \newcommand{\authoraddress}[1]{\gdef \@authoraddress {#1}}
126
127 \newcommand{\release}[1]{\gdef \@ESreleasename {#1}}
128 \release{nightly} %Just so we have a default
129
130 \newcommand*{\subtitleLineOne}{\textsl{Release - \@ESreleasename}}
131 \newcommand*{\subtitleLineTwo}{\textsl{(r\RepVersion)}}
132
133 \renewcommand{\maketitle}{
134 \begin{titlepage}
135 \textsf{
136 \begin{raggedleft}
137 \Huge
138 \hrule
139 \mbox{}\\
140 \mbox{}\\
141 \@title
142 \mbox{}\\
143 \LARGE
144 \mbox{}\\
145 \subtitleLineOne\\
146 \subtitleLineTwo\\
147 \vfill
148 \@author
149 \vfill
150 \vfill
151 \large
152 \@date\\
153 \vfill
154 \@authoraddress\mbox{}\\
155 \end{raggedleft}
156 }
157 \end{titlepage}}
158
159 \newcommand{\esysappendix}{%
160 \appendix%
161 \renewcommand*{\theHchapter}{\Alph{chapter}} %How latex generates chapters
162 \renewcommand*{\thechapter}{\Alph{chapter}} %How hyperref generates chapters
163 }
164
165
166

  ViewVC Help
Powered by ViewVC 1.1.26