[tex-eplain] Patch to add encapsulation support with index range terms

geolsoft at mail.ru geolsoft at mail.ru
Thu Mar 31 13:49:19 CEST 2005


Dear list members,

I noticed that there is one feature supported by MakeIndex
which cannot be accessed thru eplain's indexing macros.

According to makeindex(1), the following construction is
allowed

    \indexentry{alpha|(bold}{1}
    \indexentry{alpha|)}{5}

However, when I say \sidx[begin,pagemarkup=bold]{alpha}, I
get something like

    \indexentry{alpha|(|bold}{1}

While this actually IS illegal according to eplain's
documentation, it seems trivial to add this functionality to
eplain (see the attached patch).

In case this patch gets accepted, a change in the
documentation would be needed, as currently it states that
only one of

    [begin,end,see,sealso,pagemarkup=*]

is allowed, but after the patch, `pagemarkup' can go along
with `begin'.



And one more thing:  would it be a good idea to add a note
to the documentation that `raw' entries can be specified in
\sidx, e.g., that it is possible to get subsubentries by
saying

    \sidx{Differential equation!linear!homogeneous}

Thanks.


Best regards,
Oleg Katsitadze
-------------- next part --------------
--- xeplain.tex.orig	2005-03-31 12:59:25.000000000 +0300
+++ xeplain.tex	2005-03-31 13:24:58.000000000 +0300
@@ -1995,7 +1995,8 @@
 %
 % \@finfinidxtokscollect{PAGENO} writes \@indexentry for page PAGENO.
 % Besides \@indexentry, if \@idxpagemarkup is not \relax we output an
-% index entry \@indexentry|\@idxpagemarkup{PAGENO}.  And if
+% index entry \@indexentry|\@idxpagemarkup{PAGENO} (omitting | if this
+% is a range term).  And if
 % \@idxseenterm is not \relax we output {\@idxseenterm} after the
 % \@idxpagemarkup.  (This will become an argument to the ``markup''
 % command, which will be \indexsee or \indexseealso.)
@@ -2004,7 +2005,14 @@
   % If we've got a page markup command, append it.
   \ifx\@idxpagemarkup\relax \else
     \toks@ = \expandafter{\@indexentry}%
-    \edef\@indexentry{\the\toks@ \idxencapoperator \@idxpagemarkup}%
+    % If this is a range term we omit \idxencapoperator because
+    % it was already inserted with \@idxrangestr
+    \edef\@indexentry{%
+      \the\toks@
+      \ifx\@idxrangestr\empty
+        \idxencapoperator
+      \fi
+      \@idxpagemarkup}%
     \let\@idxpagemarkup = \relax
   \fi
   %


More information about the tex-eplain mailing list