You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.3 KiB

1 year ago
  1. \newcommand{\prac}{{\color{red}[Practicals]} }
  2. \newcommand{\lect}{{\color{blue}[Lecture]} }
  3. \newcommand{\self}{{\color{teal}[Self-Assessment]} }
  4. \newcommand{\points}[1]{{\color{red}[#1 Points]}}
  5. \newcommand{\point}[1]{{\color{red}[#1 Point]}}
  6. \newcommand{\setsectionnum}[1]{%
  7. \unless\iftitle%
  8. \setcounter{section}{#1}%
  9. \fi%
  10. }
  11. \newcommand\solution[2]{%
  12. \def\FILENAME{#1}%
  13. \def\SPACING{#2}%
  14. \input{solution_boilerplate}%
  15. }
  16. \newcommand\question[3]{%
  17. \def\FILENAME{#1}%
  18. \input{\FILENAME}%
  19. \solution{#2}{#3}%
  20. }
  21. \newcommand\mcquestion[2]{%
  22. \def\QUESTION{#1}%
  23. \def\SOLUTION{#2}%
  24. \ifsolution
  25. \input{\SOLUTION}
  26. \else
  27. \input{\QUESTION}
  28. \fi
  29. }
  30. \newcommand\dpllquestion[2]{%
  31. \def\QUESTION{#1}%
  32. \def\SOLUTION{#2}%
  33. \ifsolution
  34. \input{\SOLUTION}
  35. \else
  36. \input{\QUESTION}
  37. \fi
  38. }
  39. \newcommand*\widefbox[1]{%
  40. \def\TOPBOTMARGIN{.5}
  41. \def\LEFTMARGIN{0.5ex}
  42. \def\SOLUTIONTEXT{#1}
  43. \fbox{\parbox{%
  44. \dimexpr\textwidth-11\fboxsep-4\fboxrule\relax}{
  45. \vspace{\TOPBOTMARGIN\baselineskip}\hspace{\LEFTMARGIN}\SOLUTIONTEXT\vspace{\TOPBOTMARGIN\baselineskip}}
  46. }
  47. }
  48. \newenvironment{pythonSourceCode}
  49. {\VerbatimEnvironment\begin{minted}[mathescape, linenos, numbersep=5pt, gobble=2, frame=lines, framesep=2mm]{python}}
  50. {\end{minted}}