-
Notifications
You must be signed in to change notification settings - Fork 15
/
worksheet-preamble.tex
64 lines (49 loc) · 1.86 KB
/
worksheet-preamble.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
\newcounter{exer}
\newenvironment{exercise}{}{\vspace{4ex}}
\setlength{\parindent}{0in}
\setlength{\parskip}{1ex}
\newenvironment{solution}{}{}
\newif\ifxake\xaketrue
%\input{\string~/linear-algebra/laode/preamble.tex}
\usepackage{graphicx}
\input{preamble}
\usepackage{xcolor}
\renewenvironment{solution}{\color{blue}}{\color{black}}
\renewenvironment{computerExercise}{\begin{exercise}}{\end{exercise}}
\usepackage{amsmath}
\usepackage{environ}
\NewEnviron{prompt}{}
\NewEnviron{hint}{}
\NewEnviron{multipleChoice}{}
\NewEnviron{feedback}{}
\renewcommand{\ans}{\noindent\textbf{Answer: }}
\renewcommand{\soln}{\noindent\textbf{Solution: }}
\newcommand{\answer}[2][]{#2}
%\graphicspath{\string~/linear-algebra/laode}
% if you want to hide solutions, uncomment the following
%\usepackage{comment}\excludecomment{solution}
\def\isitmatlab{}
\newcommand{\matlab}{\def\isitmatlab{ (MATLAB)}}
\makeatletter
\newcommand{\exerciselabel}[2]{\textbf{\textsection #2, Exercise #1\isitmatlab.}\def\@currentlabel{#1}\def\isitmatlab{}}
\newcounter{problem}
\newcommand{\problemlabel}{\refstepcounter{problem}\section*{Problem \arabic{problem}}}
\newcommand{\matlabproblemlabel}{\refstepcounter{problem}\section*{Problem \arabic{problem} (MATLAB)}}
\renewcommand{\maketitle}{%
\begin{center}
\textbf{\@title} \\
\@author \\
\@date
\end{center}
}
\makeatother
%\renewenvironment{matlabEquation}{\begin{equation}\renewcommand{\label}[1]{\tag{\ref{##1}}}}{\end{equation}}
\let\oldequation\equation
\let\oldendequation\endequation
\def\equation{\begingroup\oldequation\renewcommand{\label}[1]{\tag{\ref{##1}}}}
\def\endequation{\oldendequation \endgroup}
\usepackage{zref-xr}
\zxrsetup{tozreflabel=false, toltxlabel=true, verbose}
\zexternaldocument*{linearAlgebra}
\directlua{dofile(kpse.find_file("worksheet","lua"))}
\newcommand\insertexercise[1]{\directlua{insert_exercise("#1")}}