% TODO:
% - Fix page numbering (APA)
% - Fix chapter and section formatting
% - Fix paragraph's first line indent
% - Fix figure numbering and positioning (breaks paragraphs)

% Appendix:
% 
% Los anexos tienen que subirse con nombre similar a:
% 20170895_RobertoTokumori_PatriciaNatividad_E1.2_Anexo1.xlsx

% Preamble
% ======================================================================

\documentclass[
    fontsize=12pt, 
    paper=a4,
    spanish
    %draft=true
]{report}   % report

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}     % breaks things? idk
\usepackage[top=1in, bottom=1in, right=1in, left=1in]{geometry}

\usepackage{graphicx}
\usepackage{mathtools,amsmath,amssymb}
% Amazing, problem solved.  Thank you Sebastián.
% http://byte77.blogspot.com/2011/08/no-cuadro-sino-tabla-el-tipico-dolor-de.html
\usepackage[spanish,es-tabla]{babel}
\usepackage{amsfonts}
\usepackage{xcolor}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{float}
\usepackage{csquotes}

% Double line spacing
\usepackage{setspace}
\doublespacing

% https://tex.stackexchange.com/a/258782/151663
\usepackage{longtable}
\setlength\LTleft\parindent

% Issues with biber,  requires environment
% https://tex.stackexchange.com/q/154751/151663
% Forget about it.  biber is an extra package that doesn't come with TexLive in
% ArchLinux and I didn't have it installed.  (True issue: RTFM).
\usepackage[
    backend=biber,
    style=apa,
    %language=english,
    sortcites=true,
    sorting=nyt,
    %citestyle=authoryear,
    %maxcitenames=2,
    %maxbibnames=99,
    %uniquelist=false
]{biblatex}
\addbibresource{thesis.bib}

\usepackage[colorlinks=true, allcolors=blue]{hyperref}
\usepackage{cleveref}

% Babel
% Ref.: https://www.overleaf.com/learn/latex/Table_of_contents
\addto\captionsspanish{ 
    \renewcommand*\contentsname{Tabla de Contenido}
    \renewcommand*\appendixname{Anexo}
}

% Doesn't work with the packages I currently use:
% https://tex.stackexchange.com/q/320632/151663
%\crefname{table}{cuadro}{cuadros}
%\crefname{table}{\spanishtablename}{\spanishtablename}
%\crefname{figure}{figura}{figuras}
%\crefname{section}{Sección}{Secciones}
%\crefname{equation}{ecuación}{ecuación}
%\renewcommand{\chaptername}{Capítulo}
%\renewcommand{\contentsname}{Contenidos}
%\newtheorem{remark}{Observación}[chapter]
%\renewcommand{\listtablename}{Índice de tablas}
%\renewcommand{\tablename}{Tabla}
%\crefname{table}{Tabla}{Tabla}


% Content
% ======================================================================
 
% Cover
\begin{document}
\include{chapter/01-cover.tex}
% Resumen
% Tema FCI
\tableofcontents      % "Tabla de Contenido", en lugar de Índice general
% Índice de Tablas
% Índice de Figuras
% Índice de Abreviaturas

% \include{chapter/05-intro}
\include{chapter/10-generalidades}
\include{chapter/20-marco}
\include{chapter/30-estado_del_arte}
\include{chapter/40-resultados_esperados}
\include{chapter/50-conclusiones}
\newpage

\printbibliography{}
\newpage

% Anexos
\appendix
\include{chapter/90-anexos}
 
\end{document}
