Problem with chapter* and fancyhdr











up vote
7
down vote

favorite
3












I'm having a problem with chapter*{} and fancyhdr. I want to start the first chapter of my thesis with a introduction section, appearing in the TOC but without numeration, that's why I use:



chapter*{Introduccion} 


and



addcontentsline{toc}{chapter}{Introduccion}


at the beginning of the Introduccion.tex file, but I don't know why, the fancyhdr header shows "list of tables" instead of "Introduccion"!



(the list of tables is immediately before the introduction).



Here is my code:



documentclass[a4paper,12pt,twoside]{book}
%
usepackage[bottom=25mm,top=25mm, left=30mm, right=25mm]{geometry}
%
parskip=8pt
%
widowpenalty=10000
clubpenalty=10000
%
usepackage[spanish, es-tabla]{babel}
usepackage[utf8x]{inputenc}
usepackage{morefloats}
%
setcounter{secnumdepth}{3}
usepackage{eurosym}
usepackage[pdftex]{graphicx}
usepackage{pdfpages}
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
}
%
usepackage{fancyhdr}
pagestyle{fancy}
fancyhf{}
fancyhead[EL]{nouppercaseleftmark}
fancyhead[OR]{nouppercaserightmark}
fancyhead[ER,OL]{thepage}
%
makeatletter
%
defcleardoublepage{clearpageif@twoside ifoddc@pageelse
hbox{}
thispagestyle{empty}
newpage
if@twocolumnhbox{}newpagefififi}
makeatother
%
begin{document}
%
pagenumbering{gobble} % Las primeras paginas no quiero que se numeren
%
includepdf[pages={-}]{./Archivos/Portada_PFCccompleto.pdf}
input{./Archivos/Capitulos/pfc_dedicatoria}
input{./Archivos/Capitulos/pfc_agradecimientos}
include{./Archivos/Capitulos/pfc_abreviaturas}
%
% FRONTMATTER: TOC, LOF, LOT
frontmatter
%
tableofcontents
listoffigures
listoftables
%
% MAINMATTER
%
mainmatter
include{./Archivos/Capitulos/pfc_intro}
include{./Archivos/Capitulos/pfc_main_010}
...
%









share|improve this question




















  • 3




    This is a very common problem. Add markboth{Introduccion}{Introduccion} after chapter*{Introduccion}. By the way, instead of redefining cleardoublepage, you can add usepackage{emptypage}
    – egreg
    Oct 20 '13 at 18:59










  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
    – Andrew Swann
    Oct 20 '13 at 19:19










  • It might already help if you move the introduction to the frontmatter and use a normal chapter. An alternative could be to use a class and »scrpage2« from »KOMA-Script« and use its addchap command.
    – Thorsten Donig
    Oct 21 '13 at 7:41















up vote
7
down vote

favorite
3












I'm having a problem with chapter*{} and fancyhdr. I want to start the first chapter of my thesis with a introduction section, appearing in the TOC but without numeration, that's why I use:



chapter*{Introduccion} 


and



addcontentsline{toc}{chapter}{Introduccion}


at the beginning of the Introduccion.tex file, but I don't know why, the fancyhdr header shows "list of tables" instead of "Introduccion"!



(the list of tables is immediately before the introduction).



Here is my code:



documentclass[a4paper,12pt,twoside]{book}
%
usepackage[bottom=25mm,top=25mm, left=30mm, right=25mm]{geometry}
%
parskip=8pt
%
widowpenalty=10000
clubpenalty=10000
%
usepackage[spanish, es-tabla]{babel}
usepackage[utf8x]{inputenc}
usepackage{morefloats}
%
setcounter{secnumdepth}{3}
usepackage{eurosym}
usepackage[pdftex]{graphicx}
usepackage{pdfpages}
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
}
%
usepackage{fancyhdr}
pagestyle{fancy}
fancyhf{}
fancyhead[EL]{nouppercaseleftmark}
fancyhead[OR]{nouppercaserightmark}
fancyhead[ER,OL]{thepage}
%
makeatletter
%
defcleardoublepage{clearpageif@twoside ifoddc@pageelse
hbox{}
thispagestyle{empty}
newpage
if@twocolumnhbox{}newpagefififi}
makeatother
%
begin{document}
%
pagenumbering{gobble} % Las primeras paginas no quiero que se numeren
%
includepdf[pages={-}]{./Archivos/Portada_PFCccompleto.pdf}
input{./Archivos/Capitulos/pfc_dedicatoria}
input{./Archivos/Capitulos/pfc_agradecimientos}
include{./Archivos/Capitulos/pfc_abreviaturas}
%
% FRONTMATTER: TOC, LOF, LOT
frontmatter
%
tableofcontents
listoffigures
listoftables
%
% MAINMATTER
%
mainmatter
include{./Archivos/Capitulos/pfc_intro}
include{./Archivos/Capitulos/pfc_main_010}
...
%









