TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In book class, I want to redefine the \printindex command and change it to something like the following:


How can I do this?
My tex file is as follow:

‎\usepackage{fancyhdr} ‎‎
share|improve this question
the page style plain is the default for the index. Why do you want to redefine it? – Herbert Feb 10 '11 at 16:23
@Herbert: I wanted to delete the page number on the first page. – Vahid Damanafshan Feb 10 '11 at 19:48
up vote 4 down vote accepted

You can save a macro away using \let\origmacro\macro, where \origmacro is a name you can pick. Then your redefine the macro and call its original version internally, mostly at the very end:

  ‎  \fancyhf{}‎%

You might want to place all this into a group.

share|improve this answer
Thanks, this is exactly what I was looking for. BTW, is this method applicable for every command (e.g., ‎\tableofcontents‎)? – Vahid Damanafshan Feb 10 '11 at 16:20
@Vahid: It should work for all user macros. But you must be careful not to redefine a robust macro in a fragile way. I'm talking about macros which are written into to ToC and .aux files, e.g. the ones used inside section titles. Also problems arise when two people/packages redefine the same macro and use the same name for '\origmacro'. – Martin Scharrer Feb 10 '11 at 16:27
Thanks, your explanation is quite clear. – Vahid Damanafshan Feb 10 '11 at 19:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.