
Рассмотрим MWE:
\documentclass[12pt]{article}
\usepackage{imakeidx}
\makeindex
\newcommand\pagedot[1]{#1.}
\usepackage{idxlayout}
\begin{document}
This is a sentence.\index{\textbf{Corresponds to the first sentence}|pagedot}
This is another sentence.\index{\textbf{Corresponds to the second sentence}}
This is another sentence.\index{\textbf{Corresponds to the third sentence}}
\idxlayout{columns=1}
\printindex
\end{document}
который производит Индекс:
Как вы видите, я добавил точку после номера страницы в первой записи, вызвав новую определенную команду, pagedot
. Однако я хотел бы сделать то же самое для каждой записи индекса, которая у меня может быть.
ВОПРОС: Как автоматически добавлять точку после номера последней страницы каждой записи указателя?
Спасибо.
решение1
Я думаю, что на этот вопрос уже ответили в другом посте в комментариях. Я сделал рабочий пример использования файла стиля ( *.ist
), чтобы задать delim_t
ключ, "."
чтобы сгенерировать точку после каждой записи после самого последнего номера страницы.
\begin{filecontents*}{style.ist}
delim_t "."
\end{filecontents*}
\documentclass[12pt]{article}
\usepackage{imakeidx}
\makeindex[options=-s style.ist]
\usepackage{idxlayout}
\idxlayout{columns=1}
\begin{document}
This is a sentence.\index{\textbf{Corresponds to the first sentence}}
This is another sentence.\index{\textbf{Corresponds to the second sentence}}
This is another sentence.\index{\textbf{Corresponds to the third sentence}}
\clearpage
This is a sentence.\index{\textbf{Corresponds to the first sentence}}
This is another sentence.\index{\textbf{Corresponds to the second sentence}}
\clearpage
This is a sentence.\index{\textbf{Corresponds to the first sentence}}
\printindex
\end{document}