[texhax] index entries in latex/makeindex, post 2

Zbigniew Nitecki zbigniew.nitecki at tufts.edu
Tue Dec 16 17:14:40 CET 2008

Earlier, I posted a question concerning index entries.  The problem  
looks even more subtle than I first thought.

To recall,
In a book I am writing in latex (using makeindex to generate the  
index) I am running into a confusing anomaly.

The following macros are among those I have to generate index entries:
\newcommand{\namerefindex}[4]{\index{#2, #1 (#3-#4)}}%prints name,  
date in index not text
\newcommand{\namerefsilent}[4]{#1\  #2\ (#3-#4)}%prints name, date in  
text not index
\newcommand{\nameref}[4]{#1\  #2\ (#3-#4)\namerefindex{#1}{#2}{#3}{#4}} 
%prints name, date in text
\newcommand{\namesubref}[5]{\index{#2, #1 (#3-#4)!#5}}%prints subentry  
in index
(the usage is: \nameref{Firstname}{Lastname}{Birthdate}{Deathdate}
and in the subref, #5 is an index entry under the entry above.

Included in the same macro file are the following:
\newcommand{\Fermatref}{\nameref{Pierre de}{Fermat}{1601}{1665}}
and the following paragraph appears in my text:
The idea of using a pair of numbers in this way to locate a point in  
the plane was pioneered in the early seventeenth cenury by  
\Fermatref{} and \Descartesref{}.  By means of such a scheme, a plane  
curve can be identified with the \deffontcustom{locus}{locus!of  
equation} of points whose coordinates satisfy some equation;  the  
study of curves by analysis of the corresponding equations, called  
\deffont{analytic geometry}, was initiated in the research of these  
two men.  Actually, it is a bit of an anachronism to refer to  
rectangular coordinates as ``Cartesian'', since both Fermat and  
Descartes often used \deffontcustom{oblique coordinates}{Coordinate  
System!oblique}, in which the axes make an angle other than a right  
one.\footnote{We shall explore some of the differences between  
rectangular and oblique coordinates in \refer{ex}{oblique}.}   
Furthermore, Descartes in particular didn't really consider the  
meaning of negative values for the abcissa or ordinate.
Ignore the \deffontcustom and \refer commands;  they involve totally  
different stuff.

When I run the full book text as described above, I get an error  
messages referring to the
paragraph quoted above:
LaTeX Warning: Reference `Pierre de' on page 2 undefined on input line  

! Missing \endcsname inserted.
<to be read again>
l.52 ...h cenury by \Fermatref{} and \Descartesref
                                                   {}.  By means of  
such a sc...

When I replace \'e with e in the \Descartesref macro, I don't get the  
missing \encsname
error, but the printed text has, where the two references are, the  
following (I was unable to copy and paste off my pdf, so am retyping  
what I see;  the stuff in [ ] is a description):
...century by ??Fermat16011665 and ??[\'e, printed properly]Descartes.  
By means...
and neither entry appears in the index.

HOWEVER, when I isolate all of this in a test file, inserting the same  
paragraph there, and calling the same macros file,
everything works fine.

I am at a total loss as to what to even look for.  Any suggestions  
would be much appreciated.

Zbigniew Nitecki
Department of Mathematics
Tufts University
Medford, MA 02155

Office    (617)627-3843
Dept.    (617)627-3234
Dept. fax    (617)627-3966

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/texhax/attachments/20081216/2817e009/attachment.html 

More information about the texhax mailing list