-
Notifications
You must be signed in to change notification settings - Fork 0
/
calc10-fn-bookmark.tex
105 lines (101 loc) · 3.33 KB
/
calc10-fn-bookmark.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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% BASED ON "Week 1 Day 2"
% Boulder-Omaha Active Learning Alliance (BOALA) Active Calculus
% DIRECTIONS: typeset twice to get positioning right
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}
\usepackage{mathtools}
\usepackage{pgfplots}
\pgfplotsset{compat=1.13}
\thispagestyle{empty}
\usepackage{expl3}
\ExplSyntaxOn
\cs_new_eq:NN \Repeat \prg_replicate:nn
\ExplSyntaxOff
\newcounter{bookmark}
\newcounter{card}
\newcommand\card[5]{
\begin{tikzpicture}[remember picture, overlay]
\draw (current page.north)
++(down:\arabic{bookmark}*1/4*11in+1.1in)
++(down:{(floor(\arabic{card}/8))*0.95in})
++(right:{(mod(\arabic{card},8)+1/2 - 4)*1/8*8.5in*0.94})
coordinate (center);
\draw (center) node {\begin{tikzpicture}\begin{axis}
[ %% #1 = function title
title={\normalsize{\unboldmath$f(x) = #1$}},
title style={yshift=-0.075in},
every axis/.append style={font=\footnotesize},
height=1.2 in, width=1.5 in,
xmin=-3.1, xmax=3.1,
ymin=-2.5, ymax=2.5,
restrict y to domain=-2.5:2.5,
samples=99,
major tick length={0},
extra y tick style={y tick label style={right, yshift=-4mm}},
yticklabel style={yshift=2mm},
xticklabel style={yshift=-2mm},
line width=1pt,
axis lines=center,
grid=major,
% grid style={solid, gray, very thick},
%% #3 = options for this particular graph, eg xmax ytick
xtick={0}, ytick={0},
#3
]
%% #2 = list of functions/options to plot = {fn1/op1, fn2/op2, etc}
\foreach \function/\options in {#2}{
\edef\temp{\noexpand
\addplot[very thick, smooth, \options]{\function};
}
\temp
}
%% #4 = open circles = {(x1,y1) (x2,y2), etc} % no comma btw pts
\addplot [only marks, very thick, mark=*,
mark options={scale=1, fill=white}]
coordinates {#4};
%% #5 = coordinates of closed
\addplot [only marks, very thick, mark=*,
mark options={scale=1}]
coordinates {#5};
\end{axis}\end{tikzpicture}};
\end{tikzpicture}
\stepcounter{card}
}
\newcommand\cardb[3]{\card{#1}{{#2}/{}}{#3}{}{}}
\newcommand\cardc[2]{\card{#1}{{#2}/{}}{grid=none, ticks=none}{}{}}
\newcommand\cardd[1]{\card{#1}{{#1}/{}}{grid=none, ticks=none}{}{}}
\begin{document}
\boldmath
\Repeat{4}{
\setcounter{card}0
\begin{tikzpicture}[remember picture, overlay]
\draw (current page.north)
++(down:\arabic{bookmark}*1/4*11in+0.4in)
node {\LARGE Parent Function R\'epertoire};
\end{tikzpicture}
\cardd{x}
\cardd{x^2}
\cardd{x^3}
\cardd{x^4}
\cardb{\sqrt{x}}{x/abs(x)*(abs(x))^(1/3)}{domain=0:3}
\cardc{\sqrt[3]x}{x/abs(x)*(abs(x))^(1/3)}
\cardc{\left| x \right|}{abs(x)}
\card{\frac{\left| x \right|}x}{-1/{domain=-3.1:0}, 1/{}}
{ytick={1}, extra y ticks={-1}, domain=0:3.1}{(0,1) (0,-1)}{}
\cardb{e^x}{e^x}{ytick={1}, xtick={0}}
\cardb{\ln x}{ln(x)}{ytick={0}, xtick={1}, xticklabels={$\phantom0\mathrlap1$}}
\cardb{\sin x}{sin(deg(x))}{ytick={1}, extra y ticks={-1}}
\cardb{\cos x}{cos(deg(x))}{ytick={1}, extra y ticks={-1}}
\cardb{\tan x}{tan(deg(x))}{xtick={-1.5708, 1.5708}, xticklabels={
$\mathllap{{-}\pi\hspace{-0.8ex}/\hspace{-0.4ex}}2$,
$\mathllap{\pi\hspace{-0.8ex}/\hspace{-0.4ex}}2$
}}
\cardd{1/x}
\cardd{1/x^2}
\card{\lfloor x\rfloor}
{-2/{domain=-2:-1}, -1/{domain=-1:0}, 0/{domain=0:1}, 1/{}}
{domain=1:2}{(-1,-2) (0,-1) (1,0) (2,1)}{(-2,-2) (-1,-1) (0,0) (1,1)}
\stepcounter{bookmark}
}
\end{document}