├── README.md └── calculus-1 └── preamble.tex /README.md: -------------------------------------------------------------------------------- 1 | # Math 2 | 3 | ## Calculus 1 4 | 5 | Currently taking this course. 6 | 7 | # Physics 8 | 9 | ## Physics 101 10 | 11 | Currently taking this course. 12 | -------------------------------------------------------------------------------- /calculus-1/preamble.tex: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | % % 3 | % Required Packages % 4 | % % 5 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 6 | 7 | % Set encoding style. 8 | \usepackage[utf8]{inputenc} 9 | % Gives us multiple colors. 10 | \usepackage[usenames,dvipsnames,pdftex]{xcolor} 11 | % Lets us style link colors. 12 | \usepackage{hyperref} 13 | % Lets us import images and graphics. 14 | \usepackage{graphicx} 15 | % Let's us modify list stuff. 16 | \usepackage{enumitem} 17 | % Lets us use figures in floating environments. 18 | \usepackage{float} 19 | % Lets us create multiple columns. 20 | \usepackage{multicol} 21 | \usepackage{multirow} 22 | % Gives us better math syntax. 23 | \usepackage{amsmath,amsfonts,mathtools,amsthm,amssymb} 24 | % Lets us strike through text. 25 | \usepackage{cancel} 26 | % Lets us import pdf directly in our tex code. 27 | \usepackage{pdfpages} 28 | % Derivative stuff. 29 | \usepackage{derivative} 30 | % Lets us add vectors graphically. 31 | \usepackage{physics} 32 | % Table stuff. 33 | \usepackage{tablists} 34 | \usepackage{tabularx} 35 | \usepackage{wasysym} 36 | 37 | 38 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 39 | % % 40 | % Basic Settings % 41 | % % 42 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 43 | 44 | %%%%%%%%% 45 | % Tasks % 46 | %%%%%%%%% 47 | 48 | \usepackage{tasks} 49 | \usepackage{extramarks} 50 | 51 | \settasks{label=\bfseries\arabic*.),label-width=2em} 52 | 53 | %%%%%%%%%%% 54 | % Table % 55 | %%%%%%%%%%% 56 | 57 | \newcolumntype{C}{>{\Centering\arraybackslash}X} 58 | 59 | \usepackage[font=bf]{caption} 60 | \renewcommand\thetable{\Roman{table}} 61 | % \renewcommand\qedsymbol{$\Laughey$} 62 | 63 | \let\svlim\lim\def\lim{\svlim\limits} 64 | \let\svsum\sum\def\sum{\svsum\limits} 65 | 66 | %%%%%%%%%%%%% 67 | % Symbols % 68 | %%%%%%%%%%%%% 69 | 70 | \let\implies\Rightarrow 71 | \let\impliedby\Leftarrow 72 | \let\iff\Leftrightarrow 73 | \let\epsilon\varepsilon 74 | 75 | %%%%%%%%%%% 76 | % Lists % 77 | %%%%%%%%%%% 78 | 79 | \setlist[itemize,1]{label=--} 80 | \setlist[itemize,2]{label=\textbullet} 81 | \setlist[enumerate,1]{label=\protect\circled{\arabic*}} 82 | 83 | %%%%%%%%%%%% 84 | % Tables % 85 | %%%%%%%%%%%% 86 | 87 | \setlength{\tabcolsep}{5pt} 88 | \renewcommand\arraystretch{1.5} 89 | 90 | %%%%%%%%%%%%%% 91 | % SI Unitx % 92 | %%%%%%%%%%%%%% 93 | 94 | \usepackage{siunitx} 95 | \sisetup{ 96 | locale = US, 97 | per-mode = symbol, 98 | propagate-math-font = true, 99 | reset-math-version = false, 100 | exponent-mode = engineering, 101 | round-mode = figures, 102 | round-precision = 3, 103 | drop-zero-decimal, 104 | } 105 | 106 | % Distance 107 | \DeclareSIUnit{\millimeter}{mm} 108 | \DeclareSIUnit{\centimeter}{cm} 109 | \DeclareSIUnit{\decimeter}{dm} 110 | \DeclareSIUnit{\inch}{in} 111 | \DeclareSIUnit{\foot}{ft} 112 | \DeclareSIUnit{\yard}{yd} 113 | \DeclareSIUnit{\meter}{m} 114 | \DeclareSIUnit{\kilometer}{km} 115 | \DeclareSIUnit{\mile}{mi} 116 | 117 | % Time 118 | \DeclareSIUnit{\millisecond}{ms} 119 | \DeclareSIUnit{\second}{sec} 120 | \DeclareSIUnit{\minute}{min} 121 | \DeclareSIUnit{\hour}{hr} 122 | \DeclareSIUnit{\day}{d} 123 | \DeclareSIUnit{\week}{wk} 124 | \DeclareSIUnit{\month}{mos} 125 | \DeclareSIUnit{\year}{yr} 126 | 127 | % Weight 128 | \DeclareSIUnit{\milligram}{mg} 129 | \DeclareSIUnit{\gram}{g} 130 | \DeclareSIUnit{\ounce}{oz} 131 | \DeclareSIUnit{\pound}{lb} 132 | \DeclareSIUnit{\kilogram}{kg} 133 | \DeclareSIUnit{\ton}{t} 134 | 135 | % Liquid 136 | \DeclareSIUnit{\gallon}{gal} 137 | \DeclareSIUnit{\liter}{L} 138 | \DeclareSIUnit{\milliliter}{mL} 139 | 140 | %%%%%%%%%% 141 | % TikZ % 142 | %%%%%%%%%% 143 | 144 | \usepackage[framemethod=TikZ]{mdframed} 145 | \usepackage{tikz} 146 | \usepackage{animate} 147 | \usepackage{tikz-cd} 148 | \usepackage{bm} 149 | 150 | \usetikzlibrary{ 151 | intersections, 152 | angles, 153 | quotes, 154 | calc, 155 | positioning, 156 | 3d, 157 | arrows, 158 | arrows.meta, 159 | patterns, 160 | } 161 | 162 | \tikzset{>=stealth} 163 | 164 | \tikzstyle{vector label} = [midway,fill=white,sloped] 165 | \tikzstyle{vector}=[->,very thick] 166 | \tikzstyle{construction} = [->,thin,dashed,draw=green!45!black] 167 | 168 | %%%%%%%%%%%%%%% 169 | % PGF Plots % 170 | %%%%%%%%%%%%%%% 171 | 172 | \usepackage{pgfplots} 173 | \pgfplotsset{compat=1.18} 174 | 175 | \usepgfplotslibrary{patchplots} 176 | 177 | \pgfplotsset{pccplot/.style={color=red,mark=none,line width=1pt,<->,solid}} 178 | \pgfplotsset{asymptote/.style={color=gray,mark=none,line width=1pt,<->,dashed}} 179 | \pgfplotsset{soldot/.style={color=red,only marks,mark=*}} 180 | \pgfplotsset{holdot/.style={color=red,fill=white,only marks,mark=*}} 181 | \pgfplotsset{blankgraph/.style={xmin=-10,xmax=10,ymin=-10,ymax=10,axis line style= {-, draw opacity=0 },axis lines=box,major tick length=0mm,xtick={-10,-9,...,10},ytick={-10,-9,...,10},grid=major,yticklabels={,,},xticklabels={,,},minor xtick=,minor ytick=,xlabel={},ylabel={},width=0.75\textwidth,grid style={solid,gray!40}}} 182 | 183 | \pgfplotscreateplotcyclelist{pccstylelist}{ 184 | pccplot \\ 185 | color=blue,mark=none,line width=1pt,<->,dashdotted \\ 186 | color=gray,mark=none,line width=1pt,<->,dashdotdotted \\ 187 | } 188 | 189 | \def\axisdefaultwidth{175pt} 190 | \def\axisdefaultheight{\axisdefaultwidth} 191 | 192 | \pgfplotsset{every axis/.append style={ 193 | axis x line=middle, 194 | axis y line=middle, 195 | axis line style={<->}, 196 | xlabel={$x$}, 197 | ylabel={$y$}, 198 | xmin = -7,xmax = 7, 199 | ymin = -7,ymax = 7, 200 | yticklabel style={inner sep=0.333ex}, 201 | minor xtick = {-7,-6,...,7}, 202 | minor ytick = {-7,-6,...,7}, 203 | scale only axis, 204 | cycle list name=pccstylelist, 205 | tick label style={font=\footnotesize}, 206 | legend cell align=left, 207 | grid = minor, 208 | grid style = {solid,gray!40}, 209 | try min ticks=6, 210 | }, 211 | framed/.style={axis background/.style = {draw=gray}} 212 | } 213 | 214 | % framing the graphs 215 | \pgfplotsset{axis background/.style={draw=gray}} 216 | 217 | %%%%%%%%%%%%%%%%%%%%%%% 218 | % Center Title Page % 219 | %%%%%%%%%%%%%%%%%%%%%%% 220 | 221 | \usepackage{titling} 222 | \renewcommand\maketitlehooka{\null\mbox{}\vfill} 223 | \renewcommand\maketitlehookd{\vfill\null} 224 | 225 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 226 | % Create a grey background in the middle of the PDF % 227 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 228 | 229 | \usepackage{eso-pic} 230 | 231 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 232 | % EXAMPLE: % 233 | % ---------------------------------------------------------------------------- % 234 | % % 235 | % PARAMETERS: % 236 | % ---------------------------------------------------------------------------- % 237 | % % 238 | % DESCRIPTION: % 239 | % ---------------------------------------------------------------------------- % 240 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 241 | \newcommand\definegraybackground{ 242 | \definecolor{reallylightgray}{HTML}{FAFAFA} 243 | \AddToShipoutPicture{ 244 | \ifthenelse{\isodd{\thepage}}{ 245 | \AtPageLowerLeft{ 246 | \put(\LenToUnit{\dimexpr\paperwidth-222pt},0){ 247 | \color{reallylightgray}\rule{222pt}{297mm} 248 | } 249 | } 250 | } 251 | { 252 | \AtPageLowerLeft{ 253 | \color{reallylightgray}\rule{222pt}{297mm} 254 | } 255 | } 256 | } 257 | } 258 | 259 | %%%%%%%%%%%%%%%%%%% 260 | % Footnote Line % 261 | %%%%%%%%%%%%%%%%%%% 262 | 263 | \renewcommand\footnoterule{\hrule\vspace{0.1cm}} 264 | 265 | %%%%%%%%%%%%%%%%%%%%%%%% 266 | % Modify Links Color % 267 | %%%%%%%%%%%%%%%%%%%%%%%% 268 | 269 | \hypersetup{ 270 | % Enable highlighting links. 271 | colorlinks, 272 | % Change the color of links to blue. 273 | linkcolor=blue, 274 | % Change the color of citations to black. 275 | citecolor={black}, 276 | % Change the color of url's to blue with some black. 277 | urlcolor={blue!80!black} 278 | } 279 | 280 | %%%%%%%%%%%%%%%%%% 281 | % Fix WrapFigure % 282 | %%%%%%%%%%%%%%%%%% 283 | 284 | \newcommand{\wrapfill}{\par\ifnum\value{WF@wrappedlines}>0 285 | \parskip=0pt 286 | \addtocounter{WF@wrappedlines}{-1}% 287 | \null\vspace{\arabic{WF@wrappedlines}\baselineskip}% 288 | \WFclear 289 | \fi} 290 | 291 | %%%%%%%%%%%%%%%%% 292 | % Multi Columns % 293 | %%%%%%%%%%%%%%%%% 294 | 295 | \let\multicolmulticols\multicols 296 | \let\endmulticolmulticols\endmulticols 297 | 298 | \RenewDocumentEnvironment{multicols}{mO{}} 299 | {% 300 | \ifnum#1=1 301 | #2% 302 | \else 303 | \multicolmulticols{#1}[#2] 304 | \fi 305 | } 306 | {% 307 | \ifnum#1=1 308 | \else 309 | \endmulticolmulticols 310 | \fi 311 | } 312 | 313 | \newlength{\thickarrayrulewidth} 314 | \setlength{\thickarrayrulewidth}{5\arrayrulewidth} 315 | 316 | %%%%%%%%%%%%%%%%%%% 317 | % Caption Setup % 318 | %%%%%%%%%%%%%%%%%%% 319 | 320 | \captionsetup[figure]{font=small} 321 | \captionsetup{justification=centering} 322 | 323 | 324 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 325 | % % 326 | % School Specific Commands % 327 | % % 328 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 329 | 330 | %%%%%%%%%%%%%%%%%%%%%% 331 | % Helpful Commands % 332 | %%%%%%%%%%%%%%%%%%%%%% 333 | 334 | \makeatletter 335 | 336 | \newcommand\resetcounters{ 337 | \setcounter{subsection}{0} 338 | \setcounter{subsubsection}{0} 339 | \setcounter{paragraph}{0} 340 | \setcounter{subparagraph}{0} 341 | \setcounter{theorem}{0} 342 | \setcounter{claim}{0} 343 | \setcounter{corollary}{0} 344 | \setcounter{lemma}{0} 345 | \setcounter{exercise}{0} 346 | \setcounter{definition}{0} 347 | } 348 | 349 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 350 | % EXAMPLE: % 351 | % ---------------------------------------------------------------------------- % 352 | % 1. \lec{1} % 353 | % 2. \lec{4} % 354 | % % 355 | % PARAMETERS: % 356 | % ---------------------------------------------------------------------------- % 357 | % 1. Lecture number. % 358 | % % 359 | % DESCRIPTION: % 360 | % ---------------------------------------------------------------------------- % 361 | % It loads the lecture provided. It looks into the `lectures/` folder. If you % 362 | % provided a number less than 10, it'll use 0 and you're number. If you % 363 | % provided, 4 for example, it'll try to include the file `lectures/lec-04.tex`.% 364 | % It also sets the section number to the provided number and resets all % 365 | % counters back to zero. % 366 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 367 | \def\@lecnum{} 368 | \newcommand\lec[1]{% 369 | \ifnum #1<10 370 | % If the lecture number passed is less than 10, add a 0 in front of the 371 | % digit. 372 | \def\@lecnum{0#1} 373 | \else 374 | \def\@lecnum{#1} 375 | \fi 376 | % Set the section counter to the number passed. 377 | \setcounter{section}{#1} 378 | % Reset all counters. 379 | \resetcounters 380 | % Include the lecture. 381 | \input{lectures/lec-\@lecnum.tex} 382 | } 383 | 384 | %%%%%%%%%%%%%%%%%%%%% 385 | % Lecture Command % 386 | %%%%%%%%%%%%%%%%%%%%% 387 | 388 | \usepackage{ifthen} 389 | \usepackage{xifthen} 390 | 391 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 392 | % EXAMPLE: % 393 | % ---------------------------------------------------------------------------- % 394 | % 1. \lecture{Oct 17 2022 Mon (08:46:48)}{Lecture Title} % 395 | % 2. \lecture{Oct 17 2022 Mon (08:46:48)}{} % 396 | % % 397 | % PARAMETERS: % 398 | % ---------------------------------------------------------------------------- % 399 | % 1. Time and date of lecture. % 400 | % 2. Lecture Title. % 401 | % % 402 | % DESCRIPTION: % 403 | % ---------------------------------------------------------------------------- % 404 | % Display the information like the following: % 405 | % % 406 | % Oct 17 2022 Mon (08:49:10) % 407 | % ---------------------------------------------------------------------------- % 408 | % Lecture 1: Lecture Title % 409 | % % 410 | % You don't need to provide a lecture number, since it uses the lecture number % 411 | % from the file as the lecture number. % 412 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 413 | \def\@lecture{} 414 | \newcommand\lecture[2]{ 415 | \ifthenelse{\isempty{#2}}{ 416 | \def\@lecture{Lecture \arabic{section}} 417 | }{ 418 | \def\@lecture{Lecture \arabic{section}: #2} 419 | } 420 | 421 | \if@twocolumn 422 | \twocolumn[ 423 | \hfill\footnotesize{#1} 424 | \hrule 425 | \vspace*{-0.3cm} 426 | \section*{\@lecture} 427 | \vspace{0.2cm} 428 | ] 429 | \else 430 | \hfill\footnotesize{#1} 431 | \hrule 432 | \vspace*{-0.3cm} 433 | \section*{\@lecture} 434 | \fi 435 | 436 | \addcontentsline{toc}{section}{\@lecture} 437 | } 438 | 439 | %%%%%%%%%%%%%%%%% 440 | % Fancy Headers % 441 | %%%%%%%%%%%%%%%%% 442 | 443 | \usepackage{fancyhdr} 444 | 445 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 446 | % EXAMPLE: % 447 | % ---------------------------------------------------------------------------- % 448 | % 1. \forcenewpage % 449 | % % 450 | % DESCRIPTION: % 451 | % ---------------------------------------------------------------------------- % 452 | % Force a new page, because sometimes latex doesn't do it. % 453 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 454 | \newcommand\forcenewpage{\clearpage\mbox{~}\clearpage\newpage} 455 | 456 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 457 | % EXAMPLE: % 458 | % ---------------------------------------------------------------------------- % 459 | % 1. \createintro % 460 | % % 461 | % DESCRIPTION: % 462 | % ---------------------------------------------------------------------------- % 463 | % This command does a million things. % 464 | % % 465 | % First, it creates a title page with the following properties: % 466 | % ---------------------------------------------------------------------------- % 467 | % 1. It sets the numbering style to roman, removes the header line, and creates% 468 | % a nice footer center style. % 469 | % 2. It checks if you passed the `twocolumn` parameter. If so, it sets the % 470 | % title page to one column. % 471 | % 3. It checks if a intro.tex file exists. If so, it includes it. % 472 | % 4. It creates a 3d box with more information. % 473 | % 5. It includes the table of contents. % 474 | % 6. It checks if you passed the `twocolumn` parameter. If so, it sets % 475 | % everything back to two column. Otherwise, it just creates a new page. % 476 | % % 477 | % Now, it gets everything prepared to include the actual notes. % 478 | % ---------------------------------------------------------------------------- % 479 | % 1. It sets the numbering style back to arabic, adds the header line, and % 480 | % changes the fancy style. % 481 | % 1. It adds the current lecture title in the top right. % 482 | % 2. It adds the author's name in the top left. % 483 | % 3. It adds the page number in the bottom center. % 484 | % 2. It checks if you passed the `graygf` parameter. If so, it creates a nice % 485 | % transparent gray color on the right of all left pages and on the left of % 486 | % all right pages. % 487 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 488 | \newcommand\createintro{ 489 | \@ifclasswith\class{twocolumn}{\onecolumn}{} 490 | \pagenumbering{roman} 491 | 492 | % Create title page. 493 | \begin{center} 494 | {\LARGE\@title} \\ 495 | {\Large\vspace{0.25cm}\@author} \\ 496 | {\large\vspace{0.25cm}\@date} 497 | \end{center} 498 | 499 | % Check if the intro.tex file exists. 500 | % If it does, include it, otherwise, just ignore. 501 | \IfFileExists{./intro.tex}{\input{intro.tex}}{} 502 | 503 | % Set the pagestyle to fancy. 504 | \pagestyle{fancy} 505 | % Remove the header line. 506 | \renewcommand\headrulewidth{0pt} 507 | 508 | % Reset fancyhead styles. 509 | \fancyhead{} 510 | % Add a fancyfoot center style. 511 | \fancyfoot[C]{ 512 | \textit{For more notes like this, visit \href{\linktootherpages}{\shortlinkname}}. 513 | } 514 | 515 | % Create a box with more information. 516 | \vspace{0.5cm} 517 | \begin{tcolorbox}[enhanced,colback=white,center upper,size=fbox, drop shadow southwest,sharp corners] 518 | \term: \academicyear, \\ 519 | Last Update: \today, \\ 520 | \faculty, \location. 521 | \end{tcolorbox} 522 | 523 | % Create a table of contents. 524 | \tableofcontents 525 | 526 | \@ifclasswith\class{twocolumn}{% 527 | % If user passed twocolumn as a parameter to \documentclass, then set the 528 | % rest of the page to two column. 529 | \twocolumn% 530 | }{% 531 | % Otherwise, just create a new page. 532 | \newpage% 533 | } 534 | 535 | % Change the numbering style back to arabic from roman. 536 | \pagenumbering{arabic} 537 | % Reset page numbers back to 1. 538 | \setcounter{page}{1} 539 | 540 | % Add back the header line. 541 | \renewcommand\headrulewidth{0.4pt} 542 | % Add the lecture name in the top right. 543 | \fancyhead[R]{\@lecture} 544 | % Add the author name in the top left. 545 | \fancyhead[L]{\@author} 546 | % Add the page number in the bottom center. 547 | \fancyfoot[C]{\thepage} 548 | \@ifclasswith\class{grayfg}{% 549 | % If user passed twocolumn as a parameter to \documentclass, then set the 550 | % rest of the page to two column. 551 | \definegraybackground% 552 | }{} 553 | } 554 | 555 | %%%%%%%%%%%%%%%%%%%% 556 | % Import Figures % 557 | %%%%%%%%%%%%%%%%%%%% 558 | 559 | \usepackage{import} 560 | \pdfminorversion=7 561 | 562 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 563 | % EXAMPLE: % 564 | % ---------------------------------------------------------------------------- % 565 | % 1. \incfig{airplane} % 566 | % 2. \incfig[0.5]{airplane} % 567 | % % 568 | % PARAMETERS: % 569 | % ---------------------------------------------------------------------------- % 570 | % 1. (Optional) The width of the image with respect to textwidth. If you put % 571 | % 0.3, it'll be 0.3 * \textwidth. % 572 | % 2. The figure name. % 573 | % % 574 | % DESCRIPTION: % 575 | % ---------------------------------------------------------------------------- % 576 | % It looks for a file in: % 577 | % ./figures/lec-(current lecture number)/fig-name.pdf_tex % 578 | % If you're current lecture was 4, and the figure name was airplane, here's how% 579 | % it would look like: % 580 | % ./figures/lec-04/airplane.pdf_tex % 581 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 582 | \newcommand\incfig[2][1]{ 583 | \def\figlocation{./figures/lec-\@lecnum} 584 | \def\svgwidth{#1\columnwidth} 585 | \import{\figlocation}{#2.pdf_tex} 586 | } 587 | 588 | \makeatother 589 | 590 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 591 | % Add vectors using the parallelogram and head to tail method % 592 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 593 | 594 | \usepackage{pdftexcmds} 595 | 596 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 597 | % EXAMPLE: % 598 | % ---------------------------------------------------------------------------- % 599 | % % 600 | % PARAMETERS: % 601 | % ---------------------------------------------------------------------------- % 602 | % % 603 | % DESCRIPTION: % 604 | % ---------------------------------------------------------------------------- % 605 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 606 | \newcommand\parallelogramRule[6]{ 607 | \begin{tikzpicture}[inner sep=1pt,>=stealth] 608 | \draw[<->] (#1)--(#2) node[right]{$x$}; 609 | \draw[<->] (#3)--(#4) node[above]{$y$}; 610 | 611 | \coordinate (O) at (#1); 612 | \coordinate (A) at (#5); 613 | \coordinate (B) at (#6); 614 | \coordinate (A+B) at ($(A)+(B)$); 615 | 616 | \draw[vector,blue] (O)--(A) node[vector label] {$\vec{x}$}; 617 | \draw[vector,red] (O)--(B) node[vector label] {$\vec{y}$}; 618 | 619 | \draw[construction] (A)--(A+B); 620 | \draw[construction] (B)--(A+B); 621 | 622 | \draw[vector,purple] (O)--(A+B) node[vector label] {$\vec{x}+\vec{y}$}; 623 | \end{tikzpicture} 624 | } 625 | 626 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 627 | % EXAMPLE: % 628 | % ---------------------------------------------------------------------------- % 629 | % % 630 | % PARAMETERS: % 631 | % ---------------------------------------------------------------------------- % 632 | % % 633 | % DESCRIPTION: % 634 | % ---------------------------------------------------------------------------- % 635 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 636 | \newcommand\headToTailRule[6]{ 637 | \begin{tikzpicture}[inner sep=1pt,>=stealth] 638 | \draw[<->] (#1)--(#2) node[right]{$x$}; 639 | \draw[<->] (#3)--(#4) node[above]{$y$}; 640 | 641 | \coordinate (O) at (#1); 642 | \coordinate (A) at (#5); 643 | \coordinate (B) at (#6); 644 | \coordinate (A+B) at ($(A)+(B)$); 645 | 646 | \draw[vector,blue] (O)--(A) node[vector label] {$\vec{x}$}; 647 | \draw[construction] (O)--(B); 648 | 649 | \draw[vector,red] (A)--(A+B) node[vector label] {$\vec{y}$}; 650 | \draw[construction] (B)--(A+B); 651 | 652 | \draw[vector,purple] (O)--(A+B) node[vector label] {$\vec{x}+\vec{y}$}; 653 | \end{tikzpicture} 654 | } 655 | 656 | \makeatletter 657 | 658 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 659 | % EXAMPLE: % 660 | % ---------------------------------------------------------------------------- % 661 | % % 662 | % PARAMETERS: % 663 | % ---------------------------------------------------------------------------- % 664 | % % 665 | % DESCRIPTION: % 666 | % ---------------------------------------------------------------------------- % 667 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 668 | \newcommand\addVectors[7][parallelogram]{ 669 | \ifnum\pdf@strcmp{\unexpanded{#1}}{parallelogram}=0% 670 | \expandafter\@firstoftwo 671 | \fi 672 | {\parallelogramRule{#2}{#3}{#4}{#5}{#6}{#7}} 673 | \ifnum\pdf@strcmp{\unexpanded{#1}}{headToTail}=0% 674 | \expandafter\@firstoftwo 675 | \fi 676 | {\headToTailRule{#2}{#3}{#4}{#5}{#6}{#7}} 677 | } 678 | 679 | \makeatother 680 | 681 | %%%%%%%%%%%% 682 | % Circle % 683 | %%%%%%%%%%%% 684 | 685 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 686 | % EXAMPLE: % 687 | % ---------------------------------------------------------------------------- % 688 | % % 689 | % PARAMETERS: % 690 | % ---------------------------------------------------------------------------- % 691 | % % 692 | % DESCRIPTION: % 693 | % ---------------------------------------------------------------------------- % 694 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 695 | \newcommand*\circled[1]{\tikz[baseline=(char.base)]{ 696 | \node[shape=circle,draw,inner sep=1pt] (char) {#1};} 697 | } 698 | 699 | %%%%%%%%%%%%% 700 | % Correct % 701 | %%%%%%%%%%%%% 702 | 703 | \definecolor{correct}{HTML}{009900} 704 | 705 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 706 | % EXAMPLE: % 707 | % ---------------------------------------------------------------------------- % 708 | % % 709 | % PARAMETERS: % 710 | % ---------------------------------------------------------------------------- % 711 | % % 712 | % DESCRIPTION: % 713 | % ---------------------------------------------------------------------------- % 714 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 715 | \newcommand\correct[2]{{\color{red}{#1 }}\ensuremath{\to}{\color{correct}{ #2}}} 716 | 717 | %%%%%%%%%%%%%%% 718 | % Important % 719 | %%%%%%%%%%%%%%% 720 | 721 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 722 | % EXAMPLE: % 723 | % ---------------------------------------------------------------------------- % 724 | % % 725 | % PARAMETERS: % 726 | % ---------------------------------------------------------------------------- % 727 | % % 728 | % DESCRIPTION: % 729 | % ---------------------------------------------------------------------------- % 730 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 731 | \newcommand\imp[1]{{\color{red}#1}} 732 | 733 | %%%%%%%%%%%%%%%%%%% 734 | % Todo Commands % 735 | %%%%%%%%%%%%%%%%%%% 736 | 737 | \usepackage[colorinlistoftodos]{todonotes} 738 | 739 | \makeatletter 740 | 741 | \@ifclasswith\class{working}{ 742 | \newcommand\unsure[2][]{\todo[linecolor=red,backgroundcolor=red!25,bordercolor=red,#1]{#2}} 743 | \newcommand\change[2][]{\todo[linecolor=yellow,backgroundcolor=yellow!25,bordercolor=yellow,#1]{#2}} 744 | \newcommand\add[2][]{\todo[linecolor=blue,backgroundcolor=blue!25,bordercolor=blue,#1]{#2}} 745 | \newcommand\info[2][]{\todo[linecolor=OliveGreen,backgroundcolor=OliveGreen!25,bordercolor=OliveGreen,#1]{#2}} 746 | \newcommand\improvement[2][]{\todo[linecolor=Plum,backgroundcolor=Plum!25,bordercolor=Plum,#1]{#2}} 747 | 748 | \newcommand\listnotes{ 749 | \newpage 750 | \listoftodos[Notes] 751 | } 752 | }{ 753 | \newcommand\unsure[2][]{} 754 | \newcommand\change[2][]{} 755 | \newcommand\info[2][]{} 756 | \newcommand\improvement[2][]{} 757 | 758 | \newcommand\listnotes{} 759 | } 760 | 761 | \makeatother 762 | 763 | 764 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 765 | % % 766 | % Environments % 767 | % % 768 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 769 | 770 | \usepackage{varwidth} 771 | \usepackage{thmtools} 772 | \usepackage[most,many,breakable]{tcolorbox} 773 | 774 | \tcbuselibrary{theorems,skins,hooks} 775 | 776 | %%%%%%%%%%%%%%%%%%% 777 | % Define Colors % 778 | %%%%%%%%%%%%%%%%%%% 779 | 780 | \definecolor{myblue}{RGB}{45, 111, 177} 781 | \definecolor{mygreen}{RGB}{56, 140, 70} 782 | \definecolor{myred}{RGB}{199, 68, 64} 783 | \definecolor{mypurple}{RGB}{197, 92, 212} 784 | 785 | \definecolor{theorem}{HTML}{00007B} 786 | \definecolor{example}{HTML}{2A7F7F} 787 | \definecolor{prop}{HTML}{191971} 788 | \definecolor{lemma}{HTML}{983b0f} 789 | \definecolor{exercise}{HTML}{88D6D1} 790 | 791 | \colorlet{definition}{mygreen!85!black} 792 | \colorlet{claim}{mygreen!85!black} 793 | \colorlet{corollary}{mypurple!85!black} 794 | \colorlet{proof}{theorem} 795 | \colorlet{notation}{theorem} 796 | \colorlet{remark}{example} 797 | 798 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 799 | % Create Environments Styles Based on Given Parameter % 800 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 801 | 802 | \mdfsetup{skipabove=1em,skipbelow=0em} 803 | 804 | %%%%%%%%%%%%%%%%%%%%%% 805 | % Helpful Commands % 806 | %%%%%%%%%%%%%%%%%%%%%% 807 | 808 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 809 | % EXAMPLE: % 810 | % ---------------------------------------------------------------------------- % 811 | % % 812 | % PARAMETERS: % 813 | % ---------------------------------------------------------------------------- % 814 | % % 815 | % DESCRIPTION: % 816 | % ---------------------------------------------------------------------------- % 817 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 818 | \newcommand\createnewtheoremstyle[3]{ 819 | \declaretheoremstyle[ 820 | headfont=\bfseries\sffamily, bodyfont=\normalfont, #2, 821 | mdframed={ 822 | #3, 823 | }, 824 | ]{#1} 825 | } 826 | 827 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 828 | % EXAMPLE: % 829 | % ---------------------------------------------------------------------------- % 830 | % % 831 | % PARAMETERS: % 832 | % ---------------------------------------------------------------------------- % 833 | % % 834 | % DESCRIPTION: % 835 | % ---------------------------------------------------------------------------- % 836 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 837 | \newcommand\createnewcoloredtheoremstyle[4]{ 838 | \declaretheoremstyle[ 839 | headfont=\bfseries\sffamily\color{#2}, bodyfont=\normalfont, #3, 840 | mdframed={ 841 | linewidth=2pt, 842 | rightline=false, leftline=true, topline=false, bottomline=false, 843 | linecolor=#2, backgroundcolor=#2!5, #4, 844 | }, 845 | ]{#1} 846 | } 847 | 848 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 849 | % Create the Environment Styles % 850 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 851 | 852 | \makeatletter 853 | \@ifclasswith\class{nocolor}{ 854 | \createnewtheoremstyle{thmclaimbox}{}{} 855 | \createnewtheoremstyle{thmcorollarybox}{}{} 856 | \createnewtheoremstyle{thmdefinitionbox}{}{} 857 | \createnewtheoremstyle{thmexercisebox}{}{} 858 | \createnewtheoremstyle{thmexamplebox}{}{} 859 | \createnewtheoremstyle{thmexplanationbox}{}{rightline=false, leftline=true, topline=false, bottomline=false} 860 | \createnewtheoremstyle{thmlemmabox}{}{} 861 | \createnewtheoremstyle{thmnotationbox}{}{rightline=false, leftline=true, topline=false, bottomline=false} 862 | \createnewtheoremstyle{thmpropbox}{}{} 863 | \createnewtheoremstyle{thmremarkbox}{}{rightline=false, leftline=true, topline=false, bottomline=false} 864 | \createnewtheoremstyle{thmreplacementproofbox}{qed=\qedsymbol}{rightline=false, leftline=true, topline=false, bottomline=false} 865 | \createnewtheoremstyle{thmtheorembox}{}{} 866 | }{ 867 | \createnewcoloredtheoremstyle{thmclaimbox}{claim}{}{} 868 | \createnewcoloredtheoremstyle{thmcorollarybox}{corollary}{}{} 869 | \createnewcoloredtheoremstyle{thmdefinitionbox}{definition}{}{} 870 | \createnewcoloredtheoremstyle{thmexamplebox}{example}{}{ 871 | rightline=true, leftline=true, topline=true, bottomline=true 872 | } 873 | \createnewcoloredtheoremstyle{thmexercisebox}{exercise}{}{} 874 | \createnewcoloredtheoremstyle{thmexplanationbox}{example}{qed=\qedsymbol}{backgroundcolor=white} 875 | \createnewcoloredtheoremstyle{thmlemmabox}{lemma}{}{} 876 | \createnewcoloredtheoremstyle{thmnotationbox}{notation}{}{backgroundcolor=white} 877 | \createnewcoloredtheoremstyle{thmpropbox}{prop}{}{} 878 | \createnewcoloredtheoremstyle{thmremarkbox}{remark}{}{backgroundcolor=white} 879 | \createnewcoloredtheoremstyle{thmreplacementproofbox}{proof}{qed=\qedsymbol}{backgroundcolor=white} 880 | \createnewcoloredtheoremstyle{thmtheorembox}{theorem}{}{} 881 | } 882 | \makeatother 883 | 884 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 885 | % Create the Environments % 886 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 887 | 888 | \declaretheorem[numberwithin=section, style=thmclaimbox, name=Claim] {claim} 889 | \declaretheorem[numberwithin=section, style=thmcorollarybox, name=Corollary] {corollary} 890 | \declaretheorem[numberwithin=section, style=thmdefinitionbox, name=Definition] {definition} 891 | \declaretheorem[numbered=no, style=thmexamplebox, name=Example] {example} 892 | \declaretheorem[numberwithin=section, style=thmexercisebox, name=Exercise] {exercise} 893 | \declaretheorem[numbered=no, style=thmexplanationbox, name=Proof] {expl} 894 | \declaretheorem[numberwithin=section, style=thmlemmabox, name=Lemma] {lemma} 895 | \declaretheorem[numbered=no, style=thmnotationbox, name=Notation] {notation} 896 | \declaretheorem[numberwithin=section, style=thmpropbox, name=Proposition]{prop} 897 | \declaretheorem[numbered=no, style=thmremarkbox, name=Remark] {remark} 898 | \declaretheorem[numbered=no, style=thmreplacementproofbox, name=Proof] {replacementproof} 899 | \declaretheorem[numberwithin=section, style=thmtheorembox, name=Theorem] {theorem} 900 | 901 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 902 | % Create Question and Solution Environments with or without color % 903 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 904 | 905 | \makeatletter 906 | \@ifclasswith\class{nocolor}{ 907 | \createnewtheoremstyle{thmquestionbox}{}{} 908 | \createnewtheoremstyle{thmsolutionbox}{}{} 909 | 910 | \declaretheorem[numberwithin=section, style=thmquestionbox, name=Question]{question} 911 | \declaretheorem[numberwithin=section, style=thmsolutionbox, name=Solution]{solution} 912 | 913 | \AtBeginEnvironment{solution}{ 914 | \vspace{-10pt} 915 | } 916 | }{ 917 | \newtcbtheorem{Question}{Question}{enhanced, 918 | breakable, 919 | colback=white, 920 | colframe=myblue!80!black, 921 | attach boxed title to top left={yshift*=-\tcboxedtitleheight}, 922 | fonttitle=\bfseries, 923 | title=\textbf{Question.}, 924 | boxed title size=title, 925 | boxed title style={% 926 | sharp corners, 927 | rounded corners=northwest, 928 | colback=tcbcolframe, 929 | boxrule=0pt, 930 | }, 931 | underlay boxed title={% 932 | \path[fill=tcbcolframe] (title.south west)--(title.south east) 933 | to[out=0, in=180] ([xshift=5mm]title.east)-- 934 | (title.center-|frame.east) 935 | [rounded corners=\kvtcb@arc] |- 936 | (frame.north) -| cycle; 937 | }, 938 | #1 939 | }{def} 940 | 941 | \NewDocumentEnvironment{question}{O{}O{}} 942 | {\begin{Question}{#1}{#2}}{\end{Question}} 943 | 944 | \newtcbtheorem{Solution}{Solution}{enhanced, 945 | breakable, 946 | colback=white, 947 | colframe=mygreen!80!black, 948 | attach boxed title to top left={yshift*=-\tcboxedtitleheight}, 949 | fonttitle=\bfseries, 950 | title=\textbf{Solution.}, 951 | boxed title size=title, 952 | boxed title style={% 953 | sharp corners, 954 | rounded corners=northwest, 955 | colback=tcbcolframe, 956 | boxrule=0pt, 957 | }, 958 | underlay boxed title={% 959 | \path[fill=tcbcolframe] (title.south west)--(title.south east) 960 | to[out=0, in=180] ([xshift=5mm]title.east)-- 961 | (title.center-|frame.east) 962 | [rounded corners=\kvtcb@arc] |- 963 | (frame.north) -| cycle; 964 | }, 965 | #1 966 | }{def} 967 | 968 | \NewDocumentEnvironment{solution}{O{}O{}} 969 | {\vspace{-10pt}\begin{Solution}{#1}{#2}}{\end{Solution}} 970 | } 971 | \makeatother 972 | 973 | %%%%%%%%%%%%%%%%%%%%%%%%%%%% 974 | % Edit Proof Environment % 975 | %%%%%%%%%%%%%%%%%%%%%%%%%%%% 976 | 977 | \renewenvironment{proof}[1][\proofname]{\vspace{-10pt}\begin{replacementproof}}{\end{replacementproof}} 978 | \newenvironment{explanation}[1][\proofname]{\vspace{-10pt}\begin{expl}}{\end{expl}} 979 | 980 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 981 | % Create Plain Environments % 982 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 983 | 984 | \theoremstyle{definition} 985 | 986 | \newtheorem*{note}{Note} 987 | \newtheorem*{pnotation}{Notation} 988 | \newtheorem*{previouslyseen}{As previously seen} 989 | \newtheorem*{problem}{Problem} 990 | \newtheorem*{observe}{Observe} 991 | \newtheorem*{property}{Property} 992 | \newtheorem*{intuition}{Intuition} 993 | \newtheorem*{questionexpl}{Explanation} 994 | 995 | %%%%%%%%%%%%%%%%%%%%%%%%% 996 | % End of Environments % 997 | %%%%%%%%%%%%%%%%%%%%%%%%% 998 | 999 | \AtEndEnvironment{exercise}{ 1000 | \addcontentsline{toc}{subsubsection}{Exercise \arabic{exercise}} 1001 | } 1002 | \AtEndEnvironment{question}{ 1003 | \addcontentsline{toc}{subsubsection}{Question \arabic{question}} 1004 | } 1005 | \AtEndEnvironment{solution}{ 1006 | \addcontentsline{toc}{subsubsection}{Solution \arabic{question}} 1007 | } 1008 | --------------------------------------------------------------------------------