blob: e5522aa4d429d6fe24e1a1375ba4b9bd4c957338 [file] [log] [blame]
avm99963661edfb2021-09-21 18:37:09 +02001\usepackage{lmodern}
2\usepackage{amsmath}
3\usepackage{amsfonts}
4\usepackage{amssymb}
5\usepackage{mathtools}
6\usepackage{parskip}
7\usepackage[dvipsnames]{xcolor}
8\usepackage{tcolorbox}
Adrià Vilanova Martínez973763e2021-09-29 01:49:31 +02009\usepackage{hyperref}
avm99963661edfb2021-09-21 18:37:09 +020010\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}
Adrià Vilanova Martínezbdec3082021-09-27 01:55:08 +020019\usepackage[separate-uncertainty=true]{siunitx}
avm99963661edfb2021-09-21 18:37:09 +020020\usepackage{cancel}
21\usepackage{fancybox}
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\newcommand\lnotate[4][B]{%
48 \if B#1\else\def\myupbracefill##1{}\fi%
49 \def\useanchorwidth{T}%
50 \setbox0=\hbox{$\displaystyle#2$}%
51 \def\stackalignment{c}\stackunder[-6pt]{%
52 \def\stackalignment{c}\stackunder[-1.5pt]{%
53 \stackunder[2pt]{\strut $\displaystyle#2$}{\myupbracefill{\wd0}}}{%
54 \rule{\rlwd}{#3\baselineskip}}}{%
55 \strut\kern-9pt$\leftarrow$\smash{\llap{$~#4\quad\;\,$}}}%
56}
57
58% Plantilles dels boxes
59%%%% START DEFINING LBOXED, RBOXED %%%%
60\newcommand{\lboxed}[1]{\fbox[blt]{\mathsurround=0pt$\displaystyle#1$}}
61\newcommand{\rboxed}[1]{\fbox[brt]{\mathsurround=0pt$\displaystyle#1$}}
62
63% Plantilles pels problemes
64\newcounter{problem}
65\newcounter{solution}
66
67\newcommand{\green}[1]{\textbf{\color{ForestGreen} #1}}
68
69\newcommand{\separator}{\noindent\hfil\rule{0.75\textwidth}{0.4pt}\hfil}
70
Adrià Vilanova Martínezb0b78ab2021-10-06 21:50:09 +020071% Versió impresora:
72\newif\ifprintversion
73
avm99963661edfb2021-09-21 18:37:09 +020074\newenvironment{Problem}{%
75 \stepcounter{problem}%
Adrià Vilanova Martínezb0b78ab2021-10-06 21:50:09 +020076 \ifprintversion
77 \begin{tcolorbox}[colback=white!10!white,parbox=false]
78 \else
79 \begin{tcolorbox}[colback=cyan!10!white,parbox=false]
80 \fi
avm99963661edfb2021-09-21 18:37:09 +020081 \textbf{Problema \theproblem.}~%
82 \setcounter{solution}{0}}{%
83 \end{tcolorbox}
84}
85
86\newenvironment{FreeProblem}{%
Adrià Vilanova Martínezb0b78ab2021-10-06 21:50:09 +020087 \ifprintversion
88 \begin{tcolorbox}[colback=white!10!white,parbox=false]
89 \else
90 \begin{tcolorbox}[colback=cyan!10!white,parbox=false]
91 \fi
avm99963661edfb2021-09-21 18:37:09 +020092 \setcounter{solution}{0}}{%
93 \end{tcolorbox}
94}
95
96\newcommand\Solution{%
97 \textbf{Solució:}\\%
98}
99
100\newcommand\Context{%
101 \textbf{Context:}\\%
102}
103
104\newcommand\Lema{%
105 \textbf{Lema:} %
106}
107
108\newcommand\Proposition{%
109 \textbf{Proposició:} %
110}
111
112\newcommand\Theorem{%
113 \textbf{Teorema:} %
114}
115
116\newcommand\Proof{%
117 \textbf{Demostració:}\\%
118}
119
120\newcommand\QED{\square}
121
122\newcommand\ASolution{%
123 \stepcounter{solution}%
124 \textbf{Solució \thesolution:}\\%
125}
126
127
128\newcommand{\asection}[2]{
129\setcounter{section}{#1}
130\addtocounter{section}{-1}
131\section{#2}
132}
133
134% Tensor commands:
135\newcommand*{\TT}[1]{\bar{\bar{#1}}}
136\newcommand*{\dev}[0]{\text{dev}\,}
137
138% Corrections:
139\newif\ifshowcorrections
140
141\newcommand{\correction}[1]{%
142 \ifshowcorrections%
143 {\color{red} #1}%
144 \else%
145 #1%
146 \fi%
147}%
148
149\newcommand{\formulacorrection}[1]{%
150 \ifshowcorrections%
151 \textcolor{red}{#1}%
152 \else%
153 #1%
154 \fi%
155}%