Page LayoutCorrect Header for Nomenclature

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

Correct Header for Nomenclature

Post by Kenetork »

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.

Code: Select all

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

Code: Select all

\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.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

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

Correct Header for Nomenclature

Post by magical marshmallow »

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:

Code: Select all

	
\documentclass[11pt,a4paper]{scrreprt}
\usepackage{fancyhdr}
	\pagestyle{fancy}
	\fancyhead[L]{\includegraphics[scale=0.48]{Images/qub-logo(3).png}}
	\fancyhead[R]{\slshape \leftmark}
	\renewcommand{\headrulewidth}{0.3pt}

\usepackage{nomencl}
	\makenomenclature
	\renewcommand{\nomname}{Nomenclature \& Abbreviations}

\begin{document}
\protect\thispagestyle{fancy}	
	\phantomsection \addcontentsline{toc}{chapter}{Nomenclature \& Abbreviations}
	\twocolumn
	\titlespacing*{\chapter}{0cm}{-0.26cm}{0.65cm}
	\chaptermark{Nomenclature \& Abbreviations}
	\printnomenclature[1.8cm]
	\protect\thispagestyle{fancy}
\end{document}
I've no idea where to look

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

Correct Header for Nomenclature

Post by magical marshmallow »

In the above example, the addition of this line immediately prior to \twocolumn solves the problem.

Code: Select all

\renewcommand{\nompreamble}{\protect\thispagestyle{fancy}}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Correct Header for Nomenclature

Post by localghost »

The smart way by using the stuff of KOMA-Script. Just for others with the same problem searching for a complete example.

Code: Select all

\documentclass[
  DIV=12,
  headsepline
]{scrreprt}
\usepackage[T1]{fontenc}

\usepackage[automark]{scrpage2}
\clearscrheadings
\lohead{\headmark}
\rohead{\pagemark}
\pagestyle{scrheadings}
\automark[section]{chapter}

\usepackage{multicol}
\setlength{\columnsep}{8mm}

\usepackage{nomencl}  % Do not use option `intoc` because of the patch (see below)
\makenomenclature
\renewcommand{\nomname}{Nomenclature \& Abbreviations}
\renewcommand{\nompreamble}{\thispagestyle{scrheadings}\begin{multicols}{2}}
\renewcommand{\nompostamble}{\end{multicols}}

%% Patch for {thenomenclature} environment to adapt it to KOMA-Script
%% necessary for correct headers (only guaranteed with »scrpage2«)
%% Side effect is that the nomenclature gets an automatic ToC entry
%% Makes the package option `intoc` for »nomencl« superfluous
\usepackage{etoolbox}
\patchcmd{\thenomenclature}{\chapter*}{\addchap}{}{}
\patchcmd{\thenomenclature}{\section*}{\addsec}{}{}

\usepackage[toc]{blindtext}  % For dummy text, not for use in actual document

\begin{document}
  \blinddocument  % For dummy text, not for use in actual document

  \nomenclature{TXC}{\TeX nicCenter -- A \LaTeX\ IDE only available for the Windows operating system}
  \nomenclature{TXM}{\TeX maker -- A \LaTeX\ IDE available for all major platforms}
  \nomenclature{TXW}{\TeX works -- A simple \LaTeX\ editor available for all major platforms, integrated in \TeX\ Live and MiK\TeX}
  \nomenclature{TXS}{\TeX studio -- A \LaTeX\ IDE available for all major platforms, fork of \TeX maker}
  \printnomenclature[1.8cm]
\end{document}
Post Reply