在标点符号之前还是之后使用 \index?

在标点符号之前还是之后使用 \index?

在我看来,如果你使用say\index{say}.与使用不同的字距调整,那么say.\index{say}我可以看到以下愚蠢的例子:

\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}

在我看来它们有所不同:

谚语

所以我问,这是正确的方法吗say.\index{say}?任何命令都应该放在标点符号后面(例如\label等)吗?

答案1

在日志文件中更容易看到差异。

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

1say.\index{say}

2say\index{say}.


\end{document}

节目

....\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

正如您在问题中所建议的那样,这证实了您丢失了字体指定的字距,从而纠正了.本例中之前的空格-0.97916pt

正如我看到 egreg 刚才评论的那样,最好把\index 以避免这些问题。

相关内容