我已经创建了一个索引列表,并希望确保显示与索引中出现的条目相对应的所有页面(即,如果术语“urbanization”出现在第 34、120、150 页,则这三个页面将显示在索引中。)除了手动执行此操作(搜索 urbanization 以查找整个文本并在每次出现时添加命令 \index),有没有更快的方法?谢谢。
答案1
这是一个反复出现的话题。人们多次评论说,一个好的索引需要许多人为决定来包含/排除/修改/链接术语,因此自动索引通常不被认为是一个好主意。
说的是,和xelatex
,xesearch
稍微改变一下此答案用于格式化首字母缩略词,似乎在某种程度上起作用:
\documentclass{article}
%\usepackage[margin=3mm,bmargin=5mm,footskip=1mm,paperheight=8cm]{geometry}
\usepackage[colorlinks]{hyperref}
\usepackage{makeidx} \makeindex
\usepackage{xesearch}
\UndoBoundary{-} % allow hyphens!!
\SearchList{index}{#1\index{{#1}}}{antibod?,covid?,infection,rna,DNA,*ELISA,*WHO,?pcr,%
RT-pcr,Multiplex-PCR,usa,UK,SARS?,virus,sensit?,test?}
\begin{document}
Mr. So and So, from the
WHO, % organization, must be indexed
\newpage
who % common word, must be not indexed
has announced yesterday in the UK and the USA that the
ELISA % method acronym, must be indexed
\newpage
test to detect antibodies against SARS-CoV-2 \newpage\newpage\newpage
in COVID-19 patients with with first signs of the disease is useless,
said now that even PCR methods, \newpage\newpage
like RT-PCR \newpage
nested PCR,\newpage
quantitative PCR,\newpage\newpage\newpage\newpage
and Multiplex-PCR test, \newpage\newpage\newpage
used too early in the course of infection
are not enough sensitives.\newpage
On the other hand, the researcher
Elisa % Woman name, must be not indexed
Whoknow proposed a WHO meetings to discuss the
disgnostic protocols of SARS and RNA virus and the sensitivity of a new indirect antibody test.
\StopList {index}
\newpage
\printindex
\end{document}