I am struggling with a couple of tables in my list of tables. I am including a minimal example where you can see two long tables. The first one is OK, but the second one appears twice in the index. Do you know why? When I compile this minimal example I get an error and instead of Table 1, it appears “red”, but this does not happen in my work. I do not know why, but at the end the document can be compiled anyway. I think there is something wrong with:
Code: Select all
\ifpdf
\tableofcontents
Code: Select all
\documentclass[
12pt,%
% draft,%
twoside,%
BCOR10mm,%
bib=totoc,
toc=listof,
toc=bibliography,
numbers=noenddot
]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish,ngerman,catalan,english]{babel}
\usepackage{natbib}
\usepackage{tabularx}
\usepackage{mystyle}
\usepackage{longtable}
\usepackage{caption}
\captionsetup[table]{labelsep=quad}
\captionsetup[figure]{labelsep=quad}
\addto\captionsspanish{%
%\renewcommand{\listfigurename}{Índice de Figuras}
\renewcommand{\listfigurename}{Índice de Figuras}
\renewcommand{\listtablename}{Índice de Tablas}
\renewcommand{\figurename}{Figura}
\renewcommand{\tablename}{Tabla}
\renewcommand{\bibname}{Referencias bibliográficas}
\renewcommand{\appendixname}{Apéndices}
\renewcommand{\appendixtocname}{Apéndices}
\renewcommand{\appendixpagename}{Apéndices}}
\pagenumbering{roman}
\ifpdf
\tableofcontents
{\listoftables
\let\cleardoublepage\relax
\let\clearpage\relax
\listoffigures
\let\cleardoublepage\relax
\let\clearpage\relax
\listofgraficos
}
\pagenumbering{arabic}
\begin{document}
\ref{tab:errors}
\begin{center}
\begin{longtable} {|p{1.20cm}| p{10cm}|r|r|r|}
\caption{Errores} \label{tab:errors} \\
\hline \multicolumn{1}{|l|}{\textbf{Num}} &
\multicolumn{1}{X|}{\textbf{Cat}} &
\multicolumn{1}{l|}{\textbf{Total}} \\ \hline
\endfirsthead
\multicolumn{3}{c}%
{{\tablename\ \thetable{}: Errors }} \\
\hline \multicolumn{1}{|l|}{\textbf{Num}} &
\multicolumn{1}{X|}{\textbf{Cat}} &
\multicolumn{1}{l|}{\textbf{Total}} \\
\hline
\endhead
\hline \multicolumn{3}{|r|}{{\emph{continuación}}} \\ \hline
\endfoot
\hline \hline
\endlastfoot
\textbf{1} & \textbf{Errors} & \%\\
\hline
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
1.1&Example I&15 (1,32\%)\\
\end{longtable}
\end{center}
\ref{tab:example}
\begin{longtable} {lp{13cm}}
\caption{Example}\label{tab:example}
\hline
\textbf{nume} & \textbf{Examples} \\ \hline
\endhead
\hline \multicolumn{2}{l}{{\emph{continuación}}}\\ \hline
\endfoot
\hline \hline
\endlastfoot
2.2&Example II\\
2.2&Example II\\
2.2&Example II\\
2.2&Example II\\
2.2&Example II\\
2.2&Example II\\
2.2&Example II\\
2.2&Example II\\
2.2&Example II\\
2.2&Example II\\
2.2&Example II\\
2.2&Example II\\
2.2&Example II\\
2.2&Example II\\
2.2&Example II\\
2.2&Example II\\
2.2&Example II\\
2.2&Example II\\
2.2&Example II\\
2.2&Example II\\
\end{longtable}
\end{document}
Many thanks in advance.
Regards,
Marie