Indexed words missing in the output pdf. Motivation is missing. How to fix this?

\documentclass[12pt] {book}

\usepackage{makeidx}       % follow try index format makeidx and hyper ref together
\usepackage{hyperref}

\makeindex    % 17 Nov 2014
\begin{document}

My main \index{motivation} is to address the plunging state of the education

\printindex

\end{document}

• Did you run makeindex after compiling the file and then compile it again? Also, you probably want \index{motivation}motivation in the text? – cfr Nov 18 '14 at 2:30
• Yes I did. I generated the .ind file with zero errors. Then I typeset Latex on TS. – mark Nov 18 '14 at 2:36
• And then you recompiled the .tex file? When I compile your code, I get the index. I have to add the word to get it in the text, but I get the index. – cfr Nov 18 '14 at 2:37
• The main problem is that the pdf output has lost the indexed word. It should be there in the first place. Thanks cfr.. – mark Nov 18 '14 at 2:38
• I got it. You leave the original text alone. It works. Thanks – mark Nov 18 '14 at 2:42

If I compile your code as it is using pdflatex -> makeindex -> pdflatex, I get the index produced fine:

However, this probably isn't quite what you want in the main text of the document:

\index{motivation} adds motivation to the index. That's it. It does not also typeset the word in the text. So, you probably want something like this:

\documentclass[12pt] {book}

\usepackage{makeidx}       % follow try index format makeidx and hyper ref together
\usepackage{hyperref}

\makeindex    % 17 Nov 2014
\begin{document}

My main \index{motivation}motivation is to address the plunging state of the education

\printindex

\end{document}


which gets you the term in the index and the text: