]> matita.cs.unibo.it Git - helm.git/blob - helm/papers/matita/ed.sty
ocaml 3.09 transition
[helm.git] / helm / papers / matita / ed.sty
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 % Editorials
3
4 % the font shape of ednotes is governed by the parameter \ednoteshape
5 % the default is sans serif, specialize it to say italic by 
6 % \def\ednoteshape{\it}
7 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8 \usepackage{verbatim}
9 \def\ednoteshape{\sf}
10 \newif\ifshowednotes\showednotesfalse
11 \def\edshownotes{\showednotestrue}
12 \DeclareOption{show}{\showednotestrue}
13 \DeclareOption{hide}{\showednotesfalse}
14 \ProcessOptions
15
16 \newcounter{ednote}
17 \def\ed@foot#1#2#3% text, type, label
18 {\def\test{#3}\def\empty{}\footnotetext[\value{ednote}]%
19 {{\sc{#2}\if\test\empty\else\label{ed:#3}[{#3}]\fi:} \ednoteshape #1}}
20 \def\ed@note#1#2#3% text, type, label
21 {\addtocounter{ednote}{1}\message{#2!}%
22 \ifshowednotes%
23 \footnotemark[\arabic{ednote}]\ed@foot{#1}{#2}{#3}%
24 \marginpar{#2(\arabic{ednote})}%
25 \fi}
26 \newcommand{\ednote}[2][]{\ed@note{#2}{}{#1}}
27 \newcommand{\issue}[2][]{\ed@note{#2}{}{#1}}
28 \newenvironment{newpart}[1]% text
29 {\addtocounter{ednote}{1}\edef\new@number{\theednote}\message{New Part!\new@number}
30 \ifshowednotes\ed@foot{#1}{New Part}{}\marginpar{BegNP(\new@number)}\fi}
31 {\ifshowednotes\marginpar{EndNP(\new@number)}\fi}
32
33 \def\ednotemessage{\ifnum\value{ednote}>0\typeout{}%
34 \typeout{There are still \arabic{ednote} EdNotes and Issues to resolve!}%
35 \typeout{}\fi}
36
37 \ifshowednotes
38 \def\todolist#1{\message{todolist!}%
39 {{\sf To Do: #1}}\bgroup\sf\marginpar{{\sf ToDo}}\begin{itemize}}
40 \def\endtodolist{\end{itemize}\egroup}
41 \else\def\todolist#1{\comment}\def\endtodolist{\endcomment}\fi
42
43 \newenvironment{neu}{\begin{newpart}{no explanation given}}{\end{newpart}}
44
45 \def\tweak#1{\ifshowednotes\marginpar{{\sf tweak}(#1)}\fi}
46
47
48 \def\df#1{\bf{#1}}
49 \def\dfi#1{\bf{\index*{#1}}}
50 \def\defemph{\textbf}
51 \def\defin#1{\defemph{\index*{#1}}}
52 \def\defins#1{\defemph{#1s}\index{#1}}
53 \def\emin#1{\em{\index*{#1}}\/}
54 \def\emins#1{{\em{#1s}\/}\index{#1}}
55 \def\edin#1{\index*{#1}}
56 \def\edins#1{\index*{#1}s}
57 \def\ttin#1{{\tt{#1}}\index{#1@{\tt{#1}}}}
58 \def\ttins#1{{\tt{#1}}s\index{#1@{\tt{#1}}}}
59
60 \newenvironment{myfig}[2]%
61 {\begin{figure}[!htb]\def\myfiglabel{#1}\def\myfigcaption{{#2}}\begin{center}}
62 {\caption{\myfigcaption}\label{fig:\myfiglabel}\end{center}\end{figure}}
63 \def\myfigref#1{Figure~\ref{fig:#1}}
64 \def\myfigsref#1#2{Figures~\ref{fig:#1} and~\ref{fig:#2}}
65 \def\myfiglref#1#2{Figures~\ref{fig:#1} to~\ref{fig:#2}}
66 \def\Myfigref#1{Figure~\ref{fig:#1}}  % this one is capitalized for sentence beginnings