-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCalculus-Text.tex
449 lines (353 loc) · 12.3 KB
/
Calculus-Text.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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
\documentclass[12pt]{book}
% allow more floats to be processed
\extrafloats{100}
% For the font
%\usepackage{mathptmx}
\usepackage[T1]{fontenc}
\usepackage[EULERGREEK]{sansmath}
% Allows files from different parent directories to be included, and is used in making adaptations.
\usepackage{import}
\providecommand{\mybuildpath}{./}
% To prevent ! No room for a new \dimen ERROR. WHY DOES THIS HAPPEN AT ALL????
\usepackage{etex}\reserveinserts{28}
% Make it look more like the Word docs
\setlength{\parskip}{\baselineskip}
\setlength{\parindent}{0pt}
% Various math packages
\usepackage{amsmath,amsfonts,amsthm,amssymb}
% For colouring various things
\usepackage{xcolor}
\usepackage{textcomp} % to use \textcent to make cent symbol
\def\cents{\makebox[0cm][l]{\rule{.47ex}{0mm}\rule[-.3ex]{.15mm}{1.6ex}}c}
% Simple arithmetic
\usepackage{calc}
% Conditional statements
\usepackage{ifthen}
% Page layout
\ifthenelse{\equal{\detokenize{interior}}{\jobname}}{
\usepackage[headheight=15pt,top=1in, bottom=0.75in, outer=0.65in, inner=0.85in]{geometry}
}{
\usepackage[headheight=15pt,top=1in, bottom=0.75in, outer=0.75in, inner=0.75in]{geometry}
}
% Captions for objects
\usepackage[format=hang,font=bf]{caption}
% Defines command \sfrac for inline fractions
\usepackage{xfrac}
% For multicolumn cells in text
\usepackage{multicol}
% If you want to generate an index, automatically
\usepackage{makeidx}
\makeindex
% If you want to include postscript graphics
\usepackage{graphicx}
% For including eps graphic files
\usepackage{epsfig}
% for low-level font commands, and drawing simple pictures. Relics from Guichard code, will be phased out with Tikz
\usepackage{rawfonts,pictex}
% Hyperlinks
\usepackage{hyperref}
% For customizing lists
\usepackage{enumerate} % the better package is enumitem, but does not compile currently
% For more options to format columns in array and tabular environments
\usepackage{array}
% Creates coloured boxes for Examples, Definitions & Theorems
\usepackage{tcolorbox}
\tcbuselibrary{theorems,breakable}
% For more caption features.
\usepackage{float}
% Used on the titlepage
\usepackage{pagecolor}
\usepackage{afterpage}
% To remove headers and footers from truly empty pages
\usepackage{emptypage}
\usepackage{longtable}
% Draw images and figures
\usepackage{tikz}
\usetikzlibrary{arrows,3d,calc,intersections,shapes.callouts}
\usetikzlibrary{decorations.text}
\usetikzlibrary{positioning}
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{shadows}
\usetikzlibrary{backgrounds}
%\usetikzlibrary{angles,quotes,decorations.markings,patterns}
% For plotting data
\usepackage{pgfplots}
\pgfplotsset{colormap={coloronemap}{rgb=(.4,.4,1); rgb=(.8,.8,1)}}
\pgfplotsset{colormap={colortwomap}{rgb=(1,.4,.4); rgb=(1,.8,.8)}}
\usepackage{pgfplotstable}
% for trig plots as Areas Between Curves
\makeatletter
\newcommand*{\ArrayToCommaList}[1]{%
\let\ArrayToCommaList@Result\@empty
\expandafter\@tfor\expandafter\ArrayToCommaList@Entry
\expandafter:\expandafter=#1\do{%
\edef\ArrayToCommaList@Result{%
\ArrayToCommaList@Result,\ArrayToCommaList@Entry
}%
}%
% Remove first comma
\edef#1{%
\expandafter\@cdr\ArrayToCommaList@Result\@empty\@nil
}%
}
\makeatother
% Overwrite a term in an equation with a comment
\newlength{\overwritelength}
\newlength{\minimumoverwritelength}
\setlength{\minimumoverwritelength}{1cm}
\newcommand{\overwrite}[3][red]{%
\settowidth{\overwritelength}{$#2$}%
\ifdim\overwritelength<\minimumoverwritelength%
\setlength{\overwritelength}{\minimumoverwritelength}\fi%
\stackrel
{%
\begin{minipage}{\overwritelength}%
\color{#1}\centering\small #3\\%
\rule{1pt}{9pt}%
\end{minipage}}
{\colorbox{#1!50}{\color{black}$\displaystyle#2$}}}
% For fancy headers!
\usepackage{fancyhdr}
% Used for creating EOC questions with corresponding solutions at the end of the textbook
\usepackage{answers}
% fancy section headers
\usepackage[explicit,sc]{titlesec}
% to use strike through arrow
\usepackage{cancel}
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
%add the following two lines in order to compile with pdflatex
\usepackage[pdf]{pstricks}
%\usepackage[on]{auto-pst-pdf}
%\input{pstricks-commands}
%For subfigures and references
\usepackage{caption}
\usepackage{subcaption}
\usepackage{cleveref}
\captionsetup[subfigure]{subrefformat=simple,labelformat=simple}
\renewcommand\thesubfigure{(\alph{subfigure})}
\usepackage{wrapfig}
\usepackage{epstopdf}
\epstopdfsetup{update} % only regenerate pdf files when eps file is newer
\usepackage{bm}
% for strikout "sout" command
\usepackage[normalem]{ulem}
\newcommand{\primeskip}{\hskip.75pt}
\newcommand{\fp}{\ensuremath{f\,'}}
\newcommand{\fpp}{\ensuremath{f\,''}}
\newcommand{\dx}{\ensuremath{\Delta x}}
\newcommand{\dy}{\ensuremath{\Delta y}}
\newcommand{\Fp}{\ensuremath{F\primeskip'}}
\newcommand{\Fpp}{\ensuremath{F\primeskip''}}
\newcommand{\myrule}{\rule[-4pt]{0pt}{13pt}}
\newcommand{\mmrule}{\rule[-10pt]{0pt}{15pt}}
\newcommand{\myds}{\ds\mmrule}
\newcommand{\myint}[2]{\ensuremath{\myds\int #1\ dx=} \ensuremath{\ds #2}}
\newcommand{\deriv}[2]{\ensuremath{\myds\frac{d}{dx}\left(#1\right)=#2}}
\newcommand{\mtable}[4]{
\vskip \baselineskip%
\noindent\begin{minipage}{\textwidth}
\centering\small
#4
\captionsetup{type=figure}
\caption{#2}\label{#3}
\end{minipage}
\vskip\baselineskip}
\newcommand{\mTable}[4]{
%\vskip \baselineskip%
\noindent\begin{minipage}{#1\textwidth}
\centering\small
#4
\captionsetup{type=table}
\caption{#2}\label{#3}
\end{minipage}
\vskip\baselineskip}
\newcommand{\mfigure}[4]{%
\vskip \baselineskip%
\noindent\begin{minipage}{#1\textwidth}
\centering
#4%
\captionsetup{type=figure}
\caption{#2}\label{#3}
\end{minipage}
}
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
\usepgfplotslibrary{fillbetween}
\newcommand{\colorone}{blue}
\newcommand{\colortwo}{red}
\newcommand{\coloronefill}{blue!15!white}
\newcommand{\colortwofill}{red!15!white}
\newcommand{\colornamesuffix}{}
\newcommand{\mysettikzname}[1]{\tikzsetnextfilename{#1}}
\newcommand{\myincludegraphics}[2][]{\includegraphics[#1]{#2}}
\newcommand{\colormapone}{rgb=(.4,.4,1); rgb=(.8,.8,1)}
\newcommand{\colormaptwo}{rgb=(1,.4,.4); rgb=(1,.8,.8)}
\newcommand{\colormapplaneone}{rgb=(.7,.7,1); rgb=(.9,.9,1)}
\definecolor{colormaponebottom}{rgb}{.4,.4,1}
\definecolor{colormaponetop}{rgb}{.8,.8,1}
\definecolor{colormaptwobottom}{rgb}{1,.4,.4}
\definecolor{colormaptwotop}{rgb}{1,.8,.8}
% custom tick mark labels
%\makeatletter
% \pgfplotsset{
% xtick parsed/.code={
% \c@pgf@counta 0\relax
% \foreach \x in {#1} {
% \pgfmathparse{\x}
% \ifnum\c@pgf@counta=0
% \xdef\pgfplots@xtick{\pgfmathresult}
% \else
% \xdef\pgfplots@xtick{\pgfplots@xtick,\pgfmathresult}
% \fi
% \global\advance\c@pgf@counta 1\relax
% }
% }
% }
% \makeatother
% mid-point rule
\pgfplotsset{
midpoint segments/.code={\pgfmathsetmacro\midpointsegments{#1}},
midpoint segments=3,
midpoint/.style args={#1:#2}{
ybar interval,
domain=#1+((#2-#1)/\midpointsegments)/2:#2+((#2-#1)/\midpointsegments)/2,
samples=\midpointsegments+1,
x filter/.code=\pgfmathparse{\pgfmathresult-((#2-#1)/\midpointsegments)/2}
}
}
% right hand sums
\pgfplotsset{
right segments/.code={\pgfmathsetmacro\rightsegments{#1}},
right segments=3,
right/.style args={#1:#2}{
ybar interval,
domain=#1+((#2-#1)/\rightsegments):#2+((#2-#1)/\rightsegments),
samples=\rightsegments+1,
x filter/.code=\pgfmathparse{\pgfmathresult-((#2-#1)/\rightsegments)}
}
}
% left hand sums
\pgfplotsset{
left segments/.code={\pgfmathsetmacro\leftsegments{#1}},
left segments=3,
left/.style args={#1:#2}{
ybar interval,
domain=#1:#2,
samples=\leftsegments+1,
x filter/.code=\pgfmathparse{\pgfmathresult}
}
}
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% Inputs information regarding book Title, Authors, Version and Revision
\input{frontmatter/bookinfo.txt}
% Inputs information regarding Institution,Course Code, Name, Session and Section (for adapted text)
%\input{courseInfo.txt}
\newcommand{\institution}{University of\\ New Brunswick Saint John}
\newcommand{\courseCode}{}
\newcommand{\courseName}{MATH $1003$, MATH $1013$, \& MATH $2513$ }
\newcommand{\courseSession}{}
\newcommand{\courseSection}{}
% Lyryx Math Style
\usepackage{UNBMathStyle}
% Lyryx Calculus Style
\usepackage{UNBCalcStyle}
% TODO: Is there a way to automatically calculate the dimensions of the print-cover?
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% PRINT COVER GEOMETRY CALCULATIONS
%
% % %
%%% Here are the calculations from createspace:
%
% Spine width: --> black+white interior is 0.002252in * page count
% --> colour interior is 0.0025in * page count
%
% Spine: allow for 0.0625" variance on either side of the fold lines for your cover.
%
% Bleed: 0.125 * 2 (needed on all 4 outside edges of PDF, but not spine)
%
% Safe zone: Text and images must be at least .125" inside the trim lines to ensure
% that no live elements are cut during the bookmaking process.
%
% Minimum Cover Width: Bleed + Back Cover Trim Size + Spine Width + Front Cover Trim Size + Bleed
%
%
% For 104 pages in colour: (exclude front and back cover - 2 pages)
%
% paper width = 0.125 + 8.5 + (0.0025 * 104) + 8.5 + 0.125 = 17.51in
% paper height = 11 + (2 * 0.125) = 11.25in
%
% paper size - safe zone (layoutsize)
% layout width = 8.5 - (.125 * 2)
% layout height = 11 - (.125 * 2)
%
% bleed + left side + spine + safe zone
% layout offset x = 0.125 + 8.5 + (0.0025 * 104) + 0.125 = 9.01in
% bleed + safe zone
% layout offset y = 0.125 + 0.125 = 0.25in
%
% spine width: 0.002252 * 360 = 0.81072in B&W
% 0.0025 * 360 = 0.9in colour
%
%
% HOWEVER this will leave space for headers/footers/marginal notes/etc
%
% So we want to tweak the body size to be something nice, such as layoutsize minus 1/2 inch on each side for margins
%
% Options showframe, showcrop, and verbose can be used for debugging
\ifthenelse{\equal{\detokenize{print-cover}}{\jobname}\OR\equal{\detokenize{print-cover-lulu}}{\jobname}}{
\geometry{papersize={17.51in,11.25in},layoutsize={8.25in,10.75in},layoutoffset={9.01in,0.25in},body={7.25in,9.75in}}
}{
% No change in geometry for regular pdf
}
\begin{document}
\newcommand{\ssep}{\mid} % set builder notation - vertical bar (separator)
\ifthenelse{\equal{\detokenize{print-cover-lulu}}{\jobname}}{
\pagestyle{empty}
\subimport{frontmatter/titlepage-lulu}
}{
\ifthenelse{\equal{\detokenize{print-cover}}{\jobname}}{
\pagestyle{empty}
\subimport{\mybuildpath}{frontmatter/titlepage}
}{
\raggedbottom
\allowdisplaybreaks
\frontmatter
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Title page
\ifthenelse{\equal{\detokenize{interior}}{\jobname}}{
% Skip title page
}{
\subimport{\mybuildpath}{frontmatter/titlepage}
\cleardoublepage
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% LSCS
% \subimport{\mybuildpath}{frontmatter/lscs}
% \cleardoublepage
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright material
\subimport{\mybuildpath}{frontmatter/copyright}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Table of Contents
\setlength{\parskip}{3pt}
\tableofcontents
\cleardoublepage
\mainmatter
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Contents!!
\subimport{\mybuildpath}{content}
%\backmatter
%\printindex %Make an index AUTOMATICALLY % TODO
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Back Cover
\ifthenelse{\equal{\detokenize{interior}}{\jobname}}{
% Skip back cover
}{
\subimport{\mybuildpath}{backpage}
}
}
}
\end{document}