Capitalization of index entries

Djones9976 djones9976 at aol.com
Thu Mar 19 19:46:17 CET 2020


Sorry, but I am not as far out of the woods as I thought.   The code you sent works well; it converts the first letter of all the lower case indexed words to upper case but the problem now is that it indexes all the words converted to capitals and adds that list to the original list of words that were already capitalized.   How can I get it to combine all the indices into one list.
For example what I had was an alphabetical list with some words capitalized and some lower case:
charles, 79
Friction, 82
Henry, 84Newton, 75pulley, 78
windlass, 82


Now what I get with the code you sent me is two alphabetical lists one with the originally capitalized words and one with the the lower case words that have now been capitalized,

Friction, 82
Henry, 84Newton, 75Charles, 79
Pulley, 78Windlass, 82

So the question I have been so far unable to solve is how to mesh the two lists together.
Thanks again in advance.
D. W. Jones


-----Original Message-----
From: Djones9976 <djones9976 at aol.com>
To: Herbert.Voss <Herbert.Voss at fu-berlin.de>; texhax <texhax at tug.org>
Sent: Mon, Mar 16, 2020 11:04 am
Subject: Re: Capitalization of index entries

Many thanks Herbert, it worked like a charm.    D. W. Jones


-----Original Message-----
From: Herbert Voss <Herbert.Voss at fu-berlin.de>
To: Djones9976 <djones9976 at aol.com>; texhax <texhax at tug.org>
Sent: Sun, Mar 15, 2020 4:16 pm
Subject: Re: Capitalization of index entries



Am 15.03.20 um 22:03 schrieb Djones9976 via texhax:
> I completed a manuscript for a book making entries for words I wanted 
> to index using the command \index{xxxxx} or \index{Xxxxx} if I wanted 
> to capitalize the word in the index.  Now I find that the generally 
> accepted rule is to capitalize all words whether they are capitalized 
> in the text or not.   Is there a way that I can correct all my 
> \index{xxxxx} entries to read \index{Xxxxx} without changing them one 
> by one?
>

\documentclass{article}
\usepackage{makeidx}\makeindex
\let\myIndex\index
\makeatletter
\renewcommand\index[1]{\index at i#1\@nil}
\def\index at i#1#2\@nil{\myIndex{\MakeUppercase{#1}#2}}
\makeatother
\def\foobar{foobar}% only for demo
\begin{document}

foo\index{foo \foobar} bar\index{a nice bar} baz\index{Baz}

\printindex
\end{document}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/texhax/attachments/20200319/524fbeb5/attachment.html>


More information about the texhax mailing list.