12

(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.)

lockstep
  • 250,273
topepo
  • 263
  • Welcome to TeX.sx! Your question was migrated here from [so]. 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

1 Answers1

14

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}
egreg
  • 1,121,712
  • 1
    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