% arxiu latexDefs.tex
% per carregar amb els arxius LaTeX del projecte math21
% FU, novembre 2020

\usepackage[a4paper,vscale=0.8,hscale=0.85]{geometry}

\usepackage[utf8]{inputenc}
\usepackage[catalan]{babel}

\usepackage{amssymb}
\usepackage{euler}

\usepackage{graphicx}

\usepackage{url}
\usepackage{hyperref}
\hypersetup{
    bookmarks=true,         % show bookmarks bar?
    unicode=false,          % non-Latin characters in Acrobat’s bookmarks
    pdftoolbar=true,        % show Acrobat’s toolbar?
    pdfmenubar=true,        % show Acrobat’s menu?
    pdffitwindow=false,     % window fit to page when opened
    pdfstartview={FitH},    % fits the width of the page to the window
    pdftitle={Math21 project - UPF},    % title
    pdfauthor={Frederic Udina et al.},     % author
    pdfsubject={course notes},   % subject of the document
    pdfcreator={pdfTeX},   % creator of the document
    pdfproducer={DEE-UPF}, % producer of the document
    pdfkeywords={keywords}, % list of keywords
    pdfnewwindow=true,      % links in new window
    colorlinks=true,       % false: boxed links; true: colored links
    linkcolor=blue,          % color of internal links
    citecolor=green,        % color of links to bibliography
    filecolor=magenta,      % color of file links
    urlcolor=cyan           % color of external links
  }

% to show an image nd link to its file
\def\grafLink#1{\href{figures/#1}{\includegraphics[width=0.4\linewidth]{figures/#1}}}


\usepackage{verbatim}

\usepackage{listings}
\usepackage{xcolor}

\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}

\lstdefinestyle{mystyle}{
    backgroundcolor=\color{backcolour},   
    commentstyle=\color{codegreen},
    keywordstyle=\color{magenta},
    numberstyle=\tiny\color{codegray},
    stringstyle=\color{codepurple},
    basicstyle=\ttfamily\footnotesize,
    breakatwhitespace=false,         
    breaklines=true,                 
    captionpos=b,                    
    keepspaces=true,                                     
    numbersep=5pt,                  
    showspaces=false,                
    showstringspaces=false,
    showtabs=false,                  
    tabsize=2
}

\lstset{style=mystyle}
% \begin{lstlisting}[language=R]
% fib <- function(n) {
%   if (n < 2)
%     n
%   else
%     fib(n - 1) + fib(n - 2)
% }
% fib(10) # => 55
% \end{lstlisting}

\usepackage{multicol}


\setlength{\parindent}{0em}
\setlength{\parskip}{1ex}

%% shortcuts

\def\EUR{\ \textbf{e.}}
\def\mat#1{{\bf #1}}
\def\QUIZZ{{\bf QUIZZ\\}}
\def\SINO{\fbox{SI/NO}}
\def\qed{$\square$}
\def\vec#1{\mathbf{#1}}

\def\enllacos{
  \begin{center}
        Aquest és un document de treball INTERN, en fase de discussió i molt preliminar. No en feu difussió, sisplau.
  \end{center}

  \begin{flushright}
    (\href{../temes.html}{Enllaç al document principal})\\
    (\href{./activitats.pdf}{Enllaç a la versió pdf d'aquest document})\\
    (\href{./activitats.tex}{Enllaç a la font LaTeX})\\
    (\href{./figures/}{Enllaç als fitxers de les figures})
  \end{flushright}}

\def\solucio#1{\rightline{\parbox[t]{0.7\textwidth}{\textbf{Solució:} \emph{#1}}}}
\def\comentari#1{\begin{flushright}\parbox[t]{0.6\textwidth}{\emph{#1}} \end{flushright}}



