File: manual-style.tex

package info (click to toggle)
checker-framework-java 3.2.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 22,840 kB
  • sloc: java: 145,910; xml: 839; sh: 518; makefile: 401; perl: 26
file content (209 lines) | stat: -rw-r--r-- 8,662 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
\usepackage[T1]{fontenc}
\usepackage{pslatex}
\usepackage{microtype}

\usepackage{fullpage}
\usepackage{graphicx}
\usepackage{hevea}
\usepackage{url}
\usepackage{color}
\usepackage{hyperref}
% Not supported by Hevea, so don't bother: \usepackage{minitoc}
\usepackage{proof}

\usepackage{relsize}
% \def\codesize{\smaller}
\def\codesize{\relax}           % for "pslatex"
%HEVEA \def\codesize{\relax}

%%BEGIN LATEX
\newcommand{\code}[1]{\ifmmode{\mbox{\codesize\ttfamily{#1}}}\else{\codesize\ttfamily #1}\fi}
%\DeclareRobustCommand{\code}[1]{\codesize{\path{#1}}}
%%END LATEX
%%HEVEA \newcommand{\code}[1]{\codesize{\texttt{#1}}}
\def\<#1>{\code{#1}}

% This can't handle a URL with an embedded "#" -- at least at UW CSE
\newcommand{\myurl}[1]{{\codesize\url{#1}}}
%HEVEA \def\myurl{\url}
% A command that shows the URL in the printed manual.
% make a URL visible in PDF the but just be attached to anchor text in HTML:
%BEGIN LATEX
\newcommand{\ahreforurl}[2]{#2 (\url{#1})}
%END LATEX
%HEVEA \newcommand{\ahreforurl}[2]{\href{#1}{#2}}

\usepackage{listings}
\usepackage{alltt}
\usepackage{fancyvrb}
%BEGIN LATEX
\RecustomVerbatimEnvironment{Verbatim}{Verbatim}{fontsize=\codesize}
%END LATEX

\newenvironment{mysmall}
  {\ifhevea\makeatletter\@open{DIV}{style="font-size:small;"}\makeatother
   \else\begin{smaller}\fi}
  {\ifhevea\makeatletter\@close{DIV}\makeatother
   \else\end{smaller}\fi}
\newenvironment{myxsmall}
  {\ifhevea\makeatletter\@open{DIV}{style="font-size:x-small;"}\makeatother
   \else\begin{smaller}\begin{smaller}\fi}
  {\ifhevea\makeatletter\@close{DIV}\makeatother
   \else\end{smaller}\end{smaller}\fi}
\newenvironment{myxxsmall}
  {\ifhevea\makeatletter\@open{DIV}{style="font-size:xx-small;"}\makeatother
   \else\begin{smaller}\begin{smaller}\begin{smaller}\fi}
  {\ifhevea\makeatletter\@close{DIV}\makeatother
   \else\end{smaller}\end{smaller}\end{smaller}\fi}

%HEVEA \footerfalse    % Disable hevea advertisement in footer

\newcommand{\htmlhr}{\relax}
%HEVEA \renewcommand{\htmlhr}{\@hr{}{}}

% Problem with using "\newcommand" or "\renewcommand": Hevea writes this
% into manual.image.tex, and invokes LaTeX on it.  Sometimes running "make"
% leads to an error as a result, sometimes not.  I don't know the pattern
% of the failures, though running "make clean" and then "make" seems to
% work.  So maybe there's a problem with an auxiliary file.  Solve it by
% always defining \discretionary, so that \renewcommand works.
%HEVEA \def\discretionary{\relax}\renewcommand{\discretionary}[3]{\relax}

%HEVEA \newstyle{.lstframe}{margin:auto;margin-bottom:2em}

% Make images larger and thus less pixelated.  This is not really a solution.
%HEVEA\@addimagenopt{-mag 2000}
% This avoids Hevea's built-in conversion.
% The argument is the HEIGHT, not the width.
\newcommand{\includeimage}[2]{%
\begin{center}
\includeimagenocentering{#1}{#2}%
%BEGIN LATEX
\vspace{-1.5\baselineskip}
%END LATEX
\end{center}}

% The argument is the HEIGHT, not the width.
\newcommand{\includeimagenocentering}[2]{%
\ifhevea\imgsrc{#1.svg}\else%
\resizebox{!}{#2}{\includegraphics{figures/#1}}\fi}


% At least 80% of every float page must be taken up by
% floats; there will be no page with more than 20% white space.
\def\topfraction{.8}
\def\dbltopfraction{\topfraction}
\def\floatpagefraction{\topfraction}     % default .5
\def\dblfloatpagefraction{\topfraction}  % default .5
\def\textfraction{.2}


% Left and right curly braces and backslash, in tt font
\newcommand{\ttlcb}{\texttt{\char "7B}}
\newcommand{\ttrcb}{\texttt{\char "7D}}
\newcommand{\ttbs}{\texttt{\char "5C}}


%BEGIN LATEX
  %% Bring items closer together in list environments
  % Prevent infinite loops
  \let\Itemize =\itemize
  \let\Enumerate =\enumerate
  \let\Description =\description
  % Zero the vertical spacing parameters
  \def\Nospacing{\itemsep=0pt\topsep=0pt\partopsep=0pt\parskip=0pt\parsep=0pt}
  % Redefine the environments in terms of the original values
  \renewenvironment{itemize}{\Itemize\Nospacing}{\endlist}
  \renewenvironment{enumerate}{\Enumerate\Nospacing}{\endlist}
  \renewenvironment{description}{\Description\Nospacing}{\endlist}

  % Add line between figure and text
  \makeatletter
  \def\topfigrule{\kern3\p@ \hrule \kern -3.4\p@} % the \hrule is .4pt high
  \def\botfigrule{\kern-3\p@ \hrule \kern 2.6\p@} % the \hrule is .4pt high
  \def\dblfigrule{\kern3\p@ \hrule \kern -3.4\p@} % the \hrule is .4pt high
  \makeatother
%END LATEX


% Reference to Checker Framework Javadoc for a class (not a method, etc.).
% Arg 1: directory under org/checkerframework/, including internal "/", but
% no leading or trailing "/".
% Arg 2: class name.
% In the printed version, only the base class name appears.
% In the HTML version, it's a link to the Javadoc.
\newcommand{\refclass}[2]{\href{../api/org/checkerframework/#1/#2.html}{\<#2>}}

% Reference to Checker Framework Javadoc for a type qualifier/annotation class
% (not a method, etc.).  Like \refclass, but prepends an @ to the qualifier name.
\newcommand{\refqualclass}[2]{\href{../api/org/checkerframework/#1/#2.html}{\<@#2>}}

% Reference to Checker Framework Javadoc for a type qualifier/annotation class
% (not a method, etc.) that takes parameters.  This prepends an @ to the
% qualifier name and includes parentheses around the parameters.
\newcommand{\refqualclasswithparams}[3]{\href{../api/org/checkerframework/#1/#2.html}{\<@#2>}\<(\allowbreak #3)>}

% Reference to Checker Framework Javadoc for a method or field.).
% Arg 1: package name under org/checkerframework, using "/" as a separator,
% with no leading or trailing "/". example: "checker/nullness/qual"
% Arg 2: class name.
% Arg 3: method name.
% Arg 4: fully-qualified arguments.  Example: "(T)".  For Java 8, may need
% to use "-T-" with dashes instead of parentheses.
% In the printed version, only "class.method" appears.
% In the HTML version, it's a link to the Javadoc.
\newcommand{\refmethod}[4]{\href{../api/org/checkerframework/#1/#2.html\##3#4}{\<#2.#3>}}
% Omits the class name in the visible text; is terser.  Good for mentioning
% a method that needs to be overridden.
\newcommand{\refmethodterse}[4]{\href{../api/org/checkerframework/#1/#2.html\##3#4}{\<#3>}}
% Permits specification of the anchor text.  Good for mentioning the
% arguments of an overloaded method that needs to be overridden.
\newcommand{\refmethodanchortext}[5]{\href{../api/org/checkerframework/#1/#2.html\##3#4}{\<#5>}}
% Like refmethod, but formatted more concisely as ``field'' instead of
% ``Class.field''.  The last argument is usually empty {}.
\newcommand{\refenum}[4]{\href{../api/org/checkerframework/#1/#2.html\##3#4}{\<#3>}}

% Reference to Sun Javadoc.
% Arg 1: .html reference, without the .../api/ prefix
% Arg 2: What will appear in the formatted manual.
% Do not use \url in the body of any macro
\newcommand{\sunjavadoc}[2]{\href{https://docs.oracle.com/en/java/javase/11/docs/api/#1}{\<#2>}}
% Like \sunjavadoc, but for annotations and prepends "@".
\newcommand{\sunjavadocanno}[2]{\href{https://docs.oracle.com/en/java/javase/11/docs/api/#1}{\<@#2>}}
% Now, for Java EE (version 7 is the last version):
\newcommand{\javaeejavadoc}[2]{\href{https://docs.oracle.com/javaee/7/api/#1}{\<#2>}}
\newcommand{\javaeejavadocanno}[2]{\href{https://docs.oracle.com/javaee/7/api/#1}{\<@#2>}}


\newcommand{\refwithpage}[1]{\ref{#1}, page~\pageref{#1}}
%HEVEA \renewcommand{\refwithpage}[1]{\ref{#1}}
\newcommand{\refwithpageparen}[1]{\ref{#1} (page~\pageref{#1})}
%HEVEA \renewcommand{\refwithpageparen}[1]{\ref{#1}}
\newcommand{\chapterpageref}[1]{Chapter~\refwithpage{#1}}


\ifhevea
% Using a Unicode character avoids needing to use an image.  Unfortunately,
% this Unicode character is not installed on all computers, so use an image
% anyway.
% \newcommand{\linkicon}{{\small\@print@u{128279}}}
\newcommand{\linkicon}{\imgsrc[width="10" height="10"]{chainlink.svg}}
\newcommand{\selflink}[1]{\if@refs\ \ahrefloc{#1}{\linkicon}\fi}
\newcommand{\mksectionAndLabel}[1]
{\newcommand{\csname #1AndLabel\endcsname}[2]
{\csname #1\endcsname{##1\label{##2}\selflink{##2}}}}
\mksectionAndLabel{chapter}
\mksectionAndLabel{section}
\mksectionAndLabel{subsection}
\mksectionAndLabel{subsubsection}
\mksectionAndLabel{paragraph}
\else
\newcommand{\selflink}[1]{}
\newcommand{\chapterAndLabel}[2]{\chapter{#1}\label{#2}}
\newcommand{\sectionAndLabel}[2]{\section{#1}\label{#2}}
\newcommand{\subsectionAndLabel}[2]{\subsection{#1}\label{#2}}
\newcommand{\subsubsectionAndLabel}[2]{\subsubsection{#1}\label{#2}}
\newcommand{\paragraphAndLabel}[2]{\paragraph{#1}\label{#2}}
\fi

%  LocalWords:  fontsize mysmall myxsmall myxxsmall subsubsection