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