forked from rzach/forallx-yyc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforallxdo-style.sty
191 lines (157 loc) · 7.31 KB
/
forallxdo-style.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
%!TEX root = forallxdo.tex
% forallxdo-style provides layout and style setup for forall x: do books
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{forallxdo-style}
\def\forallxversion{Winter 2021}
\def\forallxshortversion{W21}
\RequirePackage{hyperref,ifthen,graphicx,xcolor,amssymb}
\usepackage[numbered]{bookmark} %TB: added for speedy navigation
\usepackage[nonumberlist,toc,style=index]{glossaries}
\makeglossaries
\usepackage{tabu}
%RZ: typefaces
\usepackage{helvet}
\usepackage[osf]{Baskervaldx} % oldstyle figures
\usepackage[bigdelims,baskervaldx]{newtxmath}
%RZ: Make sure we have a copyright symbol
\def\copyright{\textcircled{C}}
%RZ: Include git revision info
% \usepackage{gitinfo2}
% RZ: TOC widths
\setlength{\cftpartnumwidth}{3em}
\setlength{\cftchapternumwidth}{2.2em}
\setlength{\cftsectionnumwidth}{3.3em}
\setlength{\cftbeforechapterskip}{0pt} %TB: to leave no gap between sections (which LaTeX regards as chapters) in the TOC
\renewcommand{\cftchapterfont}{\textrm}
\renewcommand{\cftchapterpagefont}{\textrm}
% Chapter style
\newlength{\barlength}
\setlength{\barlength}{400pt}
\makechapterstyle{leadbeater}{%
\setlength{\afterchapskip}{40pt}
\setlength{\beforechapskip}{50pt}
\setlength{\midchapskip}{10pt}
\renewcommand*{\afterchapternum}{\par\nobreak\vskip 0pt}
\renewcommand*{\chapnamefont}{\fontsize{14pt}{0pt}\selectfont\sffamily\bfseries}
\renewcommand*{\chapnumfont}{\fontsize{14pt}{0pt}\selectfont\sffamily\bfseries}
\renewcommand*{\chaptitlefont}{\normalfont\fontsize{28pt}{28pt}\selectfont\bfseries\itshape\color{leadbeater}}
\renewcommand*{\printchaptername}{%
\chapnamefont\MakeUppercase{\@chapapp}}
\renewcommand*{\printchaptertitle}[1]{%
\chaptitlefont ##1\\[-\baselineskip]%
\hspace*{-20pt}%
\smash{\color{leadbeater}\rule{7pt}{\barlength}}}
}
\renewcommand*{\partnamefont}{\fontsize{16pt}{0pt}\selectfont\sffamily\bfseries}
\renewcommand*{\partnumfont}{\fontsize{16pt}{0pt}\selectfont\sffamily\bfseries}
\renewcommand*{\parttitlefont}{\normalfont\fontsize{32pt}{32pt}\selectfont\bfseries\itshape\color{leadbeater}}
\renewcommand*{\printpartname}{%
\partnamefont TEIL}
\chapterstyle{leadbeater}
\copypagestyle{leadbeater}{headings}
\makeoddhead{leadbeater}{\small\sffamily\color{leadbeater}\rightmark}{}
{\color{leadbeater}\sffamily\bfseries\thepage}
\makeevenhead{leadbeater}{\small\sffamily\color{leadbeater}\leftmark}{}
{\color{leadbeater}\sffamily\bfseries\thepage}
\usepackage[font={small,it}]{caption}
% ****************************************
% * TITLE AND VERSION DATA *
% ****************************************
% the title of the book
\newcommand*{\forallx}{\texttt{forall}\script{x}}
\newcommand*{\forallxyyc}{\texttt{forall}\script{x}\texttt{:Calgary}}
% The version number of the book is a 5 digit integer:
% the last digit of the year, the month, the day of the month
\newcounter{dummy}
\setcounter{dummy}{\year}
\addtocounter{dummy}{-2000}
\newcommand*{\bookversion}{%
\ifthenelse{\arabic{dummy}<10}{0}{}%
\arabic{dummy}%
\ifthenelse{\month<10}{0}{}\number\month%
\ifthenelse{\day<10}{0}{}\number\day%
}
% Used in conjunction with {earg}, this handles the numbering and
% references to example sentences:
\newcounter{Example}[chapter]
\newcommand*{\ex}[1]{\refstepcounter{Example}\arabic{Example}.\label{#1}}
% Used in specifying partial models, this keeps the lines justified so
% so that the = signs all line up. For example:
% \begin{partialmodel}
% UD & \{Duke, Miles\}\\
% \extension{B} & \{Duke\}
% \end{partialmodel}
\newenvironment{partialmodel}{\par\begin{tabular}{r@{~=~}l}}{\end{tabular}\par}
% define the bullet for {itemize} lists
\renewcommand{\labelitemi}{$\triangleright$}
% \factoidbox{...} produces an inset paragraph of text with a line around it
% Neither for lists nor an environment, but it really didn't
% belong anywhere else.
\usepackage{tcolorbox}
\newcommand{\factoidbox}[1]{\begin{factoidboxe}#1\end{factoidboxe}}
\newenvironment{factoidboxe}{%
\begin{tcolorbox}[%width=.9\textwidth,
% leftright skip=.05\textwidth,
sharp corners=downhill,
beforeafter skip=.7em,
colframe={leadbeater},colback={vltleadbeater}]}{
\end{tcolorbox}}
% \tablefbox{...} is used in certain tables to put a box around the contents of specific table cells without having lines that run the whole length of the table
\newcommand{\tablefbox}[1]{\multicolumn{1}{|p{10em}|}{#1}}
% ****************************************
% * PRACTICE PROBLEMS *
% ****************************************
\newcounter{ProbPart}
\renewcommand{\theProbPart}{\Alph{ProbPart}}
\renewcommand{\theHProbPart}{\thechapter.\theProbPart}
% This inserts a heading and resets the counter:
\newcommand*{\practiceproblems}{
\setcounter{ProbPart}{0}\section*{Übungen}%
\sectionmark{Übungen}%
\addcontentsline{toc}{section}{Übungen}
}
% This starts a new section which is automatically numbered:
\newcommand*{\problempart}{\par\noindent\refstepcounter{ProbPart}\textbf{\Alph{ProbPart}. }}
% This bullet is used to indicate that solutions appear at the end of
% the book.
\newcommand*{\solutions}{} %TB: removed, since I am not including the solutions in the book
% When solutions are only given for selected problems, the
% star is placed left of the problem number.
\newcommand*{\leftsolutions}{\hspace{-2.2em}\makebox[2em][l]{\solutions}}
% This is used at the beginning of a section in the solutions
% appendix.
\newcommand*{\solutionsection}[2]{%
\textbf{\textsc{Chapter {\ref{#1}} Part {\ref{#2}}}}%
\markright{solutions for ch.~\ref{#1}}%
\setcounter{countSeq}{0}
}
% This is used to enumerate things that have a given property.
% For example: \nextSeq\nextSeq\noSeq\lastSeq are valid.
% produces : 1, 2, and 4 are valid.
\newcounter{countSeq}
\newcommand*{\nextSeq}{\stepcounter{countSeq}\arabic{countSeq}, }
\newcommand*{\noSeq}{\stepcounter{countSeq}}
\newcommand*{\lastSeq}{and \stepcounter{countSeq}\arabic{countSeq} }
% This is used to place (eg) a partial model or proof as an item
% in a list. Without it, the item tag will be vertically centered next
% to the model or proof.
% --- doesn't actually work yet ---
\newenvironment{solutioninlist}{}{}%{~\vspace{-1.6em}}{}
% ****************************************
% * TABLE OF CONTENTS, ETC. *
% ****************************************
\renewcommand{\thechapter}{\arabic{chapter}}
\renewcommand{\thepart}{\Roman{part}}
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}
\setcounter{tocdepth}{0} %TB: only chapters and sections to appear
\setlength{\columnsep}{2em} % Sets 2em space between columns when calling multicol
\definecolor{darkred}{rgb}{0.5,0,0} % TB: used to color links in red
\newcommand\myanswer[1]{\textcolor{leadbeater}{#1}} % TB: puts model answers in blue
% TB: information originally in the main body; but it is style information, so I have included it here.
\hypersetup{pdfinfo={Title={forall x: Dortmund}, Author={P.D. Magnus, Tim Button, J. Rob Loftis, Rob Trueman, Aaron Thomas-Bolduc, Richard Zach, Simon Wimmer}, Subject={Eine open access Einführung in die formale Logik}, Keywords={wahrheitsfunktionale Logik, Aussagenlogik, Prädikatenlogik, Logik erster Ordnung, Natürliche Herleitung, Fitch}}, %
% bookmarks={true}, %
bookmarksopen = true,
colorlinks={true}, %
allcolors={dkleadbeater},
pdfdisplaydoctitle={true}}
\urlstyle{same}