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

1
  • 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. Dec 23 '11 at 16:41
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}
1
  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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