share|improve this question




















  • 3




    This is a very common problem. Add markboth{Introduccion}{Introduccion} after chapter*{Introduccion}. By the way, instead of redefining cleardoublepage, you can add usepackage{emptypage}
    – egreg
    Oct 20 '13 at 18:59










  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
    – Andrew Swann
    Oct 20 '13 at 19:19










  • It might already help if you move the introduction to the frontmatter and use a normal chapter. An alternative could be to use a class and »scrpage2« from »KOMA-Script« and use its addchap command.
    – Thorsten Donig
    Oct 21 '13 at 7:41













up vote
7
down vote

favorite
3









up vote
7
down vote

favorite
3






3





I'm having a problem with chapter*{} and fancyhdr. I want to start the first chapter of my thesis with a introduction section, appearing in the TOC but without numeration, that's why I use:



chapter*{Introduccion} 


and



addcontentsline{toc}{chapter}{Introduccion}


at the beginning of the Introduccion.tex file, but I don't know why, the fancyhdr header shows "list of tables" instead of "Introduccion"!



(the list of tables is immediately before the introduction).



Here is my code:



documentclass[a4paper,12pt,twoside]{book}
%
usepackage[bottom=25mm,top=25mm, left=30mm, right=25mm]{geometry}
%
parskip=8pt
%
widowpenalty=10000
clubpenalty=10000
%
usepackage[spanish, es-tabla]{babel}
usepackage[utf8x]{inputenc}
usepackage{morefloats}
%
setcounter{secnumdepth}{3}
usepackage{eurosym}
usepackage[pdftex]{graphicx}
usepackage{pdfpages}
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
}
%
usepackage{fancyhdr}
pagestyle{fancy}
fancyhf{}
fancyhead[EL]{nouppercaseleftmark}
fancyhead[OR]{nouppercaserightmark}
fancyhead[ER,OL]{thepage}
%
makeatletter
%
defcleardoublepage{clearpageif@twoside ifoddc@pageelse
hbox{}
thispagestyle{empty}
newpage
if@twocolumnhbox{}newpagefififi}
makeatother
%
begin{document}
%
pagenumbering{gobble} % Las primeras paginas no quiero que se numeren
%
includepdf[pages={-}]{./Archivos/Portada_PFCccompleto.pdf}
input{./Archivos/Capitulos/pfc_dedicatoria}
input{./Archivos/Capitulos/pfc_agradecimientos}
include{./Archivos/Capitulos/pfc_abreviaturas}
%
% FRONTMATTER: TOC, LOF, LOT
frontmatter
%
tableofcontents
listoffigures
listoftables
%
% MAINMATTER
%
mainmatter
include{./Archivos/Capitulos/pfc_intro}
include{./Archivos/Capitulos/pfc_main_010}
...
%









share|improve this question















I'm having a problem with chapter*{} and fancyhdr. I want to start the first chapter of my thesis with a introduction section, appearing in the TOC but without numeration, that's why I use:



chapter*{Introduccion} 


and



addcontentsline{toc}{chapter}{Introduccion}


at the beginning of the Introduccion.tex file, but I don't know why, the fancyhdr header shows "list of tables" instead of "Introduccion"!



(the list of tables is immediately before the introduction).



Here is my code:



documentclass[a4paper,12pt,twoside]{book}
%
usepackage[bottom=25mm,top=25mm, left=30mm, right=25mm]{geometry}
%
parskip=8pt
%
widowpenalty=10000
clubpenalty=10000
%
usepackage[spanish, es-tabla]{babel}
usepackage[utf8x]{inputenc}
usepackage{morefloats}
%
setcounter{secnumdepth}{3}
usepackage{eurosym}
usepackage[pdftex]{graphicx}
usepackage{pdfpages}
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
}
%
usepackage{fancyhdr}
pagestyle{fancy}
fancyhf{}
fancyhead[EL]{nouppercaseleftmark}
fancyhead[OR]{nouppercaserightmark}
fancyhead[ER,OL]{thepage}
%
makeatletter
%
defcleardoublepage{clearpageif@twoside ifoddc@pageelse
hbox{}
thispagestyle{empty}
newpage
if@twocolumnhbox{}newpagefififi}
makeatother
%
begin{document}
%
pagenumbering{gobble} % Las primeras paginas no quiero que se numeren
%
includepdf[pages={-}]{./Archivos/Portada_PFCccompleto.pdf}
input{./Archivos/Capitulos/pfc_dedicatoria}
input{./Archivos/Capitulos/pfc_agradecimientos}
include{./Archivos/Capitulos/pfc_abreviaturas}
%
% FRONTMATTER: TOC, LOF, LOT
frontmatter
%
tableofcontents
listoffigures
listoftables
%
% MAINMATTER
%
mainmatter
include{./Archivos/Capitulos/pfc_intro}
include{./Archivos/Capitulos/pfc_main_010}
...
%






