
所以我想製作一個索引來顯示某些單字出現在輸出pdf中的哪些頁面中
假設我有一個包含一定量單字「avocado」的文檔,在文件末尾,我希望 texstudio 顯示哪個頁麵包含該單詞,例如
avocado- 10, 15, 420, 500,
類似的事情有可能嗎?我確實嘗試過使用 makeindex、printindex 以及所有這些,也許就是這樣,但我似乎也不知道它們是如何運作的
答案1
沿著以下路線:
% index2prob.tex SE 643379
\documentclass{article}
\setlength{\textheight}{0.5\textheight}
\usepackage{lipsum}
\usepackage{makeidx}
\makeindex
\begin{document}
Stuff about avocados.\index{avocardo}
\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}