MakeIndex, Nomenclature, Glossaries and AcronymsEmpty Header for Index Start Page

Information and discussion about MakeIndex - the tool to generate subject indices for LaTeX documents.
Post Reply
ghss
Posts: 5
Joined: Fri Nov 02, 2012 8:39 pm

Empty Header for Index Start Page

Post by ghss »

Hello,

on the first page of the index, I'm getting "Index" as chapter name as well as a small "Index" in the top right of the page (see attached figure). I want this header from next page but not on the starting page of Index. Where am I making a mistake?

ghss
indexerror.png
indexerror.png (9.39 KiB) Viewed 8383 times

Recommended reading 2024:

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

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

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Empty Header for Index Start Page

Post by kaiserkarl13 »

Does issuing \thispagestyle{empty} or \thispagestyle{plain} before \printindex help?

If not, you may have to redefine the \printindex command (or use a package that does so) to issue similar commands after \clearpage
ghss
Posts: 5
Joined: Fri Nov 02, 2012 8:39 pm

Empty Header for Index Start Page

Post by ghss »

Hello,
Thanks.
All this are not working.

My code is

Code: Select all

%\cleardoublepage
\clearpage
\addcontentsline{toc}{chapter}{\indexname}
%\markboth{Index}{Index}
\thispagestyle{plain}
%\thispagestyle{empty}
\printindex
And I tried all commented ones also.
Last edited by cgnieder on Sat Nov 03, 2012 11:49 am, edited 1 time in total.
kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Empty Header for Index Start Page

Post by kaiserkarl13 »

I'm going to need more information to find out what you're doing. Please post a Infominimal working example.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Empty Header for Index Start Page

Post by localghost »

You may take a look at the imakeidx package. But in general you should follow the advice of kaiserkarl13 regarding the MWE.


Best regards and welcome to the board
Thorsten
ghss
Posts: 5
Joined: Fri Nov 02, 2012 8:39 pm

Empty Header for Index Start Page

Post by ghss »

Hello,
the code is given below. I think there is some problem in my Header definition.

Code: Select all

% Example for Header in Index problem
\documentclass[10pt,twoside]{book} 

\usepackage{makeidx} % for back index


% Redefining Header 
\usepackage{fancyhdr}


\fancyhead[LE]{\slshape \nouppercase{\leftmark}}
\fancyhead[CE,RE,LO,CO]{}
\fancyhead[RO]{\slshape \nouppercase{\rightmark}}
\fancyfoot[LE,RO]{\thepage}
\fancyfoot[CE,RE,LO,CO]{}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}

\fancypagestyle{plain}{%
\fancyhf{}
\fancyfoot[LE,RO]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}}

\fancypagestyle{chapter}{%
\fancyhf{}
\fancyfoot[LE,RO]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}}



\makeatletter
  \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
  \hbox{}
  \vspace*{\fill}
  \thispagestyle{empty}
  \newpage
  \fi\fi}



\pagestyle{fancyplain}

\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    %\hrule                                        % horizontal line
    \vspace{5pt}%                                 % add vertical space
    \ifnum \c@secnumdepth >\m@ne
        \center \huge \bf \@chapapp\space \thechapter % Chapter number
        \par\nobreak
        \vskip 20\p@
    \fi
    \interlinepenalty\@M
    \center \Huge \bf \scshape #1\par                         % chapter title
    \vspace{5pt}%                                 % add vertical space
   % \hrule                                        % horizontal rule
    \nobreak
    \vskip 40\p@
  }}


\def\@makeschapterhead#1{%
  \thispagestyle{chapter}
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    %\hrule                                        % horizontal line
    \vspace{5pt}%                                 % add vertical space
    \interlinepenalty\@M
    \center \Huge \bf \scshape #1\par                         % chapter title
    \vspace{5pt}%                                 % add vertical space
    %\hrule                                        % horizontal rule
    \nobreak
    \vskip 40\p@
  }}



\makeindex
\begin{document}

\chapter{Falan}
This this something "Falan".
Falan is synonym of "Foo" \index{Falan}.


\cleardoublepage
\addcontentsline{toc}{chapter}{\indexname}
\printindex

\end{document}



kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Empty Header for Index Start Page

Post by kaiserkarl13 »

The problem is that the fancy page style is defining \@mkboth (called by \theindex), which marks both pages. You need to change that somehow. I don't think redefining it by brute force (e.g. \renewcommand{\@mkboth}[2]{} inside \makeatletter will do what you want.

See if there's an option you can use for the fancyhdr package that redefines the "plain" style so it doesn't mark anything in the header.
Post Reply