I am writting my first Latex document. My document is now 140 pages long and I thought that making the table of contents clickable would be a good idea. I use ShareLatex to compile my code. I imported hyperref package an I found that my code doesn't compile.Specifically, ShareLatex tells me:
"Timed out. Sorry, your compile took too long to run and timed out. This may be due to a large number of high-res images, or complicated diagrams."
If I go to the log tab I only see some overfull and underfull warnings. Now, I use about 20 normal-sized photos and one not too complex diagram. Of course, if I comment the \usepackage{hyperref} the whole document gets loaded in less than 7 seconds.
I searched a lot and find many things to take into account when importing hyperref. I read the manual and the question Which packages should be laoded after hyperref instead of before? but I cant make it work. This is how my import header looks like:
%\documentclass[draft]{report}
\documentclass{report}
\usepackage[noend]{algpseudocode}
\usepackage{blindtext}
\usepackage[utf8]{inputenc}
\usepackage{calculator}
\usepackage[spanish]{babel}
\usepackage{csquotes}
\usepackage{verbatimbox}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{listings}
\usepackage{moreverb}
\usepackage{fancyhdr}
\usepackage{fancyvrb}
\usepackage{enumitem}
\usepackage{textcomp}
\usepackage{wrapfig}
\usepackage[headheight=110pt]{geometry}
\AtBeginDocument{%
\let\AtBeginDvi\OrgAtBeginDvi
}
\usepackage{subfiles}
\usepackage{multicol}
\usepackage[toc,page]{appendix}
\usepackage{url}
\usepackage{tikz}
\usepackage{framed}
\usepackage{xcolor}
\usepackage{booktabs}
\usepackage{longtable}
%% Set some local commands and colors
\usepackage{colortbl}
\definecolor{green}{rgb}{0.1,0.1,0.1}
\usepackage[
backend=biber,
style=alphabetic,
sorting=ynt,
maxnames=99,
maxalphanames=5
]{biblatex}
\addbibresource{bibliografia.bib}
\graphicspath{{images/}{../images/}}
\newcommand{\specialcell}[2][c]{
\begin{tabular}[#1]{@{}c@{}}#2\end{tabular}
}
\renewcommand{\figurename}{Figura}
\renewcommand{\lstlistingname}{Código}
\renewcommand\lstlistlistingname{Listado de Códigos}
\usepackage{lastpage}
\usepackage{pgfgantt}
%\usepackage{hyperref} %WHERE SHOULD I PUT THIS LINE?
\usepackage{tabularx}
\usepackage{algorithm}
\renewcommand{\listofalgorithms}{
\begingroup
\listof{algorithm}{Listado de Pseudocódigos}
\endgroup
}
\begin{document}
I updated my main.tex like runartrollet suggested. However it still doesn't compile. This is how my whole main.tex looks like now:
\documentclass[%
%draft,%
]{report}
\usepackage[noend]{algpseudocode}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage[headheight=110pt]{geometry}
\usepackage[toc,page]{appendix}
\usepackage[
backend=biber,
style=alphabetic,
sorting=ynt,
maxnames=99,
maxalphanames=5
]{biblatex}
\usepackage{%
blindtext,
calculator,
csquotes,
verbatimbox,
graphicx,
mathtools, %(replaces amsmath, and fixes a few errors in it)
listings,
moreverb,
fancyhdr,
fancyvrb,
enumitem,
textcomp,
wrapfig,
subfiles,
multicol,
url,
tikz,
framed,
xcolor,
booktabs,
longtable,
colortbl,
lastpage,
pgfgantt,
tabularx,
algorithm,
hyperref
}
\AtBeginDocument{%
\let\AtBeginDvi\OrgAtBeginDvi
}
%% Set some local commands and colors
\definecolor{green}{rgb}{0.1,0.1,0.1}
\addbibresource{bibliografia.bib}
\graphicspath{{images/}{../images/}}
\newcommand{\specialcell}[2][c]{
\begin{tabular}[#1]{@{}c@{}}#2\end{tabular}
}
\renewcommand{\figurename}{Figura}
\renewcommand{\lstlistingname}{Código}
\renewcommand\lstlistlistingname{Listado de Códigos}
\renewcommand{\listofalgorithms}{
\begingroup
\listof{algorithm}{Listado de Pseudocódigos}
\endgroup
}
\begin{document}
\begin{titlepage}
\begin{center}
\vspace*{-1in}
\begin{figure}[htb]
\begin{center}
\vspace*{1.6in}
\includegraphics[width=8cm]{uc3m.png}
\vspace*{0.6in}
\end{center}
\end{figure}
\begin{large}
Trabajo de Fin de Grado\\
\end{large}
\vspace*{0.2in}
\begin{Large}
\textbf{Valoración de startups\\con\\ Aprendizaje Automático} \\
\end{Large}
\vspace*{0.3in}
\vspace*{0.3in}
\rule{80mm}{0.1mm}\\
\vspace*{0.1in}
\begin{large}
\end{large}
\end{center}
\end{titlepage}
\pagestyle{fancy}
\lhead{\includegraphics[scale=1]{encabezado.jpg}}
\subfile{ackstract}
\tableofcontents
\listoffigures
\listoftables
\lstlistoflistings
\begingroup
\let\clearpage\relax
\listofalgorithms
\endgroup
\clearpage
\part{Introduction}
\chapter{Presentation, motivation and objectives}
\subfile{chapters/intro}
\part{Teoría y Estado del Arte}
\chapter{Valoración}
\subfile{chapters/ea_valoracion}
\chapter{Aprendizaje Automático}
\subfile{chapters/ea_inf}
\chapter{Metodologías}
\subfile{chapters/metodologia}
\chapter{Herramientas}
\subfile{chapters/herramientas}
\part{Contrucción del modelo}
\chapter{Determinando la actividad de la empresa}
\subfile{chapters/p_sectores_industrias}
\chapter{Tasa descuento y riesgo}
\subfile{chapters/rwg}
\chapter{Flujos de caja libres}
\subfile{chapters/p_flujos}
\chapter{Aplicación del modelo}
\subfile{chapters/aplicacion}
\chapter{Despliegue}
\subfile{chapters/integrate}
\part{Conclusiones}
\subfile{chapters/conclusiones}
\printbibliography[
heading=bibintoc,
title={Referencias}
]
\begin{appendices}
\chapter{Listado de frecuencias de industrias}
\subfile{appendices/listado_frecuencias_industrias}
\chapter{Distribuciones estadísticas}
\subfile{appendices/distribuciones}
\chapter{Planificación}
\subfile{appendices/planificacion}
\end{appendices}
\clearpage
\end{document}
I exported my project to Overleaf which gives me more feedback:
./main.out:92:
Missing \endcsname inserted.
<to be read again>
\unhbox
l.92 ...tor \futurelet \textbf ndice.alph1.Alph3}
And I could also get the logfile:
\end{docuemnt}so your example is a document it runs without error, please fix the example so that it shows the error you get. – David Carlisle Jun 03 '16 at 20:06line \usepackage{hyperref}uncommented and I put the\begin{document}just to show where my doc starts. Thanks – hipoglucido Jun 03 '16 at 21:14\AtBeginDocument{% \let\AtBeginDvi\OrgAtBeginDvi }??? It breaks\AtBeginDviso may break some packages – David Carlisle Jun 03 '16 at 21:33.outfile which is corrupt and then look at what command you have in a section heading or similar that is missing \protect or similar somewhere around the textndice.alph1.Alph3– David Carlisle Jun 03 '16 at 22:47