table-of-contents chapters fancyhdr






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 20 '13 at 18:55









Andrea L.

1,8271435




1,8271435










asked Oct 20 '13 at 18:33









Dave

362




362








  • 3




    This is a very common problem. Add markboth{Introduccion}{Introduccion} after chapter*{Introduccion}. By the way, instead of redefining cleardoublepage, you can add usepackage{emptypage}
    – egreg
    Oct 20 '13 at 18:59










  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
    – Andrew Swann
    Oct 20 '13 at 19:19










  • It might already help if you move the introduction to the frontmatter and use a normal chapter. An alternative could be to use a class and »scrpage2« from »KOMA-Script« and use its addchap command.
    – Thorsten Donig
    Oct 21 '13 at 7:41














  • 3




    This is a very common problem. Add markboth{Introduccion}{Introduccion} after chapter*{Introduccion}. By the way, instead of redefining cleardoublepage, you can add usepackage{emptypage}
    – egreg
    Oct 20 '13 at 18:59










  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
    – Andrew Swann
    Oct 20 '13 at 19:19










  • It might already help if you move the introduction to the frontmatter and use a normal chapter. An alternative could be to use a class and »scrpage2« from »KOMA-Script« and use its addchap command.
    – Thorsten Donig
    Oct 21 '13 at 7:41








3




3




This is a very common problem. Add markboth{Introduccion}{Introduccion} after chapter*{Introduccion}. By the way, instead of redefining cleardoublepage, you can add usepackage{emptypage}
– egreg
Oct 20 '13 at 18:59




This is a very common problem. Add markboth{Introduccion}{Introduccion} after chapter*{Introduccion}. By the way, instead of redefining cleardoublepage, you can add usepackage{emptypage}
– egreg
Oct 20 '13 at 18:59












Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Andrew Swann
Oct 20 '13 at 19:19




Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Andrew Swann
Oct 20 '13 at 19:19












It might already help if you move the introduction to the frontmatter and use a normal chapter. An alternative could be to use a class and »scrpage2« from »KOMA-Script« and use its addchap command.
– Thorsten Donig
Oct 21 '13 at 7:41




It might already help if you move the introduction to the frontmatter and use a normal chapter. An alternative could be to use a class and »scrpage2« from »KOMA-Script« and use its addchap command.
– Thorsten Donig
Oct 21 '13 at 7:41










2 Answers
2






active

oldest

votes

















up vote
6
down vote













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]{nouppercaseleftmark}
fancyhead[OR]{nouppercaserightmark}
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}


enter image description here






