This question is just like that of Mark indexed entries in the text itself?, except for use with the memoir document class.

How can index entries be marked within the text adjacent to where the \index command is placed — and not in the corner of the page as showidx does it, either:

  • above the line, the way showkeys does it; and/or
  • in the margin on the line where the \index appears?

Ideally, the user should have control over the format (font family, size, and color) of the entries that appear.

The answer at the cited question does not work with memoir.

A solution needs to work with:

  1. hyperref (and Heiko Oberdiek's "quick and dirty fix to allow showidx and hyperref to coexist).
  2. Multiple indexes, e.g. he main one and an index of names (where one uses \index[names]{..}).

Here's a sample source file, albeit with only a single index:




%Begin the ``quick and dirty hack'' due to Heiko Oberdiek which loads showidx
% Hook in \HyInd@@wrindex
% Hook in \HyInd@@wrindex for package showidx
% Load package showidx
% rest of hyperref part
%End the ``quick and dirty hack'' due to Heiko Oberdiek which loads showidx



\chapter{We begin}\index{beginning}

\index{Hello}  %
to the World!\index{World}

\index{alphabet|see{abc}} %
is before def.\index{greeting!hello|)}



And here's an accompanying .ist file:

headings_flag 1
heading_prefix "{\\medskip\\hfill\\large\\textsf{\\textbf{"
heading_suffix "}}\\hfill}\\medskip\\nopagebreak\n"
  • I think that you are asking for a change to memoir. I have looked at my original code but through fading capabilities I can't understand it. Perhaps the current maintainer could help. – Peter Wilson May 31 at 18:07
  • @PeterWilson: Thank you for doing that much! I was hoping there could be a simple patch the user could include in a preamble, given that (1) memoir emulates showidx, and (2) the answer at tex.stackexchange.com/questions/64249/… does what I want if one is using showidx itself (with book or article documentclass). – murray Jun 1 at 0:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.