-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtufte-book-local.tex
290 lines (238 loc) · 10.3 KB
/
tufte-book-local.tex
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
\RequirePackage{etoolbox}
\makeatletter
\newif\if@tufte@margtab\@tufte@margtabfalse
\AtBeginEnvironment{margintable}{\@tufte@margtabtrue}
\AtEndEnvironment{margintable}{\@tufte@margtabfalse}
\newcommand{\classiccaptionstyle}{%
\long\def\@caption##1[##2]##3{%
\par
\addcontentsline{\csname ext@##1\endcsname}{##1}%
{\protect\numberline{\csname the##1\endcsname}{\ignorespaces ##2}}%
\begingroup
\@parboxrestore
\if@minipage
\@setminipage
\fi
\normalsize
\@makecaption{\csname fnum@##1\endcsname}{\ignorespaces ##3}\par
\endgroup}
\long\def\@makecaption##1##2{%
\vskip\abovecaptionskip
\sbox\@tempboxa{\@tufte@caption@font##1: ##2}%
\ifdim \wd\@tempboxa >\hsize
\@tufte@caption@font\if@tufte@margtab\@tufte@caption@justification\fi##1: ##2\par
\else
\global \@minipagefalse
\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}
\setcaptionfont{\normalfont}
\let\caption\@tufte@orig@caption%
\let\label\@tufte@orig@label}
\makeatother
\usepackage{newfloat}
\DeclareFloatingEnvironment[
fileext=los,
listname={List of Surveys},
name=Survey,
placement=tbhp,
within=none,
]{survey}
\newenvironment{pagesurvey}{% This enables the full width captions.
\protect\begin{survey*}[b]
\classiccaptionstyle
}{\protect\end{survey*}}
\DeclareFloatingEnvironment[
fileext=lom,
listname={List of Maps},
name=Map,
placement=tbhp,
within=none,
]{map}
\newenvironment{pagemap}{% This enables the full width captions.
\protect\begin{map*}[b]
\classiccaptionstyle
}{\protect\end{map*}}
%____________________ MORE FORMATTING OPTIONS
%indexing the passage names and highlighting them in some way the new command is simply \passage{}
%If using passage in the caption environment - \protect\passage{} will work.
%THis also takes an optional argument \passage[detail]{name} if you want to refer to e.g. Primadona abseil, instead of cave, or entrance in the index.
%Also, you can use \passage[|see{other}]{name} if you really want something specific like Mig see --Migovec for instance
\newcommand{\name}[1]{\vskip1ex\nopagebreak{\raggedleft\large\sffamily\textbf{#1}\par \vskip1ex} \index[aut]{#1|BH} \rmfamily}
\newcommand{\figref}[1]{(Figure \protect\vref{#1})}
\newcommand{\mapref}[1]{(Map \protect\vref{#1})}
\newcommand{\survref}[1]{(Survey \protect\vref{#1})}
\newcommand{\figpageref}[1]{(Figure \protect\ref{#1} on page \protect\pageref{1})}
\definecolor{thirdblue}{cmyk}{0.97, 0.28, 0, 0.71}
%A handy little command which takes inline text as argument and copies it in the margin as a snippet. Useful to highlight stuff and fill margins
\newcommand{\bignote}[1]{\marginnote{\sffamily\normalsize{\textmd{\textit{\flushleft{\textcolor{thirdblue}{...#1...}}}}}%
\rmfamily}#1}
%Use mininame for authors in margin only tikzboxes, otherwise linespacing was changed by the larger font names.
\newcommand{\mininame}[1]{\vskip2ex\nopagebreak{\raggedleft\footnotesize\sffamily\textbf{#1}\par} \index[aut]{#1|BH} \rmfamily}
\renewcommand{\emph}[1]{\textit{#1}}
%If caption runs at bottom of page - use pagefigure environment instead of figure* !
\newenvironment{pagefigure}{% This enables the full width captions.
\protect\begin{figure*}[b]
\classiccaptionstyle
}{\protect\end{figure*}}
%_____________________Definition of the color box environment for the main title pages...
\usepackage[most]{tcolorbox}
\tcbset{ frame code={}
center title,
left=10pt,
right=10pt,
top=-50pt,
bottom=10pt,
colback=white,
colframe=white,
width=\dimexpr\textwidth\relax,
enlarge left by=0mm,
boxsep=5pt,
arc=0pt,outer arc=0pt,
opacityback=0.7
}
%__________________Definition of the Tikz environments for side stories and fancy tables
\usepackage{tikz}
\usetikzlibrary{shapes,snakes}
\tikzstyle{recipe} = [ draw=thirdblue!80,
fill=thirdblue!20,
thick,
rectangle,
rounded corners,
inner sep=5pt,
inner ysep=10pt
]
\tikzstyle{recipe-title} = [ font=\sffamily\large,
fill=thirdblue,
text=white
]
\tikzstyle{recipe-logo} = [ font=\sffamily\large,
fill=thirdblue,
rectangle,
rounded corners,
draw = thirdblue
]
\tikzstyle{logbook-logo} = [ font=\sffamily\large,
fill=bettergrey,
rectangle,
rounded corners,
draw = bettergrey
]
\newcommand{\ladle}{\protect\includegraphics[height = 4ex]{images/little_insets/ladle.png}}
\newcommand{\logbook}{\protect\includegraphics[height = 4ex]{images/little_insets/logbook.png}}
\newcommand{\explo}{\protect\includegraphics[height = 4ex]{images/little_insets/helmet.png}}
\newcommand{\calc}{\protect\includegraphics[height = 4ex]{images/little_insets/calc.png}}
\newcommand{\dig}{\protect\includegraphics[height = 4ex]{images/little_insets/dig.png}}
\newcommand{\note}{\raisebox{-1ex}{\protect\includegraphics[height = 5ex]{images/little_insets/notes.png}} \qquad}
\newcommand{\enote}{\qquad \raisebox{-1ex}{\protect\includegraphics[height = 5ex]{images/little_insets/notes2.png}}}
\newcommand{\pic}[1]{\raisebox{-0.2em}{\protect\includegraphics[height = 2ex]{images/little_insets/pic.png}}~\hskip0.15em \emph{#1}\relax}
\newcommand{\pen}[1]{\raisebox{-0.2em}{\protect\includegraphics[height = 2ex]{images/little_insets/pen.png}}~\emph{#1}\relax}
\newcommand{\recipecorner}[2]{
\begin{marginfigure}
\begin{tikzpicture}
\node [recipe] (box){%
\begin{minipage}{0.9\textwidth}
\vspace{5pt}
\sffamily\textcolor{thirdblue!}{#2}
\end{minipage}
};
\node[recipe-title, right=30pt] at (box.north west) {#1};
\node[recipe-logo, right=5pt] at (box.north west) {\ladle};
\end{tikzpicture}
\end{marginfigure}
}
\tikzstyle{name-dest} = [ draw=bettergrey!80,
fill=bettergrey!20,
thick,
rectangle,
rounded corners,
inner sep=5pt,
inner ysep=10pt
]
\tikzstyle{fancytitle} = [ font=\sffamily\large,
fill=bettergrey,
text=white
]
\tikzstyle{table} = [ draw={thirdblue!80},
fill={thirdblue!20},
thick,
rectangle,
rounded corners,
inner sep=5pt,
inner ysep=10pt
]
\tikzstyle{tabletitle} = [ font=\sffamily\large,
fill={thirdblue},
text=white
]
\newcommand{\numbertable}[1]{
\begin{figure*}[h!]
\begin{tikzpicture}
\node [table] (box){%
\begin{minipage}{\textwidth}
\centering
\vspace{5pt}
#1
\end{minipage}
};
\node[tabletitle, right=30pt] at (box.north west) {Number Crunching};
\node[recipe-logo, right=5pt] at (box.north west) {\calc};
\end{tikzpicture}
\end{figure*}
}
\newcommand{\margininbox}[3]{
\begin{marginfigure}
\begin{tikzpicture}
\node [name-dest] (box){%
\begin{minipage}{0.95\textwidth}
\vspace{5pt}
\normalsize{#2}
\end{minipage}
};
\node[fancytitle, right=30pt] at (box.north west) {#1};
\node[logbook-logo, right = 5pt] at(box.north west) {\protect#3};
\end{tikzpicture}
\end{marginfigure}
}
\newcommand{\fullwidthbox}[2]{
\begin{figure*}[t!]
\begin{tikzpicture}
\node [name-dest] (box){%
\begin{minipage}{\textwidth}
\vspace{5pt}
\begin{multicols}{2}
#2
\end{multicols}
\end{minipage}
};
\node[fancytitle, right=30pt] at (box.north west) {#1};
\node[logbook-logo, right = 5pt] at(box.north west) {\logbook};
\end{tikzpicture}
\end{figure*}
}
%__________________End of the definition of: Tikz environments for side stories and fancy tables
%____________________THE TWO PAGE BACKGROUND MACRO (from:https://tex.stackexchange.com/questions/23860/how-to-include-a-picture-over-two-pages-left-part-on-left-side-right-on-right).
\usepackage{adjustbox}
\usepackage{afterpage}
\usepackage{placeins}
\setcounter{totalnumber}{1}
\setcounter{topnumber}{1}
\setcounter{bottomnumber}{1}
\renewcommand{\topfraction}{.99}
\renewcommand{\bottomfraction}{.99}
\renewcommand{\textfraction}{.01}
\newcommand*\cleartoleftpage{%
\clearpage
\ifodd\value{page}\hbox{}\newpage\fi
}
\fancypagestyle{endchapter}{%
\fancyhf{}% Clear header/footer
\fancyfoot[OR]{\textbf{\thepage}}%
\fancyfoot[EL]{\textbf{\thepage}}%
\renewcommand{\headrulewidth}{0pt}%
}
%changing the spacing of itemize (also ...)
\usepackage{enumitem}
\newcommand{\localtextbulletone}{\textcolor{bettergrey}{\raisebox{.45ex}{\rule{.6ex}{.6ex}}}}
\renewcommand{\labelitemi}{\localtextbulletone}
\newenvironment{citemize}{\begin{itemize}[itemsep=0.25ex,leftmargin=0.5cm, rightmargin=0.5cm, label=\localtextbulletone]}{\end{itemize}}