# making an index of words in texstudio

so i want to make an index that shows where certain words appear in which pages in the output pdf

let's say I have a document that contains a certain amount of the word "avocado" and at the end of the file, i want texstudio to show which page contains that word something like

avocado- 10, 15, 420, 500,

is anything like that possible and if not, what's the closest I can do? i did try using makeindex, printindex and all that and maybe that was it, but i can't seem to figure out how those work either

• makeindex is the solution. You could provide an example showing what you've tried and got by far. May 8 at 8:00
• unfortunately i can't present an exact example of what i did after someone other than me tried to figure out how it worked, but i believe it was something along the lines of \begin{theindex} \index{avocado} \index{potato} \end{theindex} and then also put a printindex call at the end of the main document May 8 at 12:45

Along the lines of:

% index2prob.tex SE 643379

\documentclass{article}
\setlength{\textheight}{0.5\textheight}
\usepackage{lipsum}
\usepackage{makeidx}
\makeindex

\begin{document}

\newpage

Different stuff about potatoes\index{potato} and avocardos.\index{avocardo}

Remember that the sequence of events should be:
\begin{itemize}
\item \verb!pdflatex index2prob! % compile the document
\item \verb!makeindex index2prob! % generate the index
\item \verb!pdflatex index2prob! % compile the document with its index
\end{itemize}
\printindex
\end{document}


• that worked like a charm, thanks May 8 at 19:31