LaTeX forum ⇒ Page LayoutCorrect Header for Nomenclature Topic is solved

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Kenetork
Posts: 1
Joined: Tue Apr 09, 2013 10:17 pm

Correct Header for Nomenclature

Postby Kenetork » Tue Apr 09, 2013 10:24 pm

I am using nomencl and fancyhdr package. The objective is to print name of the chapter or section name in a page header. This works fine for all but the nomenclature.

I fixed the problem protecting the fancy header on ToC with this line.
  1. \addtocontents{toc}{\protect\thispagestyle{fancy}}

I tried adding on top on nomenclature.
  1. \protect\thispagestyle{fancy}

But nothing happens. Thank you in advance. :?
Last edited by cgnieder on Tue Apr 09, 2013 10:51 pm, edited 1 time in total.

Tags:

magical marshmallow
Posts: 30
Joined: Mon Jan 21, 2013 11:37 am

Postby magical marshmallow » Tue Jun 18, 2013 9:35 pm

I am having a similar problem with my code. For some reason when I \include all my chapters, I do not get a header on my first page of Nomenclature. It appears on the second page however.

My code seems to have an adverse reaction to chapter 3, although my guess is because this chapter tips the nomenclature onto a second page.

The code that I am using to produce my list is:

  1.  
  2. \documentclass[11pt,a4paper]{scrreprt}
  3. \usepackage{fancyhdr}
  4. \pagestyle{fancy}
  5. \fancyhead[L]{\includegraphics[scale=0.48]{Images/qub-logo(3).png}}
  6. \fancyhead[R]{\slshape \leftmark}
  7. \renewcommand{\headrulewidth}{0.3pt}
  8.  
  9. \usepackage{nomencl}
  10. \makenomenclature
  11. \renewcommand{\nomname}{Nomenclature \& Abbreviations}
  12.  
  13. \begin{document}
  14. \protect\thispagestyle{fancy}
  15. \phantomsection \addcontentsline{toc}{chapter}{Nomenclature \& Abbreviations}
  16. \twocolumn
  17. \titlespacing*{\chapter}{0cm}{-0.26cm}{0.65cm}
  18. \chaptermark{Nomenclature \& Abbreviations}
  19. \printnomenclature[1.8cm]
  20. \protect\thispagestyle{fancy}
  21. \end{document}


I've no idea where to look

Cheers

magical marshmallow
Posts: 30
Joined: Mon Jan 21, 2013 11:37 am

Postby magical marshmallow » Thu Jun 20, 2013 7:32 pm

In the above example, the addition of this line immediately prior to \twocolumn solves the problem.
  1. \renewcommand{\nompreamble}{\protect\thispagestyle{fancy}}

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Thu Jun 20, 2013 7:46 pm

The smart way by using the stuff of KOMA-Script. Just for others with the same problem searching for a complete example.
  1. \documentclass[
  2. DIV=12,
  3. headsepline
  4. ]{scrreprt}
  5. \usepackage[T1]{fontenc}
  6.  
  7. \usepackage[automark]{scrpage2}
  8. \clearscrheadings
  9. \lohead{\headmark}
  10. \rohead{\pagemark}
  11. \pagestyle{scrheadings}
  12. \automark[section]{chapter}
  13.  
  14. \usepackage{multicol}
  15. \setlength{\columnsep}{8mm}
  16.  
  17. \usepackage{nomencl} % Do not use option `intoc` because of the patch (see below)
  18. \makenomenclature
  19. \renewcommand{\nomname}{Nomenclature \& Abbreviations}
  20. \renewcommand{\nompreamble}{\thispagestyle{scrheadings}\begin{multicols}{2}}
  21. \renewcommand{\nompostamble}{\end{multicols}}
  22.  
  23. %% Patch for {thenomenclature} environment to adapt it to KOMA-Script
  24. %% necessary for correct headers (only guaranteed with »scrpage2«)
  25. %% Side effect is that the nomenclature gets an automatic ToC entry
  26. %% Makes the package option `intoc` for »nomencl« superfluous
  27. \usepackage{etoolbox}
  28. \patchcmd{\thenomenclature}{\chapter*}{\addchap}{}{}
  29. \patchcmd{\thenomenclature}{\section*}{\addsec}{}{}
  30.  
  31. \usepackage[toc]{blindtext} % For dummy text, not for use in actual document
  32.  
  33. \begin{document}
  34. \blinddocument % For dummy text, not for use in actual document
  35.  
  36. \nomenclature{TXC}{\TeX nicCenter -- A \LaTeX\ IDE only available for the Windows operating system}
  37. \nomenclature{TXM}{\TeX maker -- A \LaTeX\ IDE available for all major platforms}
  38. \nomenclature{TXW}{\TeX works -- A simple \LaTeX\ editor available for all major platforms, integrated in \TeX\ Live and MiK\TeX}
  39. \nomenclature{TXS}{\TeX studio -- A \LaTeX\ IDE available for all major platforms, fork of \TeX maker}
  40. \printnomenclature[1.8cm]
  41. \end{document}
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 4 guests