2

In general I write in the text: \index{Barmherzigkeit} and \index{Gnade} and at the end of the document I include the index with \printindex. (I work with LyX)

I want that all Words ("gnädig" and "Gnade") are listed under the index with keyword "Gnade"

By now I have manually wrote the \index command (on page 1 and 10) which page reference should be used for the keyword "Gnade". There are many words "Gnade" in my text, so I'd like that LaTex automatically finds the words "Gnade" in the text and interpretate these as \index{Gnade} so that the entry in the index for "Gnade" shows: Gnade, 1,6,10,13.

Is it possible to write somewhere before \printindex a list with keywords like "Gnade" that LaTex has to search in the document and then print the page numbers of its finding in the index?

my text:

\documentclass[twoside,ngerman,fontsize=10pt]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=2.5cm,bmargin=2.5cm,lmargin=2.5cm,rmargin=2.5cm}
\pagestyle{empty}
\setlength{\parskip}{1em}
\setlength{\parindent}{0pt}
\usepackage[active]{srcltx}
\usepackage{fancybox}
\usepackage{makeidx}
\makeindex
\PassOptionsToPackage{normalem}{ulem}
\usepackage{ulem}
\usepackage{nomencl}
\providecommand{\printnomenclature}{\printglossary}
\providecommand{\makenomenclature}{\makeglossary}
\makenomenclature
\makeatletter
\renewcommand{\nomname}{Glossar}
\usepackage{fancybox}
\makeatother
\usepackage{babel}
\usepackage{lipsum}

\begin{document}

Page 1: 
Zuvor haben wir die Vergebung \index{Vergebung} betrachtet. Gott ist gerecht und zugleich gnädig \index{Gnade}.
\newpage
\lipsum[1-30]
\newpage

Page 6
Was bedeutet Gnade? \index{Gnade}
\newpage
\lipsum[1-20]
\newpage

Page 10:
Wir alle haben Gnade \index{Gnade} erfahren.
\newpage
\lipsum[1-15]
\newpage

Page 13:
Gnade ist unverdient.\index{Gnade}
\newpage
\lipsum[1-10]
\newpage

\printindex{}

\end{document}
  • Don't. It will make your index much less useful if you list a large number of occurrences of the same term, without selecting the important ones and without distinguishing them in any way for the reader. – cfr Apr 2 '15 at 22:15
  • 1
    Apart from what @cfr says, you simply can't do that without some markup. By the way, you should do \index{Gnade}Gnade – egreg Apr 2 '15 at 22:59
  • A tip for you (indexing against keyword file): tex.stackexchange.com/questions/136109/… – Malipivo Apr 2 '15 at 23:37
  • 1
    Do not confuse an index with a word concordance! However, if you write \Vergebung instead of Verbegung, there are possibilities. E.g., you might have \Vergebung (regular index entry), \Verbegun* (no index entry), and, say(?), \Vergebung[als Verzeihung] (sub-entry). – jon Apr 3 '15 at 1:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.