blob: 471d68efc0bb34573300b60c7d902205af255e10 [file] [log] [blame]
Adrià Vilanova Martínezce8597a2021-09-21 18:26:59 +02001\usepackage{lmodern}
2\usepackage{amsmath}
3\usepackage{amsfonts}
4\usepackage{amssymb}
5\usepackage{mathtools}
6\usepackage{parskip}
7\usepackage{xcolor}
8\usepackage{tcolorbox}
9%\usepackage{hyperref}
10\usepackage{geometry}
11\usepackage{physics}
12\usepackage{systeme,mathtools}
13\usepackage[usestackEOL]{stackengine}
14\usepackage{scalerel}
15\usepackage{graphicx}
16\usepackage{enumerate}
17\usepackage{tikz}
18\usepackage[labelfont=bf]{caption}
19\usepackage{siunitx}
20\usepackage{cancel}
21\usepackage{fbox}
22\usepackage{multicol}
23\usepackage{amsthm}
24\usepackage[shortlabels]{enumitem}
25\usepackage{float}
26\usetikzlibrary{positioning}
27\geometry{top=25mm}
28
29% Plantilla per l'interior d'un conjunt
30\newcommand{\interior}[1]{%
31 {\kern0pt#1}^{\mathrm{o}}%
32}
33
34% Plantilles del notate
35\def\myupbracefill#1{\rotatebox{90}{\stretchto{\{}{#1}}}
36\def\rlwd{.5pt}
37\newcommand\notate[4][B]{%
38 \if B#1\else\def\myupbracefill##1{}\fi%
39 \def\useanchorwidth{T}%
40 \setbox0=\hbox{$\displaystyle#2$}%
41 \def\stackalignment{c}\stackunder[-6pt]{%
42 \def\stackalignment{c}\stackunder[-1.5pt]{%
43 \stackunder[2pt]{\strut $\displaystyle#2$}{\myupbracefill{\wd0}}}{%
44 \rule{\rlwd}{#3\baselineskip}}}{%
45 \strut\kern9pt$\rightarrow$\smash{\rlap{$~#4$}}}%
46}
47
48\newcommand\lnotate[4][B]{%
49 \if B#1\else\def\myupbracefill##1{}\fi%
50 \def\useanchorwidth{T}%
51 \setbox0=\hbox{$\displaystyle#2$}%
52 \def\stackalignment{c}\stackunder[-6pt]{%
53 \def\stackalignment{c}\stackunder[-1.5pt]{%
54 \stackunder[2pt]{\strut $\displaystyle#2$}{\myupbracefill{\wd0}}}{%
55 \rule{\rlwd}{#3\baselineskip}}}{%
56 \strut\kern-9pt$\leftarrow$\smash{\llap{$~#4\quad\;\,$}}}%
57}
58
59% Plantilles dels boxes
60%%%% START DEFINING LBOXED, RBOXED %%%%
61\newcommand{\lboxed}[1]{\fbox[blt]{\mathsurround=0pt$\displaystyle#1$}}
62\newcommand{\rboxed}[1]{\fbox[brt]{\mathsurround=0pt$\displaystyle#1$}}
63
64% Plantilles pels problemes
65\newcounter{problem}
66\newcounter{solution}
67
68\newcommand{\green}[1]{\textbf{\color{ForestGreen} #1}}
69
70\newcommand{\separator}{\noindent\hfil\rule{0.75\textwidth}{0.4pt}\hfil}
71
72\newenvironment{Problem}{%
73 \stepcounter{problem}%
74 \begin{tcolorbox}[colback=cyan!10!white,parbox=false]
75 \textbf{Problem \theproblem.}~%
76 \setcounter{solution}{0}}{%
77 \end{tcolorbox}
78}
79
80\newenvironment{FreeProblem}{%
81 \begin{tcolorbox}[colback=cyan!10!white,parbox=false]
82 \setcounter{solution}{0}}{%
83 \end{tcolorbox}
84}
85
86\newcommand\Solution{%
87 \textbf{Solution:}\\%
88}
89
90\newcommand\Context{%
91 \textbf{Context:}\\%
92}
93
94\newcommand\Lema{%
95 \textbf{Lema:} %
96}
97
98\newcommand\Proposition{%
99 \textbf{Proposition:} %
100}
101
102\newcommand\Theorem{%
103 \textbf{Theorem:} %
104}
105
106\newcommand\Proof{%
107 \textbf{Proof:}\\%
108}
109
110\newcommand\QED{\square}
111
112\newcommand\ASolution{%
113 \stepcounter{solution}%
114 \textbf{Solution \thesolution:}\\%
115}
116
117
118\newcommand{\asection}[2]{
119\setcounter{section}{#1}
120\addtocounter{section}{-1}
121\section{#2}
122}
123
124% Tensor commands:
125\newcommand*{\TT}[1]{\bar{\bar{#1}}}
126\newcommand*{\dev}[0]{\text{dev}\,}
127
128% Corrections:
129\newif\ifshowcorrections
130
131\newcommand{\correction}[1]{%
132 \ifshowcorrections%
133 {\color{red} #1}%
134 \else%
135 #1%
136 \fi%
137}%
138
139\newcommand{\formulacorrection}[1]{%
140 \ifshowcorrections%
141 \textcolor{red}{#1}%
142 \else%
143 #1%
144 \fi%
145}%