| 1 |
\documentclass{article} |
| 2 |
|
| 3 |
\usepackage{luacas} |
| 4 |
\usepackage{amsmath} |
| 5 |
\usepackage{amssymb} |
| 6 |
|
| 7 |
\usepackage[margin=1in]{geometry} |
| 8 |
\usepackage[shortlabels]{enumitem} |
| 9 |
|
| 10 |
\usepackage{pgfplots} |
| 11 |
\pgfplotsset{compat=1.18} |
| 12 |
\usetikzlibrary{positioning,calc} |
| 13 |
\usepackage{forest} |
| 14 |
\usepackage{minted} |
| 15 |
\usemintedstyle{pastie} |
| 16 |
\usepackage[hidelinks]{hyperref} |
| 17 |
\usepackage{parskip} |
| 18 |
\usepackage{multicol} |
| 19 |
\usepackage[most]{tcolorbox} |
| 20 |
\tcbuselibrary{xparse,documentation} |
| 21 |
\usepackage{microtype} |
| 22 |
\usepackage{makeidx} |
| 23 |
|
| 24 |
\usepackage[ |
| 25 |
backend=biber, |
| 26 |
style=numeric, |
| 27 |
]{biblatex} |
| 28 |
\addbibresource{sources.bib} |
| 29 |
|
| 30 |
\definecolor{rose}{RGB}{128,0,0} |
| 31 |
\definecolor{roseyellow}{RGB}{222,205,99} |
| 32 |
\definecolor{roseblue}{RGB}{167,188,214} |
| 33 |
\definecolor{rosenavy}{RGB}{79,117,139} |
| 34 |
\definecolor{roseorange}{RGB}{232,119,34} |
| 35 |
\definecolor{rosegreen}{RGB}{61,68,30} |
| 36 |
\definecolor{rosewhite}{RGB}{223,209,167} |
| 37 |
\definecolor{rosebrown}{RGB}{108,87,27} |
| 38 |
\definecolor{rosegray}{RGB}{84,88,90} |
| 39 |
|
| 40 |
\definecolor{codegreen}{HTML}{49BE25} |
| 41 |
|
| 42 |
\newtcolorbox{codebox}[1][sidebyside]{ |
| 43 |
enhanced,skin=bicolor, |
| 44 |
#1, |
| 45 |
arc=1pt, |
| 46 |
colframe=brown, |
| 47 |
colback=brown!15,colbacklower=white, |
| 48 |
boxrule=1pt, |
| 49 |
notitle |
| 50 |
} |
| 51 |
|
| 52 |
\newtcolorbox{codehead}[1][]{ |
| 53 |
enhanced, |
| 54 |
frame hidden, |
| 55 |
colback=rosegray!15, |
| 56 |
boxrule=0mm, |
| 57 |
leftrule=5mm, |
| 58 |
rightrule=5mm, |
| 59 |
boxsep=0mm, |
| 60 |
arc=0mm, |
| 61 |
outer arc=0mm, |
| 62 |
left=3mm, |
| 63 |
right=3mm, |
| 64 |
top=1mm, |
| 65 |
bottom=1mm, |
| 66 |
toptitle=1mm, |
| 67 |
bottomtitle=1mm, |
| 68 |
oversize, |
| 69 |
#1 |
| 70 |
} |
| 71 |
|
| 72 |
\usepackage{varwidth} |
| 73 |
|
| 74 |
\newtcolorbox{newcodehead}[2][]{ |
| 75 |
enhanced, |
| 76 |
frame hidden, |
| 77 |
colback=rosegray!15, |
| 78 |
boxrule=0mm, |
| 79 |
leftrule=5mm, |
| 80 |
rightrule=5mm, |
| 81 |
boxsep=0mm, |
| 82 |
arc=0mm, |
| 83 |
outer arc=0mm, |
| 84 |
left=3mm, |
| 85 |
right=3mm, |
| 86 |
top=1mm, |
| 87 |
bottom=1mm, |
| 88 |
toptitle=1mm, |
| 89 |
bottomtitle=1mm, |
| 90 |
oversize, |
| 91 |
#1, |
| 92 |
fonttitle=\bfseries\ttfamily\footnotesize, |
| 93 |
coltitle=rosegray, |
| 94 |
attach boxed title to top text right, |
| 95 |
boxed title style={frame hidden,size=small,bottom=-1mm, |
| 96 |
interior style={fill=none, |
| 97 |
top color=white, |
| 98 |
bottom color=white}}, |
| 99 |
title={#2} |
| 100 |
} |
| 101 |
|
| 102 |
\makeindex |
| 103 |
|
| 104 |
\def\currref{Core Methods} |
| 105 |
|
| 106 |
\newcommand{\coderef}[2]{% |
| 107 |
\index{\currref!\texttt{#1}}% |
| 108 |
\begin{codehead}[sidebyside,segmentation hidden]% |
| 109 |
\mintinline{lua}{#1}% |
| 110 |
\tcblower% |
| 111 |
\begin{flushright}% |
| 112 |
\mintinline{lua}{#2}% |
| 113 |
\end{flushright}% |
| 114 |
\end{codehead}% |
| 115 |
} |
| 116 |
|
| 117 |
\newcommand{\newcoderef}[3]{% |
| 118 |
\index{\currref!\texttt{#1}}% |
| 119 |
\begin{newcodehead}[sidebyside,segmentation hidden]{#3}% |
| 120 |
\mintinline{lua}{#1}% |
| 121 |
\tcblower% |
| 122 |
\begin{flushright}% |
| 123 |
\mintinline{lua}{#2}% |
| 124 |
\end{flushright}% |
| 125 |
\end{newcodehead}% |
| 126 |
} |
| 127 |
|
| 128 |
\begin{document} |
| 129 |
\thispagestyle{empty} |
| 130 |
\part{Introduction} |
| 131 |
|
| 132 |
\begin{multicols}{2} |
| 133 |
\begin{minted}{latex} |
| 134 |
\begin{CAS} |
| 135 |
vars('x') |
| 136 |
f = x |
| 137 |
for i in range(1,9) do |
| 138 |
f = f*x |
| 139 |
end |
| 140 |
f = f-1 |
| 141 |
\end{CAS} |
| 142 |
\parseforest{f} |
| 143 |
\bracketset{action character = @} |
| 144 |
\begin{center} |
| 145 |
\begin{forest} |
| 146 |
for tree = {font = \ttfamily} |
| 147 |
@\forestresult |
| 148 |
\end{forest} |
| 149 |
\end{center} |
| 150 |
|
| 151 |
\begin{CAS} |
| 152 |
f = factor(f) |
| 153 |
\end{CAS} |
| 154 |
\parseforest{f} |
| 155 |
\begin{center} |
| 156 |
\bracketset{action character = @} |
| 157 |
\begin{forest} |
| 158 |
for tree = {font = \ttfamily} |
| 159 |
@\forestresult |
| 160 |
\end{forest} |
| 161 |
\end{center} |
| 162 |
\end{minted} |
| 163 |
|
| 164 |
\columnbreak |
| 165 |
\phantom{} |
| 166 |
\vfill |
| 167 |
\begin{CAS} |
| 168 |
vars('x') |
| 169 |
f = x |
| 170 |
for i in range(1,9) do |
| 171 |
f = f*x |
| 172 |
end |
| 173 |
f = f-1 |
| 174 |
\end{CAS} |
| 175 |
\parseforest{f} |
| 176 |
\bracketset{action character = @} |
| 177 |
\begin{center} |
| 178 |
\begin{forest} |
| 179 |
for tree = {font = \ttfamily} |
| 180 |
@\forestresult |
| 181 |
\end{forest} |
| 182 |
\end{center} |
| 183 |
\vfill |
| 184 |
\phantom{} |
| 185 |
\end{multicols} |
| 186 |
\vfill |
| 187 |
|
| 188 |
\begin{CAS} |
| 189 |
f = factor(f) |
| 190 |
\end{CAS} |
| 191 |
\parseforest{f} |
| 192 |
\begin{center} |
| 193 |
\bracketset{action character = @} |
| 194 |
\begin{forest} |
| 195 |
for tree = {font = \ttfamily} |
| 196 |
@\forestresult |
| 197 |
\end{forest} |
| 198 |
\end{center} |
| 199 |
\vfill |
| 200 |
|
| 201 |
|
| 202 |
\end{document} |