
Betrachten Sie das 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}
wodurch der Index erstellt wird:
Wie Sie sehen, habe ich mit dem neu definierten Befehl , im ersten Eintrag einen Punkt nach der Seitenzahl hinzugefügt. pagedot
Ich möchte dies jedoch für jeden Indexeintrag, den ich habe, genauso machen.
FRAGE: Wie kann ich nach der letzten Seitenzahl jedes Indexeintrags automatisch einen Punkt hinzufügen?
Danke schön.
Antwort1
Ich denke, die Frage wurde bereits im anderen Beitrag durch Kommentare beantwortet. Ich habe ein funktionierendes Beispiel erstellt, bei dem die Stildatei ( *.ist
) verwendet wird, um den delim_t
Schlüssel so festzulegen "."
, dass nach jedem Eintrag nach der allerletzten Seitenzahl ein Punkt generiert wird.
\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}