Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

It seems to me that you get different kerning if you use say\index{say}. than if you use say.\index{say} The following silly example is where I can see it:

\documentclass[12pt]{memoir}
\usepackage{microtype}
\begin{document}
Some simple text about say.\index{say}
Additional text about say\index{say}.
say\index{say}. say.\index{say}
say\index{say}. say.\index{say}
say\index{say}. say.\index{say}
say\index{say}. say.\index{say}
say\index{say}. say.\index{say}
say\index{say}. say.\index{say}
say.\index{say} say.\index{say}
say\index{say}. say.\index{say}
say\index{say}. say.\index{say}
say\index{say}. say.\index{say}
say\index{say}. say.\index{say}
say\index{say}. say.\index{say}
say\index{say}. say.\index{say}
say\index{say}. say.\index{say}
say\index{say}. say.\index{say}
say\index{say}. say.\index{say}
say\index{say}. say.\index{say}
say\index{say}. say.\index{say}
say\index{say}. say.\index{say}
Can you see that there are lots of say\index{say}?
\end{document}

They look different to me:

Sayings

and so I ask, is the proper method say.\index{say}? Should any command come after punctuation (i.e., \label etc)?

share|improve this question
3  
\index{say}say –  egreg Mar 23 at 23:32
3  
So if I were doing the shortcut that many recommend, would it be \newcommand{\I}[1]{\index{#1}#1} and would that kern correctly? I tested it with \showoutput and it seems to work. –  bombcar Mar 24 at 0:27
add comment

1 Answer 1

up vote 13 down vote accepted

It's easier to see the difference in the log file.

\documentclass[12pt]{memoir}
\usepackage{microtype}
\begin{document}
\showoutput

1say.\index{say}

2say\index{say}.


\end{document}

shows

....\OT1/cmr/m/n/12 1
....\OT1/cmr/m/n/12 s
....\OT1/cmr/m/n/12 a
....\kern-0.32639
....\OT1/cmr/m/n/12 y
....\kern-0.97916
....\OT1/cmr/m/n/12 .
....\penalty 10000



....\OT1/cmr/m/n/12 2
....\OT1/cmr/m/n/12 s
....\OT1/cmr/m/n/12 a
....\kern-0.32639
....\OT1/cmr/m/n/12 y
....\OT1/cmr/m/n/12 .
....\penalty 10000

Which confirms, as you suggest in the question, that you lose the font-specified kern correcting the space before the . in this case -0.97916pt.

As I see egreg just commented it is best to put the \index before the word to avoid these problems.

share|improve this answer
2  
Thanks! I thought I had seen something, and \showoutput may be useful. I wonder why none of the documentation recommend putting \index first. –  bombcar Mar 23 at 23:50
1  
@bombcar -- there are times when you would want to put the \index after, for example if you are indexing a multi-word string, like a name, the string might be split at a page break, and the word that is listed first in the index falls on the second page (Einstein, Albert). then you should indeed put \index after the punctuation. (i'm working on some index documentation, and, thanks to this question, i'll mention the kerning issue.) –  barbara beeton Mar 24 at 1:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.