% ---------------------------------------------------------------------
% ---------------------------------------------------------------------
% Configuración general


\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}

\ifcastellano\usepackage[spanish,es-tabla]{babel}\fi
\ifvalencia\usepackage[catalan]{babel}\fi
\ifenglish\usepackage[english]{babel}						\usepackage{csquotes}\fi
\newcommand{\sen}{\on{sen}}	

\usepackage{xcolor}
\usepackage{array,booktabs}
\usepackage{tabularx,multicol}
\usepackage{amssymb}

\ifenglish
	\raggedright % No justifica, i no divide las palabras con guiones
\fi

% ---------------------------------------------------------------------
% ---------------------------------------------------------------------
% Bibliografía

\usepackage[
	url = false,
	style = authoryear,
	hyperref = true,
	backref = true,
	backend = biber, % Otra opción es 'backend = bibtex'
	]{biblatex}

% ---------------------------------------------------------------------
% ---------------------------------------------------------------------
% Documento electrónico

%\usepackage{makeidx}
%\makeindex

\colorlet{colorEnlace}{blue!85!black} 

\usepackage[
	{colorlinks},
	{linkcolor=colorEnlace},
	{citecolor=colorEnlace},
	{urlcolor=colorEnlace},
	{bookmarksnumbered},
	{breaklinks},
	]{hyperref}

% ---------------------------------------------------------------------
% ---------------------------------------------------------------------
% Expresión de unidades según el Sistema Internacional, monedas

\usepackage{eurosym}
\usepackage{siunitx}

\ifenglish
	\sisetup{output-decimal-marker={.}}
\else
	\sisetup{output-decimal-marker={,}}
\fi

\DeclareSIUnit[number-unit-product = {\;}] \EURO{\geneuro}


% ---------------------------------------------------------------------
% ---------------------------------------------------------------------
% Comandos y entornos personalizados

\newcommand{\ingles}[1]{\textit{#1}}

% ------------------------------------------------------------------------

\usepackage{xspace}

\newcommand{\angles}[1]{\textit{#1}\/}
\newcommand{\miUrl}[1]{{\small%
	%\texttt%
	{\underline{#1}}}}

\newcommand{\matlabr}{{\sc Matlab}$^\circledR$\xspace}
\newcommand{\simulinkr}{\textit{Simulink}$^\circledR$\xspace}
\newcommand{\matlab}{{\textsc{Matlab}}\xspace}
\newcommand{\simulink}{\textit{Simulink}\xspace}

\newcommand{\scr}{\textit{script\/}\xspace}
\newcommand{\scrs}{\textit{scripts\/}\xspace}

% ------------------------------------------------------------------------

\definecolor{griset}{rgb}{.925, .925, .925}

	\newsavebox{\mybox}
	\newenvironment{parrafoDestacado}
		{%
		\fboxsep = 2ex
		\fboxrule = .4pt
	  	\begin{lrbox}{\mybox}%
	  	\begin{minipage}{.85\textwidth-2\fboxsep}\itshape\parskip=2ex
		}
		{%
		\end{minipage}
	  	\end{lrbox}%
		\begin{flushright}
			\colorbox{griset}{\usebox{\mybox}}%
	  		%\fcolorbox{black}{griset}{\usebox{\mybox}}%
		\end{flushright}
		}
		
% ---------------------------------------------------------------------
% ---------------------------------------------------------------------
% Teoremas y ejemplos

\ifcastellano
	\newtheorem{teorema}{\upshape\bfseries Teorema}[section]
	\newtheorem{lema}{\mdseries\scshape Lema}[section]
	\newtheorem{proposicion}{\upshape\bfseries Proposición}[section]
	\newtheorem{ejemplo}{\bfseries\scshape Ejemplo}[section]
\fi

\ifvalencia % Es mantenen els mateixos noms per compatibilitat, però l'autor els pot personalitzar
	\newtheorem{teorema}{\upshape\bfseries Teorema}[section]
	\newtheorem{lema}{\mdseries\scshape Lema}[section]
	\newtheorem{proposicion}{\upshape\bfseries Proposició}[section]
	\newtheorem{ejemplo}{\bfseries\scshape Exemple}[section]
\fi

\ifenglish
	\newtheorem{teorema}{\upshape\bfseries Theorem}[section]
	\newtheorem{lema}{\mdseries\scshape Lemma}[section]
	\newtheorem{proposicion}{\upshape\bfseries Proposition}[section]
	\newtheorem{ejemplo}{\bfseries\scshape Example}[section]
\fi

% ---------------------------------------------------------------------

