Some of my index entries are being rejected for some reason. How do I determine which index entries were rejected?
For instance if I uncomment the \def
at the top of the MWE below I see the message in the console. All this does is switch from suing \tiny
to \small
. Not sure why one would be ok but the other.
Scanning input file TestIndex.idx...done (0 entries accepted, 10 rejected)
I searched for the word rejected
in imakeidx.sty
but that word is not in that file, so not sure where this message is coming from.
The above is just one cause of the entries being rejected. I need to know what are some of the other causes as I have some rejected without using \small
.
References:
- This is a follow up to Index hyperlinks to open a PDF file.
Code:
%\def\UseSmallInIndex{}%
\documentclass{article}
\usepackage{datatool}% database
\usepackage{imakeidx}% indexing
\usepackage{hyperref}% For cross references
\usepackage{xcolor}%
\makeindex
% ---------- Process Each Word:
%
% https://tex.stackexchange.com/questions/12810/how-do-i-split-a-string
\makeatletter
\def\ProcessEachWord#1{%
\begingroup%
\edef\@tempa{#1\space}%
\gdef\@tempb{#1}%
\expandafter\endgroup%
\expandafter\ReadWords\@tempa\relax%
}%
\def\ReadWords#1 #2\relax{%
\ProcessWord[\@tempb]{#1}% #1 = substr, #2 = rest of string
\begingroup%
\ifx\relax#2\relax% is #2 empty?
\def\next{\endgroup\EndProcessWords}% your own end-macro if required
\else%
\def\next{\endgroup\ReadWords#2\relax}%
\fi%
\next%
}%
\makeatother
% ----------
\newcommand{\ProcessWord}[2][]{%
\ifdefined\UseSmallInIndex%
\index{#2!#1\href{run:#1.pdf}{\small\textcolor{red}{pdf}}}%
\else%
\index{#2!#1\href{run:#1.pdf}{\tiny\textcolor{red}{pdf}}}%
\fi%
}%
\newcommand{\EndProcessWords}{}
\begin{document}
\DTLnewdb{DB}%
\DTLnewrow{DB}%
\DTLnewdbentry{DB}{FileName}{Now good enough}%
\DTLnewrow{DB}%
\DTLnewdbentry{DB}{FileName}{Now good enough for you and me}%
\DTLforeach{DB}{\FileName=FileName}{%
\section{\FileName}%
\par\noindent\href{run:\FileName.pdf}{\FileName}%
\ProcessEachWord{\FileName}%
}%
\printindex
\end{document}