So I am currently writing my thesis.

I used the following snippet

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

Blah

\pagestyle{empty}
\begin{theindex}
\index{Blah}

\end{theindex}
\printindex
\end{document}

The document gets created and a new page is devoted to titled Index, but the index numbering is not appearing. Is there any reason?

  • 1
    Welcome, your cllaiming to use the right commands. But are you using the right tools? A program that creates your index would also include the call for \begin{theindex}, as well as the index. So i am a bit confused. Please post a minimal working example. – Johannes_B Dec 15 '17 at 17:26
  • 2
    the document you show looks wrong not right, the \index command is supposed to go in your main text, not inside a theindex environment. The theindex environment is then generated by the makeindex program by sorting the output from \index so it should not appear in the document. – David Carlisle Dec 15 '17 at 17:32

Your document should look like

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


Blah\index{Blah}



\printindex
\end{document}

Then run pdflatex once (it will warn of no .ind file) then run makeindex which will generate the index, then run pdflatex again so the index file is included.

I deleted the theindex environmemt (as this is generated by makeindex and I deleted \thispagestyle{empty} as you need page numbers to make sense of the index.

producing a two page doc as below:

enter image description here

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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