forked from ProofSystem/Encyclopedia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
commands.sty
174 lines (153 loc) · 4.99 KB
/
commands.sty
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
\RequirePackage{fancybox}
\newcommand{\myline}{\noindent\makebox[\linewidth]{\rule{\textwidth}{0.4pt}}}
\newcommand{\includeProofSystem}[1]{\input{mainmatter/#1}}
\newcommand{\iref}[1]{\{\ref{entry:#1}\}}
\newcommand{\irefmissing}[1]{}
\let\@calculusName\@empty
\let\@calculusAcronym\@empty
\let\@calculusLogic\@empty
\let\@calculusType\@empty
\let\@calculusAuthor\@empty
\let\@calculusYear\@empty
\let\@entryAuthor\@empty
\let\@entryTitle\@empty
\newcommand{\calculusName}[1]{\gdef\@calculusName{#1}}
\newcommand{\calculusAcronym}[1]{{\gdef\@calculusAcronym{#1}}}
\newcommand{\calculusLogic}[1]{{\gdef\@calculusLogic{#1}}}
\newcommand{\calculusType}[1]{{\gdef\@calculusType{#1}}}
\newcommand{\calculusAuthor}[1]{\gdef\@calculusAuthor{#1}}
\newcommand{\calculusYear}[1]{\gdef\@calculusYear{#1}}
\newcommand{\entryTitle}[1]{\gdef\@entryTitle{#1}}
\newcommand{\entryAuthor}[1]{\gdef\@entryAuthor{#1}}
% ToDo: this is the command for open tags.
% Right now it does nothing. Eventually is should update indexes.
\newcommand{\tag}[1]{}
\renewcommand\maketitle{\par
\title{\@entryTitle}
\author{\@entryAuthor}
\stepcounter{section}%
\setcounter{section}{0}%
\setcounter{subsection}{0}%
\setcounter{figure}{0}
\setcounter{table}{0}
\setcounter{equation}{0}
\setcounter{footnote}{0}%
\if@numart
\stepcounter{chapter}%
\addtocounter{chapter}{-1}%
\else
\refstepcounter{chapter}%
\fi
\stepcounter{contribution}%
\immediate\write\@auxout{\string\immediate\string\closeout\string\minitoc}%
\immediate\write\@auxout{\let\MiniTOC=N}%
% try to be hyperref-compatible
\csname phantomsection\endcsname
\begingroup
\parindent=\z@
%%%%%%%%% \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
%
\renewcommand\thefootnote{\@fnsymbol\c@footnote}%
\def\@makefnmark{$^{\@thefnmark}$}%
\renewcommand\@makefntext[1]{%
\noindent
\hb@xt@\bibindent{\hss\@makefnmark\enspace}##1\vrule height0pt
width0pt depth8pt}
%
\newpage
\global\@topnum\z@ % Prevents figures from going at top of page.
\@maketitle
\@ifundefined{thispagecropped}{}{\thispagecropped}
\thispagestyle{bchap}\@thanks
%
\def\\{\unskip\ \ignorespaces}\def\inst##1{\unskip{}}%
\def\thanks##1{\unskip{}}\def\fnmsep{\unskip}%
\instindent=\hsize
\advance\instindent by-\headlineindent
\if@numart % keine Nummer
\if!\the\toctitle!\addcontentsline{toc}{title}{\@title}\else
\addcontentsline{toc}{title}{\the\toctitle}\fi
\else
\if!\the\toctitle!\addcontentsline{toc}{titlech}{\protect\numberline{\thechapter\thechapterend}\@title}\else
\addcontentsline{toc}{titlech}{\protect\numberline{\thechapter\thechapterend}\the\toctitle}\fi
\fi
\if@runhead
\if!\the\titlerunning!\else
\edef\@title{\the\titlerunning}%
\fi
\global\setbox\titrun=\hbox{\small\rm\unboldmath\if@numart\else
\@seccntformat{chapter}\fi
\ignorespaces\@title}%
\ifdim\wd\titrun>\instindent
\typeout{Title too long for running head. Please supply}%
\typeout{a shorter form with \string\titlerunning\space prior to
\string\maketitle}%
\global\setbox\titrun=\hbox{\small\rm
Title Suppressed Due to Excessive Length}%
\fi
\xdef\@title{\copy\titrun}%
\fi
%
\endgroup
% \setcounter{footnote}{0}% footnote starts at (\inst+1)
\@afterindentfalse\@afterheading
\clearheadinfo}
%
\def\@maketitle{\newpage
\markboth{}{}%
\def\lastand{\ifnum\value{@inst}=2\relax
\unskip{} \andname\
\else
\unskip \lastandname\
\fi}%
\def\and{\stepcounter{@auth}\relax
\ifnum\value{@auth}=\value{@inst}%
\lastand
\else
\unskip,
\fi}%
\raggedright
{\chapnumsize
\chapnumstyle
\pretolerance=10000
\let\\=\newline
% \@hangfrom{\@svsec}%
%%% \@svsec
\raggedright
\hyphenpenalty \@M
\interlinepenalty \@M
\ignorespaces
\chapsize
\chapstyle
\@entryTitle \ (\@calculusYear)
\footnote[0]{\hspace{-13pt} Entry {\thechapter} by: \@entryAuthor}
\par}
\setbox0=\vbox{\setcounter{@auth}{1}\def\and{\stepcounter{@auth}}%
\def\thanks##1{}\@author}%
\global\value{@inst}=\value{@auth}%
\global\value{auco}=\value{@auth}%
\setcounter{@auth}{1}%
{%\lineskip .5em
\noindent\ignorespaces
% \@author\vskip.35cm
}
}
\newenvironment{entry}[1]
{\label{entry:#1}\begin{refsection}[#1]}
{\updateindex\myline\printbibliography[heading=none]\end{refsection}}
\newenvironment{calculus}
{\begin{center}\begin{Sbox}\begin{minipage}{0.98\textwidth}}
{\end{minipage}\end{Sbox}\fbox{\TheSbox}\end{center}}
\newenvironment{clarifications}
{\noindent\textbf{Clarifications:}}
{\smallskip}
\newenvironment{history}
{\noindent\textbf{History:}}
{\smallskip}
\newenvironment{technicalities}
{\noindent\textbf{Remarks:}}
{\smallskip}
\newcommand{\updateindex}{
\index{logics}{\@calculusLogic}
\index{ctypes}{\@calculusType!\@calculusName}
}