[tex-eplain] indexing appendices

Oleg Katsitadze olegkat at gmail.com
Sat Mar 1 18:32:41 CET 2008

On Tue, Feb 26, 2008 at 04:08:57PM +0100, Helmut Jarausch wrote:
> Page numbering for the main part as well as for each appendix starts at
> page 1.  I'd like to create an index which shows the plain page numbers
> for the main part (only) and page numbers prefixed by a letter for the
> corresponding appendix, something like
> loop   7, A2
> condition  A2, D5
> Is this possible with Eplain?

Well, as far as Eplain is concerned, the code below seems to work,
with one restriction that appendixes have to start on a new page
(which is quite reasonable to expect in most cases).

Another thing is getting the index out of the .idx file -- MakeIndex
chokes on page numbers prefixed with C and D, because it takes them
for roman numerals.  I've heard xindy (http://xindy.sourceforge.net)
is much more flexible, and can probably be convinced to do the right


\input eplain

\newif\ifprefixpagenumbers \prefixpagenumberstrue

\def\part#1 #2 \par{%
  {\bf #2}\par

% Avoid "undefined macro" errors if \partprefix gets used
% before it gets defined.

% Do not prefix part letter inside the footer.

\part {} Main Part

Text of Main Part.\sidx{foo}

\part A Appendix~A

Text of Appendix~A.\sidx{bar}

\part B Appendix~B

Text of Appendix~B.\sidx{term}\sidx{bar}\sidx{foo}

\part C Appendix~C

Text of Appendix~C.\sidx{another term}\sidx{bar}

\part D Appendix~D

Text of Appendix~D.\sidx{yet another term}\sidx{foo}

\part {} Index



More information about the tex-eplain mailing list