I have a document where I mention external references, sometimes more than once. I want an index of these mentions somewhere at the beginning of the document. And I do not want a title above. And I want it to be at the same width as the text (1 column)
I have tried this at first with indextools
since this has the afterindex
option. That makes the index work in that I can add index items later and they will show up. However, the columns
options for \makeindex
gets ignored, so it always shows as two columns and I want one. Also, I don't want the title, I just want to show the list where I call \printindex
.
This is what the (minimized) code for that looks like:
\documentclass[10pt, a4paper]{article}
\usepackage{filecontents}
\begin{filecontents*}{index_style.ist}
delim_0 "\\dotfill"
delim_1 "\\dotfill"
delim_2 "\\dotfill"
\end{filecontents*}
\usepackage[afterindex,nonewpage]{indextools}
\usepackage[colorlinks=true]{hyperref}
\makeindex[
name=references,
title=References used,
columns=1,
options={-s index_style.ist}
]
\begin{document}
\noindent The following references are used in this document
\printindex[references]
\noindent add something to the index \index[references]{something}
\noindent add something else to the index \index[references]{something else}
\noindent add item to the index \index[references]{item}
\noindent add another item to the index \index[references]{another item}
\end{document}
Which yield this result (after two consecutive pdflatex runs):
Then I tried with imakeidx
, with that the columns
option works, so the list shows in one column, however, now I am no longer able to add index items afterwards. I may be able to fix that by just using makeindex and running makeindex between two pdflatex calls(?)
Anyway, maybe there's a better way to do this. The end result should look something like this:
Some notes:
- In the actual document, I want this reference and a (normal) glossary
- I may also want another one of this type of index (hence the named index)
- The actual document will be a lot larger, this MWE is indeed minimal in comparison
- The
indextools
solution got me closest, but:- I couldn't get it to go to just one column
- I could not find how to hide the index title