macros.tex 2.18 KB
Newer Older
1

2
%\newcommand{\todo}[1]{{\Huge\bfseries TODO: #1}}
3

MARCHE Claude's avatar
MARCHE Claude committed
4
\newcommand{\why}{\textsf{Why3}\xspace}
5
\newcommand{\whyml}{\textsf{WhyML}\xspace}
6
\newcommand{\eg}{\emph{e.g.}\xspace}
7
\newcommand{\ie}{\emph{i.e.}\xspace}
8
\newcommand{\opam}{\textsf{OPAM}\xspace}
MARCHE Claude's avatar
MARCHE Claude committed
9

MARCHE Claude's avatar
MARCHE Claude committed
10 11 12
\newcommand{\emptyitem}{%
%BEGIN LATEX
~
13
%END LATEX
MARCHE Claude's avatar
MARCHE Claude committed
14
}
15

MARCHE Claude's avatar
MARCHE Claude committed
16
% BNF grammar
17
\newcommand{\keyword}[1]{\texttt{#1}}
MARCHE Claude's avatar
MARCHE Claude committed
18 19 20 21
\newcommand{\indextt}[1]{\index{#1@\protect\keyword{#1}}}
\newcommand{\indexttbs}[1]{\index{#1@\protect\keywordbs{#1}}}
\newif\ifspace
\newif\ifnewentry
Andrei Paskevich's avatar
Andrei Paskevich committed
22
\newcommand{\addspace}{\ifspace \: \spacefalse \fi}
23
\newcommand{\term}[2]{\addspace\mbox{\lstinline|#1|%
MARCHE Claude's avatar
MARCHE Claude committed
24 25 26
\ifthenelse{\equal{#2}{}}{}{\indexttbase{#2}{#1}}}\spacetrue}
\newcommand{\nonterm}[2]{%
  \ifthenelse{\equal{#2}{}}%
27 28
             {\addspace\mbox{\textsl{#1}\ifnewentry\index{#1@\textsl{#1}}\fi}\spacetrue}%
             {\addspace\mbox{\textsl{#1}\footnote{#2}\ifnewentry\index{grammar entries!\textsl{#1}}\fi}\spacetrue}}
MARCHE Claude's avatar
MARCHE Claude committed
29 30 31 32 33 34 35 36 37
\newcommand{\repetstar}{$^*$\spacetrue}
\newcommand{\repetplus}{$^+$\spacetrue}
\newcommand{\repetone}{$^?$\spacetrue}
\newcommand{\lparen}{\addspace(}
\newcommand{\rparen}{)}
\newcommand{\orelse}{\addspace$\mid$\spacetrue}
\newcommand{\sep}{ \\[2mm] \spacefalse\newentrytrue}
\newcommand{\newl}{ \\ & & \spacefalse}
\newcommand{\alt}{ \\ & $\mid$ & \spacefalse}
38
\newcommand{\is}{ & $::=$ & \spacefalse\newentryfalse}
MARCHE Claude's avatar
MARCHE Claude committed
39 40 41 42
\newenvironment{syntax}{\begin{tabular}{@{}rrll@{}}\spacefalse\newentrytrue}{\end{tabular}}
\newcommand{\synt}[1]{$\spacefalse#1$}
\newcommand{\emptystring}{$\epsilon$}
\newcommand{\below}{See\; below}
43

44 45
%%% listings for Why3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

46

MARCHE Claude's avatar
MARCHE Claude committed
47 48
% cannot use \usepackage here because it breaks hevea (no colored keywords anymore :-()
\input{../share/latex/why3lang.sty}
49 50 51

% \RequirePackage{listings}
% \RequirePackage{amssymb}
52

53 54 55 56 57 58 59 60 61 62
\lstset{
  basicstyle={\ttfamily},
  framesep=2pt,
  frame=single,
  keywordstyle={\color{blue}},
  stringstyle=\itshape,
  commentstyle=\itshape,
  columns=[l]fullflexible,
  showstringspaces=false,
}
63

64
\lstnewenvironment{whycode}{\lstset{language=why3}}{}
65
\lstnewenvironment{ocamlcode}{\lstset{language={[Objective]Caml}}}{}
66

MARCHE Claude's avatar
MARCHE Claude committed
67
%%% Local Variables:
68
%%% mode: latex
MARCHE Claude's avatar
MARCHE Claude committed
69
%%% TeX-master: "manual"
MARCHE Claude's avatar
MARCHE Claude committed
70 71
%%% TeX-PDF-mode: t
%%% End: