This is a very common problem. The \chapter*
command doesn't update the marks that are used for the headers, while \listoftables
does.
So the result is that after
\mainmatter
\chapter*{Introduccion}
The simplest and more effective remedy is to issue
\markboth{Introduccion}{Introduccion}
since you're removing the usual uppercasing done by the book
class; you could also, for doing like the \listof...
commands, type
\markboth{\MakeUppercase{Introduccion}}{\MakeUppercase{Introduccion}}
so the style will be the same even if you eventually decide not to use fancyhdr
.
However, the best option, in my opinion, is to number also the introduction and forget about all these problems.
A couple of words about your style. I prefer to have a package loading section and then a setup section in the preamble. Also, pdftex
should not be passed to graphicx
. Instead of redefining \cleardoublepage
it's simpler to load the emptypage
package.
I removed the settings to \clubpenalty
and \widowpenalty
to 10000, because this doesn't really solve the problems with club and widow lines. Reinstate them, if you prefer. Also setting a nonzero parskip should be avoided: it hinders readability rather than enhancing it, particularly in presence of short paragraphs, producing loads of white strips on the page.
Last, I added headheight=14.5pt
as requested by fancyhdr
.
Here's an edited version (kantlipsum
is just for producing some nonsense text).
\documentclass[a4paper,12pt,twoside]{book}
\usepackage[
bottom=25mm,
top=25mm,
left=30mm,
right=25mm,
headheight=14.5pt,
]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[spanish, es-tabla]{babel}
\usepackage{kantlipsum} % for populating the document
\usepackage{morefloats}
\usepackage{eurosym}
\usepackage{graphicx}
\usepackage{pdfpages}
\usepackage{fancyhdr}
\usepackage{emptypage}
\usepackage[pagebackref=true]{hyperref}
\hypersetup{%
bookmarks=true, % barra de marcadores
unicode=false, % caracteres non-Latin en marcadores de Acrobat
pdftoolbar=true, % mostrar barra de herramientas de Acrobat
pdfmenubar=true, % mostrar menú de Acrobat
pdffitwindow=false, % ajustar ventana al ancho de página
pdfstartview={FitH}, % ajustar documento al ancho de página
pdftitle={Memoria PFC}, % título
pdfauthor={}, % autor
pdfsubject={}, % tema del documento
pdfcreator={}, % generador del documento
pdfproducer={}, % productor del documento
pdfkeywords={}, % lista de palabras clave
pdfnewwindow=true, % enlaces en una nueva ventana
colorlinks=true, % false: enlaces en caja; true: enlaces coloreados
linkcolor=blue, % color de enlaces internos
citecolor=green, % color de enlaces a bibliografía
filecolor=magenta, % color de enlaces a ficheros
urlcolor=blue % color de enlaces externos
}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[EL]{\nouppercase\leftmark}
\fancyhead[OR]{\nouppercase\rightmark}
\fancyhead[ER,OL]{\thepage}
\setcounter{secnumdepth}{3}
\begin{document}
\frontmatter
\tableofcontents
\listoffigures
\listoftables
\mainmatter
\chapter*{Introduccion}
\markboth{Introduccion}{Introduccion}
\kant
\chapter{Abc}
\section{Def}
\kant
\begin{table}
\caption{X}
\end{table}
\begin{figure}
\caption{Y}
\end{figure}
\kant
\end{document}
Best Answer
Your problem seems to be related to page numbering. You should probably use roman numbers for your first pages and use Arabic numbers from where you really start your thesis. If so, you can use
\frontmatter
and\mainmatter
commands. The pages after the first command and before the second command will be numbered with lowercase Roman numerals. Then,\mainmatter
will restart the page counter and change the style to Arabic numbers.Here is an MWE:
Which creates the following table of contents: