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
|
% arara: indent: {trace: true}
\documentclass[10pt,twoside]{report}
\begin{document}
% needed for the mini-tableofcontents
\dominitoc
\faketableofcontents
\fancyhf{} % delete current header and footer
\fancyhead[LE,RO]{\bfseries\thepage}
\fancyhead[LO,RE]{\tiny\rightmark}
\fancyheadoffset[LE,LO]{4cm}
\pagestyle{fancy}
%\include{coverpage}
\include{functions}
%\include{exponentialfunctions}
%\include{functions2}
%\include{logarithms}
%\include{polyrat}
%\include{ideas}
%=======================
% BEGIN SOLUTIONS
%=======================
% change the page geometry using \newgeometry
%\cleardoublepage
\clearpage
%\setbool{@twoside}{false}
\fancyheadoffset[RE,RO]{2cm}
\fancyheadoffset[LE,LO]{1cm}
\renewcommand{\rightmark}{Solutions to Section \thesection}
\fancyhead[LO,RE]{\rightmark}
\newgeometry{left=4cm,right=4cm,showframe=true,
marginratio=1:1,
top=1.5cm,bottom=1.5cm,bindingoffset=0cm}
% finish the php file
\Writetofile{crossrefsWEB}{?>}
% close the solutions files
\Closesolutionfile{shortsolutions}
\Closesolutionfile{longsolutions}
%\Closesolutionfile{hints}
\Closesolutionfile{crossrefsWEB}
% when itemized lists are used in the solutions, they
% are actually at 2nd depth because the solution environment
% uses an \itemize environment to get the indendation correct
\setlist[itemize,2]{label=\textbullet}
% SHORT solution to problem (show only odd, even, all)
% Note: this renewenvironment needs to go here
% so that the answers package can still
% display correctly to the page if needed
\newbool{oddproblemnumber}
\renewenvironment{shortSoln}[1]{%
\exploregroups % needed to ignore {}
% before the environment starts - this is a stretchable space
\vskip 0.1cm plus 2cm minus 0.1cm%
\fullexpandarg % need this line so that '.' are counted
%
% either problems, or subproblems, e.g: 3.1 or 3.1.4 respectively
% determine which one by counting the '.'
\StrCount{#1}{.}[\numberofdecimals]
%
% find the problem number by splitting the string
\ifnumequal{\numberofdecimals}{0}%
{%
% problems, such as 4, 5, 6, ...
\def\problemnumber{#1}%
}%
{}%
\ifnumequal{\numberofdecimals}{1}%
{%
% subproblems, such as 4.3, 1.2, 10.5
\StrBefore{#1}{.}[\problemnumber]%
}%
{}%
\ifnumequal{\numberofdecimals}{2}%
{%
% subproblems such as 1.3.1, 1.2.4, 7.5.6
% note that these aren't currently used, but maybe someday
\StrBehind{#1}{.}[\newbit]%
\StrBefore{\newbit}{.}[\problemnumber]%
}%
{}%
%
% determine if the problem number is odd or even
% and depending on our choices above, display or not
\ifnumodd{\problemnumber}%
{%
% set a boolean that says the problem number is odd (used later)
\setbool{oddproblemnumber}{true}%
% display or not
\ifbool{showoddsolns}%
{%
% if we want to show the odd problems
\ifbool{coreproblemYesNo}%
{% Core problem
\expandafter\itemize[label=\llap{$\bigstar$ }\bfseries \hyperlink{prob:#1:\thechapter:\thesection}{#1}.]\item%
}%
{% NOT Core problem
\expandafter\itemize[label=\bfseries \hyperlink{prob:#1:\thechapter:\thesection}{#1}.]\item%
}%
}%
{%
% otherwise don't show them!
\expandafter\comment%
}%
}%
{%
% even numbered problem, set the boolean (used later)
\setbool{oddproblemnumber}{false}%
\ifbool{showevensolns}%
{%
% if we want to show the even problems
\ifbool{coreproblemYesNo}%
{% Core problem
\expandafter\itemize[label=\llap{$\bigstar$ }\itshape \hyperlink{prob:#1:\thechapter:\thesection}{#1}.]\item%
}%
{% NOT Core problem
\expandafter\itemize[label=\itshape \hyperlink{prob:#1:\thechapter:\thesection}{#1}.]\item%
}%
}%
{%
% otherwise don't show them!
\expandafter\comment%
}%
}%
}%
{%
% after the environment finishes
\ifbool{oddproblemnumber}%
{%
% odd numbered problems
\ifbool{showoddsolns}%
{%
% if we want to show the odd problems
% then the environment is finished
\enditemize%
}%
{%
% otherwise we need to finish the comment
\expandafter\endcomment%
}%
}%
{%
% even numbered problems
\ifbool{showevensolns}%
{%
% if we want to show the even problems
% then the environment is finished
\enditemize%
}%
{%
% otherwise we need to finish the comment
\expandafter\endcomment%
}%
}%
}
% LONG solution to problem (show only odd, even, all)
% Note: this renewenvironment needs to go here
% so that the answers package can still
% display correctly to the page if needed
\renewenvironment{longSoln}[1]{%
\exploregroups % needed to ignore {}
% before the environment starts - this is a stretchable space
\vskip 0.1cm plus 2cm minus 0.1cm%
\fullexpandarg % need this line so that '.' are counted
%
% either problems, or subproblems, e.g: 3.1 or 3.1.4 respectively
% determine which one by counting the '.'
\StrCount{#1}{.}[\numberofdecimals]
%
% find the problem number by splitting the string
\ifnumequal{\numberofdecimals}{0}%
{%
% problems, such as 4, 5, 6, ...
\def\problemnumber{#1}%
}%
{}%
\ifnumequal{\numberofdecimals}{1}%
{%
% problems, such as 4.3, 1.2, 10.5
\StrBefore{#1}{.}[\problemnumber]%
}%
{}%
\ifnumequal{\numberofdecimals}{2}%
{%
% subproblems such as 1.3.1, 1.2.4, 7.5.6
\StrBehind{#1}{.}[\newbit]%
\StrBefore{\newbit}{.}[\problemnumber]%
}%
{}%
%
% determine if the problem number is odd or even
% and depending on our choices above, display or not
\ifnumodd{\problemnumber}%
{%
% set a boolean that says the problem number is odd (used later)
\setbool{oddproblemnumber}{true}%
% display or not
\ifbool{showoddsolns}%
{%
% if we want to show the odd problems
{\bfseries \hyperlink{prob:#1:\thechapter:\thesection}{#1}.}%
}%
{%
% otherwise don't show them!
\expandafter\comment%
}%
}%
{%
% even numbered problem, set the boolean (used later)
\setbool{oddproblemnumber}{false}%
\ifbool{showevensolns}%
{%
% if we want to show the even problems
{\itshape \hyperlink{prob:#1:\thechapter:\thesection}{#1}.}%
}%
{%
% otherwise don't show them!
\expandafter\comment%
}%
}%
}%
{%
% after the environment finishes
\ifbool{oddproblemnumber}%
{%
% odd numbered problems
\ifbool{showoddsolns}%
{%
% if we want to show the odd problems
% then the environment is finished
}%
{%
% otherwise we need to finish the comment
\expandafter\endcomment%
}%
}%
{%
% even numbered problems
\ifbool{showevensolns}%
{%
% if we want to show the even problems
% then the environment is finished
}%
{%
% otherwise we need to finish the comment
\expandafter\endcomment%
}%
}%
}
% renew tikzpicture environment to make it use valign=t
% on every one, which fixes vertical alignment of tikzpicture
% with the solution label: http://tex.stackexchange.com/questions/30367/aligning-enumerate-labels-to-top-of-image
\BeforeBeginEnvironment{tikzpicture}{\begin{adjustbox}{valign=t}}
\AfterEndEnvironment{tikzpicture}{\end{adjustbox}}
% do the same for the tabular environment
\BeforeBeginEnvironment{tabular}{\begin{adjustbox}{valign=t}}
\AfterEndEnvironment{tabular}{\end{adjustbox}}
% set every picture in the solutions to have \solutionfigurewidth
\pgfplotsset{
every axis/.append style={%
width=\solutionfigurewidth}}
% input the SHORT solutions file
\IfFileExists{shortsolutions.tex}{\input{shortsolutions.tex}}{}
\clearpage
% input the LONG solutions file
%\IfFileExists{longsolutions.tex}{\input{longsolutions.tex}}{}
\clearpage
% input the HINTS file
%\IfFileExists{hints.tex}{\input{hints.tex}}{}
%=======================
% END SOLUTIONS
%=======================
%=======================
% INDEX
%=======================
\printindex
\end{document}
|