Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question

migrated from stackoverflow.com Dec 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

1 Answer 1

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}
share|improve this answer
    
That did the trick. Thanks. –  topepo Dec 23 '11 at 18:43
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

 
discard

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.