# created a fixed page number of an index entry

(First, I would like to state that I am aware that this is a ridiculous and idiotic question. It is for the purpose of a ridiculous and idiotic joke.)

I'd like to use \index to add an entry that will have a fixed page number no matter where the index entry is located. Is there anything that can be used to do this within the LaTeX document? (I'd rather not edit the ind file because re-compiling the document would probably eliminate the entry.)

-

## migrated from stackoverflow.comDec 23 '11 at 16:39

This question came from our site for professional and enthusiast programmers.

Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. –  Torbjørn T. Dec 23 '11 at 16:41

Just emulate what \index does.

\documentclass{article}
\usepackage{makeidx}
\makeindex
\begin{document}

\makeatletter
\protected@write\@indexfile{}{\string\indexentry{Derek, Bo}{10}}
\makeatother

An index entry\index{index}

\printindex
\end{document}

-
That did the trick. Thanks. –  topepo Dec 23 '11 at 18:43
If hyperref is used: \protected@write\@indexfile{}{\string\indexentry{Derek, Bo|hyperpage}{10}}, and for special format e.g. \protected@write\@indexfile{}{\string\indexentry{Derek, Bo@\string\textsc{Derek}, Bo|hyperpage}{10}} or \protected@write\@indexfile{}{\string\indexentry{Derek, Bo|hyperindexformat{\string\textbf}}{10}} for a bold page number. –  Stephen Apr 30 '12 at 17:19