I'm doing my thesis and I need a better display of the chapters that are shown on LoT and LoF, as well as I want to include the \appendix
as a Chapter to LoT and LoF (notice that \appendixname
is "Anexo" in the LoT picture below).
I read an answer here which recommends to use: \addcontentsline{lot}{chapter}{Anexo}
, and it adds perfectly the "Anexo" chapter to LoT & LoF. The thing is that, as you can see on the image below, the "Anexo" is with hyperlink and with the page number also (in other color). The point is that it looks bad comparing to the other chapters style. I'd like all to look the same, with a bigger font size if possible :-)
. In order to add the chapters as it is shown for all chapters (not counting "Anexo", i.e II. Estado del Arte and III. Métodos y materiales), I used an answer suggested here.
My code is the following:
\documentclass[11pt,a4paper,twoside,openright]{report}
\usepackage[spanish,es-lcroman]{babel}
\addto\shorthandsspanish{\spanishdeactivate{~<>}}
\usepackage[utf8x]{inputenc}
\usepackage{microtype}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{booktabs}
\usepackage{caption}
\captionsetup{labelfont=bf}
\usepackage{amsmath}
\usepackage{etoolbox}
\makeatletter
% initial definitions of the chapter info (name and number)
\def\thischaptertitle{}\def\thischapternumber{}
\newtoggle{noFigs}
\apptocmd{\@chapter}%
{\gdef\thischaptertitle{#1}\gdef\thischapternumber{\thechapter}%
\global\toggletrue{noFigs}}{}{}
% the figure environment does the job: the first time it is used after a \chapter command,
% it writes the information of the chapter to the LoF
\AtBeginDocument{%
\AtBeginEnvironment{figure}{%
\iftoggle{noFigs}{
\addtocontents{lof}{\protect\contentsline {chapter}%
{\protect\numberline {\thischapternumber} {\thischaptertitle}}{}{} }
\global\togglefalse{noFigs}
}{}
}%
}
\makeatother
\makeatletter
\def\thischaptertitle{}\def\thischapternumber{}
\newtoggle{noTabs}
\apptocmd{\@chapter}%
{\gdef\thischaptertitle{#1}\gdef\thischapternumber{\thechapter}%
\global\toggletrue{noTabs}}{}{}
% the figure environment does the job: the first time it is used after a \chapter command,
% it writes the information of the chapter to the LoF
\AtBeginDocument{%
\AtBeginEnvironment{table}{%
\iftoggle{noTabs}{
\addtocontents{lot}{\protect\contentsline {chapter}%
{\protect\numberline {\thischapternumber} {\thischaptertitle}}{}{} }
\global\togglefalse{noTabs}
}{}
}%
}
\makeatother
\addto\captionsspanish{
\def\tablename{Tabla}
\def\listtablename{\'Indice de tablas}
}
\usepackage[margin=25mm,inner=30mm]{geometry}
\usepackage[colorlinks=true,
linkcolor=blue,
urlcolor=blue,
citecolor=blue]{hyperref}
\usepackage{sectsty}
\usepackage[nottoc,notlof,notlot]{tocbibind}
\makeatletter
\def\tableofcontents{%
\newpage
\centerline{\Large\scshape Índice General}
\vspace*{0.3in}
\@mkboth{Contenidos}{}
\@starttoc{toc}
}
\makeatother
\makeatletter
\def\listoftables{%
\newpage
\centerline{\Large\scshape Índice de Tablas}
\vspace*{0.3in}
\@mkboth{Contenidos}{}
\@starttoc{lot}
}
\makeatother
\makeatletter
\def\listoffigures{%
\newpage
\centerline{\Large\scshape Índice de Figuras}
\vspace*{0.3in}
\@mkboth{Contenidos}{}
\@starttoc{lof}
}
\makeatother
\usepackage{appendix}
\usepackage{titlesec}
\usepackage[dotinlabels]{titletoc}
\usepackage{longtable}
\usepackage{tabularx}
\usepackage{bigstrut}
\usepackage{bigdelim}
\usepackage{ltxtable}
\usepackage{chngcntr}
\begin{document}
\selectlanguage{spanish}
%------------------------- TOC.
\cleardoublepage
\phantomsection
\tableofcontents
\addcontentsline{toc}{chapter}{Índice General}
%------------------------- LOF.
\cleardoublepage
\phantomsection
\listoffigures
\addcontentsline{toc}{chapter}{\listfigurename}
%------------------------- LOT.
\cleardoublepage
\phantomsection
\listoftables
\addcontentsline{toc}{chapter}{\listtablename}
\clearpage
\chapter{Capítulo 1}
% There are no tables here...
\clearpage
\chapter{Estado del Arte}
\begin{table}[h!]
\centering
\caption{Grupos de códigos de área.}\label{tab:1}
\begin{tabular}{cc}
\toprule
hola & chao\\
\midrule
bla & blabla\\
alb & albalb\\
\bottomrule
\end{tabular}
\end{table}
%and many other tables...
\clearpage
\chapter{Métodos y materiales}
\begin{table}[h!]
\centering
\begin{tabular}{lc}
\toprule
\multicolumn{2}{c}{\textbf{CARACTERÍSTICAS TÉCNICAS DEL ESPECTRÓMETRO STS-NIR }} \\
\midrule
Fabricante & OceanOptics \\
bla & blabla\\
\bottomrule
\end{tabular}%
\caption{Características del espectrómetro y de la fibra óptica.}\label{tab:car_espectrometro}%
\end{table}
% Here's much more... (bla bla... + bibliography...)
% And at the end (the appendix):
\clearpage
\renewcommand{\appendixname}{Anexo}
\renewcommand{\appendixtocname}{Anexo}
\renewcommand{\appendixpagename}{Anexo}
\renewcommand{\thesection}{\Alph{section}}
\appendix
\phantomsection
\addcontentsline{lot}{chapter}{Anexo} %This is the first approach.
\clearpage
\addappheadtotoc
\appendixpage
\counterwithin{table}{section}
\counterwithin{figure}{section}
\counterwithin{equation}{section}
\refstepcounter{section}%
\section*{\thesection. \quad Características generales de las agujas y conos de pino.}
\begin{table}[h!]
\centering
\begin{tabular}{lcc}
\toprule
& bla & blabla \\
\midrule
Moisture (wt.\%) & 12 & 8,9 \\
bla bla & bla & bla \\
\bottomrule
\end{tabular}%
\caption{Características generales de agujas y conos de pino.}
\end{table}%
\end{document}
It is very possible that I'm missing something (I'm trying to put just what I think It's necessary, because I've got hundreds of code lines in my preamble), therefore I'll be very alert for any question and/or answer. So, to conclude, the things that I'm asking to solve are:
That
\appendix
chapter ("Anexo" in LoT) has the same style as the other chapters (i.e Estado del Arte and Métodos y materiales).To modify the chapters style in both LoT and LoF (to change the font size, color...with that it's perfect!).
I'd really appreciate some help!
:D