0

Working in the memoir class, I would like to add some content on the final page of an index. Is there a simple way of doing this?

There is no \postindexhook to match \preindexhook [though there is a \postbibhook to match \prebibhook].

2 Answers 2

0

I had no problem adding text on the final page of an index. Below is the code I used for printing 2 indexes in a 100 page memoir document.

......
\onecolumn % \onecolindex
\threecolindex
\renewcommand*{\indexname}{General Index}
\printindex % general index

TEXT AFTER THE INDEX

\renewcommand*{\indexname}{Index of Author/Quoter Names}
\printindex[names] % names

\end{document}

and the TEXT AFTER THE INDEX was printed on the last page of the first index. Have you tried just putting your final content after \printindex and before anything after that? I'm not sure what the format of the final content will be; the default indexing is twocolumn.

EDIT AND APOLOGY

When I tried the above code I had not realised that I was using 3-column indexes. This was accomplished by code from @daleif that put the index into a multicols{3} environment which did not extend after the index so the TEXT AFTER THE INDEX was after the end of the multicols.

Perhaps @PeterSmith and @daleif could come up with a general answer?

Should I delete this answer?

0
0

Just so an answer is recorded for the question.

Experimenting, in response to Peter Wilson's reply, to work out why things went differently for us, it turns out that there is a difference here in the behaviour of makeidx [which I was using] and imakeidx [which also allows multiple indexes, which I guess he was using].

If I change to imakeidx, then indeed added text appears on the same page!

4
  • imakeidx might completely redefine the theindex env. But so far you also haven't explained what type of text is to be added at the end. Should it be added to an index column... (there is a reason why we always ask for a minimal example to work with). You should be able to inject stuff into the end of theindex env via the kernel Hook mechanism
    – daleif
    Jan 20, 2022 at 8:30
  • @daleif and Peter Smith please see my edited answer. Jan 20, 2022 at 18:17
  • @daleif A two-column index with a balanced final page may well finish with a lot of white space on that final page. I wanted to be able to add some content, not in either index column, but below the index in this available space. Jan 21, 2022 at 10:59
  • I think I might understand what you mean now. In a standard memoir doc the index runs inside \twocolumn ... \onecolumn after which a page break is forced (as two column here is implemented in the output routine as contrary to say the multicol package. If you have an up to date LaTeX, \AddToHook{env/theindex/end}{test} will add test inside the twocolumn part of the index.
    – daleif
    Jan 21, 2022 at 11:07

You must log in to answer this question.

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