# index not appearing after using the right commands

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?

• 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
• 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

\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: