-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiblanswers.sty
97 lines (85 loc) · 3.25 KB
/
iblanswers.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
% ========================================
% Page layout
\RequirePackage[left=1.45in,right=1.45in,top=1in,bottom=1in]{geometry}
\usepackage{color}
% fancyhdr
\fancypagestyle{bodypage}{%
\fancyhf{}% clear all six fields
\fancyhead[RE,LO]{\small Answers: Introduction to Proofs}
\fancyhead[LE,RO]{\small page \thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}
}
\pagestyle{bodypage}
\AtBeginDocument{\thispagestyle{firstpage}}
% ========================================
% make cross referrences to main text
\RequirePackage{xr}
\externaldocument{ibl}
% ========================================
% use facilities of package enumitem
\newlength{\unifiedlistparindent} % use same value in lists and sublists
\setlength{\unifiedlistparindent}{1.25em}
\newenvironment{answer}[1]{%
\renewenvironment{solution}[1]{ %
}{}
\ %
\begin{itemize}[topsep=0.20ex plus 0.02ex minus 0.01ex,
partopsep=0ex, parsep=0ex plus 0.01ex,
beginpenalty=150,% Prevent page break after newline start
labelwidth=1em,align=left,labelsep=0em,
itemsep=.25ex plus .03ex minus .01ex,
leftmargin=1.25em,rightmargin=0em,
listparindent=\unifiedlistparindent,
align=left,label={}]\item[Exercise #1]\ %
}{%
\end{itemize}
}
% \newlength{\exesindent}\setlength{\exesindent}{1.25em}
\newenvironment{exes}{%
\renewenvironment{solution}[1]{\item %
}{}
% \addtocounter{exerciseswithpartscount}{1}%
% \hspace*{0em}% Causes it to start on a new line?
\begin{enumerate}[topsep=0.15ex plus 0.02ex minus 0.01ex,
partopsep=0ex,parsep=0ex,
beginpenalty=150, % Prevent page break after newline start
labelwidth=0.5em plus .03em minus 0em,align=right,labelsep=0.5em,
itemsep=.25ex plus .04ex,
leftmargin=0em,
itemindent=1em,
rightmargin=0em,
listparindent=\unifiedlistparindent,
align=left,label={\textsc{\alph*}.}]
}{%
\end{enumerate}
}
% Note that his is redefined in the answer environment, and in the
% exes environment, so this definition doesn't change anything.
\newenvironment{solution}[1]{%
\item %
}{%
}
%
\renewenvironment{items}{%
\begin{enumerate}[topsep=0.15ex plus 0.02ex minus 0.01ex,
partopsep=0ex,parsep=0ex,
beginpenalty=150, % Prevent page break after newline start
labelwidth=0.5em plus .03em minus 0em,align=right,labelsep=0.5em,
itemsep=.25ex plus .04ex,
leftmargin=0em,
itemindent=1em,
rightmargin=0em,
listparindent=\unifiedlistparindent,
align=left,label={(\roman*)}]
}{%
\end{enumerate}
}
% ==============================================
% sectioning
\titleformat{\chapter}[block]{\color{darki}\LARGE\scshape}{Chapter \thechapter}{1em}{}[\thispagestyle{firstpage}]
\titlespacing*{\chapter}{0em}{6ex}{3ex}
\titleformat{\section}[block]{\color{darki}\Large\scshape}{}{0em}{}[]
\titlespacing*{\section}{0em}{7ex}{2ex}
% \titleformat{\section}[block]{\Large\scshape}{}{0em}{}[] % unnumbered sections
% \titlespacing*{\section}{0em}{7ex}{2ex}