share|improve this answer




























    up vote
    0
    down vote













    Try desactivating properties that you define of fancyhdr package, then put your chapter and your text and finally activates fancy properties again, but you have to be careful locating the lines to reactivate it:



    listoftables  
    fancyhf{} % sets both header and footer to nothing
    renewcommand{headrulewidth}{0pt}
    renewcommand{footrulewidth}{0pt}

    chapter*{my-chapter-name}
    blindtext
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %%%% NOTE: PAY ATTENTION HERE %%%%%%%%%%
    %%%%
    %%%% If the text after the 'chapter*{my-chapter-name}':
    %%%% is more than one page, the lines after this note should
    %%%% be exactly after the first paragraph of the second page
    %%%%
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    pagestyle{fancy}
    fancyfoot{}
    fancyhead{}
    fancyhead[L]{scriptsize leftmark}
    fancyfoot[L]{scriptsize rightmark}
    fancyhead[R]{thepage}
    renewcommand{headrulewidth}{0.5pt}
    renewcommand{footrulewidth}{0.5pt}





    share|improve this answer








    New contributor




    Cruz E is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.


















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "85"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f139758%2fproblem-with-chapter-and-fancyhdr%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      6
      down vote













      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]{nouppercaseleftmark}
      fancyhead[OR]{nouppercaserightmark}
      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}


      enter image description here






      share|improve this answer

























        up vote
        6
        down vote













        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]{nouppercaseleftmark}
        fancyhead[OR]{nouppercaserightmark}
        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}


        enter image description here






        share|improve this answer























          up vote
          6
          down vote










          up vote
          6
          down vote









          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]{nouppercaseleftmark}
          fancyhead[OR]{nouppercaserightmark}
          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}


          enter image description here






          share|improve this answer












          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]{nouppercaseleftmark}
          fancyhead[OR]{nouppercaserightmark}
          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}


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Oct 20 '13 at 19:28









          egreg

          703k8618743151




          703k8618743151






















              up vote
              0
              down vote













              Try desactivating properties that you define of fancyhdr package, then put your chapter and your text and finally activates fancy properties again, but you have to be careful locating the lines to reactivate it:



              listoftables  
              fancyhf{} % sets both header and footer to nothing
              renewcommand{headrulewidth}{0pt}
              renewcommand{footrulewidth}{0pt}

              chapter*{my-chapter-name}
              blindtext
              %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
              %%%% NOTE: PAY ATTENTION HERE %%%%%%%%%%
              %%%%
              %%%% If the text after the 'chapter*{my-chapter-name}':
              %%%% is more than one page, the lines after this note should
              %%%% be exactly after the first paragraph of the second page
              %%%%
              %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
              pagestyle{fancy}
              fancyfoot{}
              fancyhead{}
              fancyhead[L]{scriptsize leftmark}
              fancyfoot[L]{scriptsize rightmark}
              fancyhead[R]{thepage}
              renewcommand{headrulewidth}{0.5pt}
              renewcommand{footrulewidth}{0.5pt}





              share|improve this answer








              New contributor




              Cruz E is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.






















                up vote
                0
                down vote













                Try desactivating properties that you define of fancyhdr package, then put your chapter and your text and finally activates fancy properties again, but you have to be careful locating the lines to reactivate it:



                listoftables  
                fancyhf{} % sets both header and footer to nothing
                renewcommand{headrulewidth}{0pt}
                renewcommand{footrulewidth}{0pt}

                chapter*{my-chapter-name}
                blindtext
                %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                %%%% NOTE: PAY ATTENTION HERE %%%%%%%%%%
                %%%%
                %%%% If the text after the 'chapter*{my-chapter-name}':
                %%%% is more than one page, the lines after this note should
                %%%% be exactly after the first paragraph of the second page
                %%%%
                %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                pagestyle{fancy}
                fancyfoot{}
                fancyhead{}
                fancyhead[L]{scriptsize leftmark}
                fancyfoot[L]{scriptsize rightmark}
                fancyhead[R]{thepage}
                renewcommand{headrulewidth}{0.5pt}
                renewcommand{footrulewidth}{0.5pt}





                share|improve this answer








                New contributor




                Cruz E is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.




















                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  Try desactivating properties that you define of fancyhdr package, then put your chapter and your text and finally activates fancy properties again, but you have to be careful locating the lines to reactivate it:



                  listoftables  
                  fancyhf{} % sets both header and footer to nothing
                  renewcommand{headrulewidth}{0pt}
                  renewcommand{footrulewidth}{0pt}

                  chapter*{my-chapter-name}
                  blindtext
                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                  %%%% NOTE: PAY ATTENTION HERE %%%%%%%%%%
                  %%%%
                  %%%% If the text after the 'chapter*{my-chapter-name}':
                  %%%% is more than one page, the lines after this note should
                  %%%% be exactly after the first paragraph of the second page
                  %%%%
                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                  pagestyle{fancy}
                  fancyfoot{}
                  fancyhead{}
                  fancyhead[L]{scriptsize leftmark}
                  fancyfoot[L]{scriptsize rightmark}
                  fancyhead[R]{thepage}
                  renewcommand{headrulewidth}{0.5pt}
                  renewcommand{footrulewidth}{0.5pt}





                  share|improve this answer








                  New contributor




                  Cruz E is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  Try desactivating properties that you define of fancyhdr package, then put your chapter and your text and finally activates fancy properties again, but you have to be careful locating the lines to reactivate it:



                  listoftables  
                  fancyhf{} % sets both header and footer to nothing
                  renewcommand{headrulewidth}{0pt}
                  renewcommand{footrulewidth}{0pt}

                  chapter*{my-chapter-name}
                  blindtext
                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                  %%%% NOTE: PAY ATTENTION HERE %%%%%%%%%%
                  %%%%
                  %%%% If the text after the 'chapter*{my-chapter-name}':
                  %%%% is more than one page, the lines after this note should
                  %%%% be exactly after the first paragraph of the second page
                  %%%%
                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                  pagestyle{fancy}
                  fancyfoot{}
                  fancyhead{}
                  fancyhead[L]{scriptsize leftmark}
                  fancyfoot[L]{scriptsize rightmark}
                  fancyhead[R]{thepage}
                  renewcommand{headrulewidth}{0.5pt}
                  renewcommand{footrulewidth}{0.5pt}






                  share|improve this answer








                  New contributor




                  Cruz E is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer






                  New contributor




                  Cruz E is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered 29 mins ago









                  Cruz E

                  1




                  1




                  New contributor




                  Cruz E is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  Cruz E is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  Cruz E is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f139758%2fproblem-with-chapter-and-fancyhdr%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Accessing regular linux commands in Huawei's Dopra Linux

                      Can't connect RFCOMM socket: Host is down

                      Kernel panic - not syncing: Fatal Exception in Interrupt