7

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): enter image description here

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:

enter image description here

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
1
  • Although I'd still like to learn how to get this going without running makeindex separately between pdflatex runs I have now gone that route. So I use just imakeidx with the working styles and run makeindex separately Jun 11, 2020 at 6:53

1 Answer 1

0

I think you are nearly there; in fact, you mention the solution yourself:

I may be able to fix that by just using makeindex and running makeindex between two pdflatex calls(?)

If you would like to add an item to the index using the makeidx package, proceed as follows:

  1. Add the item, e.g. \index{item}
  2. Save the file
  3. Compile your pdf file
  4. Run MakeIndex
  5. Compile your pdf file again

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .