forked from milesdai/TAoE3Solutions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
taoesolutions.sty
83 lines (72 loc) · 2.16 KB
/
taoesolutions.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
\ProvidesPackage{taoesolutions}[2018/05/16 v1.0 Macros used to make solutions for The Art of Electronics 3rd ed.]
\usepackage{circuitikz}
\usepackage{pgfplots}
\usepackage{amsmath}
\usepackage{cancel}
\usepackage{enumitem}
\usepackage{float}
\usepackage[
margin=1in,
includefoot,
footskip=30pt,
]{geometry}
\usepackage[toc]{multitoc}
% Remove the "Chapter" label on each chapter
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\bfseries}{}{0pt}{\huge}
% Define a consistent "Exercise" delineator
\newcommand{\ex}[1]{\section*{Exercise #1} \addcontentsline{toc}{section}{Exercise #1}}
\newcommand{\todo}[1]{\textcolor{red}{\textbf{TODO: #1}}}
\newcommand{\todoex}[1]{\ex{#1 \todo{write solution}}}
\newcommand{\mans}[1]{\boxed{#1}}
\newcommand{\tans}[1]{\framebox{#1}}
% Make easier use of EE order of magnitude notation
\usepackage{siunitx}
\sisetup{
group-separator = {,},
group-digits = integer
}
\newcommand{\Th}{\ensuremath{\text{Th}}} % Thevenin
\renewcommand{\in}{\ensuremath{\text{in}}} % In (for V_{In})
\newcommand{\out}{\ensuremath{\text{out}}}
\newcommand{\load}{\ensuremath{\text{load}}}
\newcommand{\source}{\ensuremath{\text{source}}}
\newcommand{\pp}{\ensuremath{\text{p-p}}}
\newcommand{\rms}{\ensuremath{\text{rms}}}
\newcommand{\ave}{\ensuremath{\text{ave}}} % average
\newcommand{\eq}{\ensuremath{\text{eq}}} % equivalent
\newenvironment{circuit}[2]% param1=label, param2=caption
{
\begin{figure}[H]
\caption{#2}
\label{#1}
\begin{center}
% \centering
\begin{circuitikz}[american]\draw
}
{
;
\end{circuitikz}
\end{center}
\end{figure}
}
\newenvironment{plot}[2]% param1=label, param2=caption
{
\begin{figure}[H]
\caption{#2}
\label{#1}
\begin{center}
% \centering
\begin{tikzpicture}[scale=0.8, samples=200]\draw
}
{
;
\end{tikzpicture}
\end{center}
\end{figure}
}
% Set first level of list to (a) format
\setlist[enumerate,1]{label=(\alph*)}
% Be sure to use \mans{<answer>} for math answers
% Use \tans{<answer>} for text answers