Add quad9/hw_preamble.tex

Change-Id: I0792471db3c5010080310cc505662e43b68ef736
diff --git a/quad9/hw_preamble.tex b/quad9/hw_preamble.tex
new file mode 100644
index 0000000..44e88e2
--- /dev/null
+++ b/quad9/hw_preamble.tex
@@ -0,0 +1,144 @@
+\usepackage{lmodern}
+\usepackage{amsmath}
+\usepackage{amsfonts}
+\usepackage{amssymb}
+\usepackage{mathtools}
+\usepackage{parskip}
+\usepackage[dvipsnames]{xcolor}
+\usepackage{tcolorbox}
+%\usepackage{hyperref}
+\usepackage{geometry}
+\usepackage{physics}
+\usepackage{systeme,mathtools}
+\usepackage[usestackEOL]{stackengine}
+\usepackage{scalerel}
+\usepackage{graphicx}
+\usepackage{enumerate}
+\usepackage{tikz}
+\usepackage[labelfont=bf]{caption}
+\usepackage{siunitx}
+\usepackage{cancel}
+\usepackage{fancybox}
+\usepackage{multicol}
+\usepackage{amsthm}
+\usepackage[shortlabels]{enumitem}
+\usepackage{float}
+\usetikzlibrary{positioning}
+\geometry{top=25mm}
+
+% Plantilla per l'interior d'un conjunt
+\newcommand{\interior}[1]{%
+  {\kern0pt#1}^{\mathrm{o}}%
+}
+
+% Plantilles del notate
+\def\myupbracefill#1{\rotatebox{90}{\stretchto{\{}{#1}}}
+\def\rlwd{.5pt}
+\newcommand\notate[4][B]{%
+  \if B#1\else\def\myupbracefill##1{}\fi%
+  \def\useanchorwidth{T}%
+  \setbox0=\hbox{$\displaystyle#2$}%
+  \def\stackalignment{c}\stackunder[-6pt]{%
+    \def\stackalignment{c}\stackunder[-1.5pt]{%
+      \stackunder[2pt]{\strut $\displaystyle#2$}{\myupbracefill{\wd0}}}{%
+    \rule{\rlwd}{#3\baselineskip}}}{%
+  \strut\kern9pt$\rightarrow$\smash{\rlap{$~#4$}}}%
+}
+\newcommand\lnotate[4][B]{%
+  \if B#1\else\def\myupbracefill##1{}\fi%
+  \def\useanchorwidth{T}%
+  \setbox0=\hbox{$\displaystyle#2$}%
+  \def\stackalignment{c}\stackunder[-6pt]{%
+    \def\stackalignment{c}\stackunder[-1.5pt]{%
+      \stackunder[2pt]{\strut $\displaystyle#2$}{\myupbracefill{\wd0}}}{%
+    \rule{\rlwd}{#3\baselineskip}}}{%
+  \strut\kern-9pt$\leftarrow$\smash{\llap{$~#4\quad\;\,$}}}%
+}
+
+% Plantilles dels boxes
+%%%% START DEFINING LBOXED, RBOXED %%%%
+\newcommand{\lboxed}[1]{\fbox[blt]{\mathsurround=0pt$\displaystyle#1$}}
+\newcommand{\rboxed}[1]{\fbox[brt]{\mathsurround=0pt$\displaystyle#1$}}
+
+% Plantilles pels problemes
+\newcounter{problem}
+\newcounter{solution}
+
+\newcommand{\green}[1]{\textbf{\color{ForestGreen} #1}}
+
+\newcommand{\separator}{\noindent\hfil\rule{0.75\textwidth}{0.4pt}\hfil}
+
+\newenvironment{Problem}{%
+    \stepcounter{problem}%
+    \begin{tcolorbox}[colback=cyan!10!white,parbox=false]
+        \textbf{Problema \theproblem.}~%
+        \setcounter{solution}{0}}{%
+    \end{tcolorbox}
+}
+
+\newenvironment{FreeProblem}{%
+    \begin{tcolorbox}[colback=cyan!10!white,parbox=false]
+        \setcounter{solution}{0}}{%
+    \end{tcolorbox}
+}
+
+\newcommand\Solution{%
+    \textbf{Solució:}\\%
+}
+
+\newcommand\Context{%
+    \textbf{Context:}\\%
+}
+
+\newcommand\Lema{%
+    \textbf{Lema:} %
+}
+
+\newcommand\Proposition{%
+    \textbf{Proposició:} %
+}
+
+\newcommand\Theorem{%
+    \textbf{Teorema:} %
+}
+
+\newcommand\Proof{%
+    \textbf{Demostració:}\\%
+}
+
+\newcommand\QED{\square}
+
+\newcommand\ASolution{%
+    \stepcounter{solution}%
+    \textbf{Solució \thesolution:}\\%
+}
+
+
+\newcommand{\asection}[2]{
+\setcounter{section}{#1}
+\addtocounter{section}{-1}
+\section{#2}
+}
+
+% Tensor commands:
+\newcommand*{\TT}[1]{\bar{\bar{#1}}}
+\newcommand*{\dev}[0]{\text{dev}\,}
+
+% Corrections:
+\newif\ifshowcorrections
+
+\newcommand{\correction}[1]{%
+  \ifshowcorrections%
+    {\color{red} #1}%
+  \else%
+    #1%
+  \fi%
+}%
+
+\newcommand{\formulacorrection}[1]{%
+  \ifshowcorrections%
+    \textcolor{red}{#1}%
+  \else%
+    #1%
+  \fi%
+}%