2

I've written a text with 200 quotes. One quote example:

"Und wir haben die Liebe erkannt und geglaubt, die Gott zu uns hat. Gott ist Liebe, und wer in der Liebe bleibt, der bleibt in Gott und Gott in ihm" (1. Johannes 4,16)

The quote itself is indicated by blockquotes "" and can be running on different lines. The quote reference is given in round brackets (). I like to have the quote reference on one single line, because it looks ugly to have: (1. Johannes on the end of one line and 4,16) on the next line. So I have to replace all quotes which are always introduced by so called blockquotes " (.

With the definition \newcommand{\nobreakword}[1]{\mbox{(#1)}} in the preamble I can define that every () expression is not broken. I can search for all " ( and replace this expression with \nobreakword{(. Consequently to finish the used code for the round brackets I have to replace also all ) with )}.

For a fast repeating text replacement we can use almost every text editor which has a Find+Replace utility. I use TeXstudio (v.2.8.4) and press Ctrl+R in order to find and replace text. I'm sure this is no editor question and works in every editor. I'm flexible to use any other text editor (for Windows 8).

Instead of just using \nobreakword{( I've to search for " (1. Johannes and replace this with a code like this " \addtheentryinsidebracketstothefirstindex{1. Johannes}\nobreakword{(1. Johannes so that the reference is not only save before line break but also included to a specific index entry.

The now used index is made with makeidx and \index{Begriff!Subbegriff} Because I have already used this normal index with some restrictions (vertical spacing between same letter as you see in my MWE) and an introducing text on a page before the regular index starts, I need to have a second index which lists the quotes in a specific way: 1. Korinther ..,.., Galater ..,.., 1. Johannes ..,.., 2. Johannes ..,.. So I need to define the index entries. So I have to define in the preamble somehow the order of this second index, because it's arbitrary, it's not alphabetically sorted (Hoheslied, Jeremia, Markus, Johannes, Römer, 1. Korinther, Galater, 1. Johannes, 2. Johannes)

The first index should look somehow like this:

Hoheslied
Hoheslied 8,4        1,3

Jeremia 
Jeremia 31,3         1

Markus
Markus 10,19-21      1

Johannes
Johannes 3,16        1
Johannes 13,35       1,2
Johannes 15,9        1

Römer
Römer 5,8            1

1. Korinther
1. Korinther 16,14   2

Galater
Galater 5,22         3

1. Johannes
1. Johannes 4,16     4
1. Johannes 4,18-21  4,5

2. Johannes
2. Johannes 1,3     2

It would be cool if I can search for " (1. Johannes and replace all findings with \addtonewindex{1. Johannes}\nobreakword{ or somehow like that for all findings e.g. " (1. Johannes 4,16) and " (1. Johannes 4,18-21). Is it somehow possible to do this with a specific replace text pattern?

In the last page of the PDF generated with the following code I've written how I prefer to have this index entries (starting with a new page).

\documentclass[a4paper,latin,fontsize=10pt,headsepline,parskip=half-,index=totoc]{scrreprt}
\areaset[0pt]{160mm}{247mm}% no binding correction, text width is 160mm, text height is 247mm; with twoside=semi, the margins will be
\usepackage[a4paper,margin=2.5cm]{geometry} %needed for multicol package
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage[normalem]{ulem}
\usepackage{fancybox,calc,etoolbox,lipsum,multicol}
\usepackage[osf,sc]{mathpazo}
\usepackage[intoc]{nomencl}
\renewcommand{\nomname}{Glossar}
\makenomenclature
\usepackage{scrlayer-scrpage}% scrpage2 is obsolete
  \pagestyle{scrheadings}
  \clearpairofpagestyles% \clearscrheadings, \clearscrplain are deprecated
  \automark[chapter]{chapter}
  \ihead[]{\headmark}
  \ohead[\pagemark]{\pagemark}
  \renewcommand*\partpagestyle{empty} % removes the pagenumbers of all part pages
\usepackage{imakeidx} % must always be loaded before the hyperref package, otherwise it can cause problems!
\usepackage[colorlinks,pdfpagelabels,pdfstartview = FitH,bookmarksopen = true,bookmarksnumbered = true,linkcolor = black,plainpages = false,hypertexnames = false,citecolor = black] {hyperref}

\title{Einführung}
\author{Autor}
\date{1.Oktober 2014}

\newcommand{\nobreakword}[1]{\mbox{#1}}

% index
\usepackage{makeidx}
\makeindex[intoc,title=Stichwortverzeichnis] % no redefining is needed with \renewcommand{\indexname}{Stichwortverzeichnis} before \printindex
\makeatletter
  \def\@idxitem{\par\addvspace{10\p@ \@plus 5\p@ \@minus 3\p@}\hangindent 40\p@}
  \def\subitem{\par\hangindent 40\p@ \hspace*{20\p@}}
  \def\subsubitem{\par\hangindent 40\p@ \hspace*{30\p@}}
  \def\indexspace{}
  \patchcmd\theindex{\indexname}{\indexname\vspace{12pt}}{}{}
\makeatother

% glossar
\renewcommand{\nompreamble}{\vspace*{-3mm}...Introducing Thoughts...\vspace*{4mm}} %text before glossar!
\makenomenclature % is obligatory to create the glossar!
\newcommand{\auferstehungtext}{Auferstehungstext} % is used for long glossar entries!

\begin{document}

\begin{titlepage}% if you need a custom layout - otherwise, use \maketitle
  \centering
  Titelseite
\end{titlepage}

\renewcommand{\contentsname}{Inhaltsverzeichnis}
\clearpage\pdfbookmark{\contentsname}{toc}
\tableofcontents\thispagestyle{empty}

\chapter{Gottes Liebe zu den Menschen(Seine Geschöpfe)}

\begin{flushright}\footnotesize\textit{ursprünglicher Beitrag vom 6. April 2014 überarbeitet}\end{flushright}

The text in the index

\doublebox{\begin{minipage}[t]{1\columnwidth}%
    "Denn so hat Gott die Welt geliebt, dass er seinen eingeborenen Sohn gab, damit jeder, der an ihn glaubt, nicht verloren geht, sondern ewiges Leben hat." (Johannes 3,16)%
    \end{minipage}}

    \section*{Gottes Liebe zu den Menschen}

    "Und wir haben die Liebe erkannt und geglaubt, die Gott zu uns hat. Gott ist Liebe, und wer in der Liebe bleibt, der bleibt in Gott und Gott in ihm" (1. Johannes 4,16)
    \index{Wachstum im Glauben!Glaube}

    "Der HERR ist mir erschienen von ferne: Ich habe dich je und je geliebt, darum habe ich dich zu mir gezogen aus lauter Güte."
    (Jeremia 31,3)

    "Denn so hat Gott die Welt geliebt, dass er seinen eingeborenen Sohn gab, damit jeder, der an ihn glaubt, nicht verloren geht, sondern ewiges Leben hat." (Johannes 3,16)

    "Gott aber erweist seine Liebe zu uns darin, dass Christus, als wir noch Sünder waren, für uns gestorben ist." (Römer 5,8)

    "Du kennst die Gebote: »Du sollst nicht töten; du sollst nicht ehebrechen; du sollst nicht stehlen; du sollst nicht falsch
    Zeugnis reden; du sollst niemanden berauben; ehre Vater und Mutter.« Er aber sprach zu ihm: Meister, das habe ich alles gehalten von meiner Jugend auf. Und Jesus sah ihn an und gewann ihn lieb und sprach zu ihm: Eines fehlt dir. Geh hin, verkaufe alles, was du hast, und gib's den Armen, so wirst du einen Schatz im Himmel haben, und komm und folge mir nach!" (Markus 10,19-21)
    \index{Lebensveränderung!Reden/Schweigen}

    "Gnade, Barmherzigkeit, Friede von Gott, dem Vater, und von Jesus Christus, dem Sohn des Vaters, sei mit uns in Wahrheit und in Liebe!" (2. Johannes 1,3)


    \section*{Liebe unter den Menschen}

    "Furcht ist nicht in der Liebe, sondern die vollkommene Liebe treibt die Furcht aus; denn die Furcht rechnet mit Strafe. Wer
    sich aber fürchtet, der ist nicht vollkommen in der Liebe. Lasst uns lieben, denn er hat uns zuerst geliebt. Wenn jemand spricht: Ich liebe Gott, und hasst seinen Bruder, der ist ein Lügner. Denn wer seinen Bruder nicht liebt, den er sieht, der kann nicht Gott lieben, den er nicht sieht. Und dies Gebot haben wir von ihm, dass, wer Gott liebt, dass der auch seinen Bruder liebe." (1. Johannes 4,18-21)
    \index{Lebensveränderung!Nächstenliebe}

    "Daran wird jedermann erkennen, dass ihr meine Jünger seid, wenn ihr Liebe untereinander habt." (Johannes 13,35)

    "Wie mich mein Vater liebt, so liebe ich euch auch. Bleibt in meiner Liebe!" (Johannes 15,9)

    "Ich beschwöre euch, ihr Töchter Jerusalems: Erregt und erweckt nicht die Liebe, Bis es ihr gefällt!" (Hoheslied 8,4)

    "Alle eure Dinge lasst in der Liebe geschehen!"
    (1. Korinther 16,14)

    "Die Frucht des Geistes aber ist Liebe, Freude, Friede,Langmut, Freundlichkeit, Güte, Treue, Sanftmut, Selbstbeherrschung."
    (Galater 5,22)

    \index{Bleibendes!Liebe}
    \index{Lebensveränderung!Freude}\index{Lebensveränderung!Friede}
    \index{Lebensveränderung!Freundlichkeit}
    \index{Begriffe!Treue}


\addtocontents{toc}{\textbf{\sffamily \textcolor{white}{.}}\protect\par} %gives an empty line between Appendy and last chapter
\shorthandon{"}

\cleardoublepage
\thispagestyle{empty}
\vspace*{\fill}
\begin{center}
    \Huge Anhang
    \addtocontents{toc}{%
        \protect\addvspace{0.5pc}% <------------- adjust to suit
        \textbf{\sffamily Anhang}\protect\par
    }
\end{center}
\vspace*{\fill}
\clearpage


\nomenclature{Begriff2}{Begriffserklärung2}
\nomenclature{Begriff3}{Begriffserklärung3}
% Glossar (define specifications and introducing text in preamble)
\printnomenclature[2.5 cm] % width of first column

% Index (define specifications and introducing text here)
\indexprologue{\vspace*{-7mm} 
    Different words in different columns
\begin{multicols}{3}
    \begin{small}
    first entry\\
    second entry\\
    third entry\\
    fourth entry
    \end{small}
\end{multicols}
\newpage
Bibelstellen-Index\\\\
\textbf{It should look like this:}\\
\\    
Hoheslied\\
Hoheslied 8,4\hspace*{1cm}x\\
\\  
Jeremia\\  
Jeremia 31,3\hspace*{1cm}x,y\\
\\  
Markus\\
Markus 10,19-21\hspace*{1cm}k\\
\\  
Johannes\\
Johannes 3,16\hspace*{1cm}k,y\\
Johannes 13,35\hspace*{1cm}k\\
Johannes 15,9\hspace*{1cm}k\\
\\ 
Römer\\
Römer 5,8\hspace*{1cm}k\\
\\ 
1. Korinther\\ 
1. Korinther 16,14\hspace*{1cm}k\\
\\  
Galater\\
Galater 5,22\hspace*{1cm}pg.k\\
\\  
1. Johannes
1. Johannes 4,16\hspace*{1cm}k\\
1. Johannes 4,18-21\hspace*{1cm}k\\
\\  
2. Johannes\\
2. Johannes 1,3\hspace*{1cm}\\
...\\
...\\
\vspace*{40mm}
\textbf{newpage}
\vspace*{10mm}
}
\printindex

\end{document}

How to recognize a pattern as a non-line-braking reference by find+replace with a command and include this reference automatically in a second index?

One possible solution could be to implement somehow this code suggestion:

\documentclass{article}
\usepackage{lipsum}
\makeatletter
\newcommand\myquote{\my@quote}
\def\my@quote#1(#2){``#1''~\mbox{(#2)}}
\makeatother
\begin{document}

{Und wir haben die Liebe erkannt und geglaubt, die Gott zu uns hat. Gott ist Liebe, und wer in der Liebe bleibt, der bleibt in Gott und Gott in ihm}\myquote(1. Johannes 4,16)

\end{document}

Do you know how to do this?

laminin
  • 307

1 Answers1

2

So your question has two parts:

  1. How do I replace all occurences of " (Johannes 3,16) with " \addtonewindex(Johannes)\nobreakword{(Johannes 3,16)}

  2. Produce a nice index using this new index field.

The first part can easily be done in a text editor that supports regular expressions, for example Notepad++. In the replace function there search for " \((....\w+)([^\)]*\)), and replace it with " \\addtonewindex\(\1\)\\nobreakword{\(\1\2}. This regular expression works for all instances in your example.

EDIT Just to add some quick info on the regular expression: The regular expression matches everything that starts with " (, followed by the first match group that begins with any four characters (....) and is followed by 1 or more alpha-numeric characters (\w+). This combination is necessary to match both Johannes as well as 1. Johannes, as the second contains a whitespace at position 3. This match group is then stored in \1. The first match group is then immediately followed by a second match group ([^\)]*\)), which matches any number of characters which are not ), followed by a single ). This is stored in \2.

Both \1 and \2 are used in the replacement part to construct the new output.

In order to support the automatic indexing for your quotes, you need to switch to imakeidx, as the basic makeidx does not support multiple indices. This adds a second parameter to the \index command, specifying the Index to add to.

So if we change the output of the regular expression to: " \\index[bibel]{\1!\1\2}\\nobreakword{\(\1\2\)}, and change all other \index calls to \index[stichwort], (e.g. by replacing all occurrences of \index{ with \index[stichwort]{) and modify the header to use imakeidx:

\usepackage{imakeidx}
\makeindex[name=stichwort,title=Stichwortverzeichniss,options=-s ./index]
\makeindex[name=bibel,title=Bibelstellen,options=-s ./index]

the options key is needed to specify an .ist file as per Right aligning pagenumbers in index with imakeindex. This will make sure that the page numbers are right-justified. The content of the main.ist file is:

delim_0 "\\hfill"
delim_1 "\\hfill"
delim_2 "\\hfill" 

Then you the output will look like:

Output

with the source code:

\documentclass[a4paper,latin,fontsize=10pt,headsepline,parskip=half-,index=totoc]{scrreprt}
\areaset[0pt]{160mm}{247mm}% no binding correction, text width is 160mm, text height is 247mm; with twoside=semi, the margins will be
\usepackage[a4paper,margin=2.5cm]{geometry} %needed for multicol package
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage[normalem]{ulem}
\usepackage{fancybox,calc,etoolbox,lipsum,multicol}
\usepackage[osf,sc]{mathpazo}
\usepackage[intoc]{nomencl}
\renewcommand{\nomname}{Glossar}
\makenomenclature
\usepackage{scrlayer-scrpage}% scrpage2 is obsolete
  \pagestyle{scrheadings}
  \clearpairofpagestyles% \clearscrheadings, \clearscrplain are deprecated
  \automark[chapter]{chapter}
  \ihead[]{\headmark}
  \ohead[\pagemark]{\pagemark}
  \renewcommand*\partpagestyle{empty} % removes the pagenumbers of all part pages
\usepackage{imakeidx} % must always be loaded before the hyperref package, otherwise it can cause problems!
\makeindex[name=stichwort,title=Stichwortverzeichniss,options=-s ./main]
\makeindex[name=bibel,title=Bibelstellen,options=-s ./main]

\usepackage[colorlinks,pdfpagelabels,pdfstartview = FitH,bookmarksopen = true,bookmarksnumbered = true,linkcolor = black,plainpages = false,hypertexnames = false,citecolor = black] {hyperref}

\title{Einführung} \author{Autor} \date{1.Oktober 2014}

\newcommand{\nobreakword}[1]{\mbox{#1}}

\makeatletter \def@idxitem{\par\addvspace{10\p@ @plus 5\p@ @minus 3\p@}\hangindent 40\p@} \def\subitem{\par\hangindent 40\p@ \hspace{20\p@}} \def\subsubitem{\par\hangindent 40\p@ \hspace{30\p@}} \def\indexspace{} \patchcmd\theindex{\indexname}{\indexname\vspace{12pt}}{}{} \makeatother

% glossar \renewcommand{\nompreamble}{\vspace{-3mm}...Introducing Thoughts...\vspace{4mm}} %text before glossar! \makenomenclature % is obligatory to create the glossar! \newcommand{\auferstehungtext}{Auferstehungstext} % is used for long glossar entries!

\begin{document}

\begin{titlepage}% if you need a custom layout - otherwise, use \maketitle \centering Titelseite \end{titlepage}

\renewcommand{\contentsname}{Inhaltsverzeichnis} \clearpage\pdfbookmark{\contentsname}{toc} \tableofcontents\thispagestyle{empty}

\chapter{Gottes Liebe zu den Menschen(Seine Geschöpfe)}

\begin{flushright}\footnotesize\textit{ursprünglicher Beitrag vom 6. April 2014 überarbeitet}\end{flushright}

The text in the index

\doublebox{\begin{minipage}[t]{1\columnwidth}% "Denn so hat Gott die Welt geliebt, dass er seinen eingeborenen Sohn gab, damit jeder, der an ihn glaubt, nicht verloren geht, sondern ewiges Leben hat." \index[bibel]{Johannes!Johannes 3,16}\nobreakword{(Johannes 3,16)}% \end{minipage}}

\section*{Gottes Liebe zu den Menschen}

&quot;Und wir haben die Liebe erkannt und geglaubt, die Gott zu uns hat. Gott ist Liebe, und wer in der Liebe bleibt, der bleibt in Gott und Gott in ihm&quot; \index[bibel]{1. Johannes!1. Johannes 4,16}\nobreakword{(1. Johannes 4,16)}
\index[stichwort]{Wachstum im Glauben!Glaube}

&quot;Der HERR ist mir erschienen von ferne: Ich habe dich je und je geliebt, darum habe ich dich zu mir gezogen aus lauter Güte.&quot;
(Jeremia 31,3)

&quot;Denn so hat Gott die Welt geliebt, dass er seinen eingeborenen Sohn gab, damit jeder, der an ihn glaubt, nicht verloren geht, sondern ewiges Leben hat.&quot; \index[bibel]{Johannes!Johannes 3,16}\nobreakword{(Johannes 3,16)}

&quot;Gott aber erweist seine Liebe zu uns darin, dass Christus, als wir noch Sünder waren, für uns gestorben ist.&quot; \index[bibel]{Römer!Römer 5,8}\nobreakword{(Römer 5,8)}

&quot;Du kennst die Gebote: »Du sollst nicht töten; du sollst nicht ehebrechen; du sollst nicht stehlen; du sollst nicht falsch
Zeugnis reden; du sollst niemanden berauben; ehre Vater und Mutter.« Er aber sprach zu ihm: Meister, das habe ich alles gehalten von meiner Jugend auf. Und Jesus sah ihn an und gewann ihn lieb und sprach zu ihm: Eines fehlt dir. Geh hin, verkaufe alles, was du hast, und gib's den Armen, so wirst du einen Schatz im Himmel haben, und komm und folge mir nach!&quot; \index[bibel]{Markus!Markus 10,19-21}\nobreakword{(Markus 10,19-21)}
\index[stichwort]{Lebensveränderung!Reden/Schweigen}

&quot;Gnade, Barmherzigkeit, Friede von Gott, dem Vater, und von Jesus Christus, dem Sohn des Vaters, sei mit uns in Wahrheit und in Liebe!&quot; \index[bibel]{2. Johannes!2. Johannes 1,3}\nobreakword{(2. Johannes 1,3)}


\section*{Liebe unter den Menschen}

&quot;Furcht ist nicht in der Liebe, sondern die vollkommene Liebe treibt die Furcht aus; denn die Furcht rechnet mit Strafe. Wer
sich aber fürchtet, der ist nicht vollkommen in der Liebe. Lasst uns lieben, denn er hat uns zuerst geliebt. Wenn jemand spricht: Ich liebe Gott, und hasst seinen Bruder, der ist ein Lügner. Denn wer seinen Bruder nicht liebt, den er sieht, der kann nicht Gott lieben, den er nicht sieht. Und dies Gebot haben wir von ihm, dass, wer Gott liebt, dass der auch seinen Bruder liebe.&quot; \index[bibel]{1. Johannes!1. Johannes 4,18-21}\nobreakword{(1. Johannes 4,18-21)}
\index[stichwort]{Lebensveränderung!Nächstenliebe}

&quot;Daran wird jedermann erkennen, dass ihr meine Jünger seid, wenn ihr Liebe untereinander habt.&quot; \index[bibel]{Johannes!Johannes 13,35}\nobreakword{(Johannes 13,35)}

&quot;Wie mich mein Vater liebt, so liebe ich euch auch. Bleibt in meiner Liebe!&quot; \index[bibel]{Johannes!Johannes 15,9}\nobreakword{(Johannes 15,9)}

&quot;Ich beschwöre euch, ihr Töchter Jerusalems: Erregt und erweckt nicht die Liebe, Bis es ihr gefällt!&quot; \index[bibel]{Hoheslied!Hoheslied 8,4}\nobreakword{(Hoheslied 8,4)}

&quot;Alle eure Dinge lasst in der Liebe geschehen!&quot;
(1. Korinther 16,14)

&quot;Die Frucht des Geistes aber ist Liebe, Freude, Friede,Langmut, Freundlichkeit, Güte, Treue, Sanftmut, Selbstbeherrschung.&quot;
(Galater 5,22)

\index[stichwort]{Bleibendes!Liebe}
\index[stichwort]{Lebensveränderung!Freude}\index[stichwort]{Lebensveränderung!Friede}
\index[stichwort]{Lebensveränderung!Freundlichkeit}
\index[stichwort]{Begriffe!Treue}


\addtocontents{toc}{\textbf{\sffamily \textcolor{white}{.}}\protect\par} %gives an empty line between Appendy and last chapter \shorthandon{"}

\cleardoublepage \thispagestyle{empty} \vspace{\fill} \begin{center} \Huge Anhang \addtocontents{toc}{% \protect\addvspace{0.5pc}% <------------- adjust to suit \textbf{\sffamily Anhang}\protect\par } \end{center} \vspace{\fill} \clearpage

\nomenclature{Begriff2}{Begriffserklärung2} \nomenclature{Begriff3}{Begriffserklärung3} % Glossar (define specifications and introducing text in preamble) \printnomenclature[2.5 cm] % width of first column

% Index (define specifications and introducing text here)

\printindex[bibel]

\clearpage \printindex[stichwort]

\end{document}

David Carlisle
  • 757,742
Karalga
  • 1,232
  • I'd like to have three columns instead of two for the "Bibelstellen-Index". Can I do this? – laminin Apr 16 '15 at 16:23
  • Because I need a glossar I inserted with the makeidx package \indexprologue{\vspace*{-7mm} as you can see in my MWE to 1.) set the vertical distance to the list and 2.) write a introducing text. Can I do this as well with this new imakeidx? – laminin Apr 16 '15 at 16:27
  • When I compile your code (I use always pdflatex -synctex=1 -interaction=nonstopmode %.tex | makeindex %.nlo -s nomencl.ist -o %.nls -t %.nlg | txs:///makeindex | pdflatex -synctex=1 -interaction=nonstopmode %.tex | txs:///view-pdf-internal) than I don't get any index or glossar on the contrary if I do this as usual with my MWE. In the log: "no file bibel.ind" and "no file stichwort.ind" – laminin Apr 16 '15 at 16:42
  • For me it's also very important that the index entries are not alphabetically sorted, meaning 1. Korinther, then Galater, then 1. Johannes. Is this possible? – laminin Apr 16 '15 at 16:43
  • I've used % \makeatletter % \def\@idxitem{\par\addvspace{10\p@ \@plus 5\p@ \@minus 3\p@}\hangindent 40\p@} % \def\subitem{\par\hangindent 40\p@ \hspace*{20\p@}} because I'd like to have a vertical spacing between the stichwort-index-entries between Begriffe und Bleibendes. – laminin Apr 16 '15 at 16:47
  • I'm very happy that the regular expression " \((....\w+)([^\)]*\)) works. Can you may be explain this parts in your answer a little bit? – laminin Apr 16 '15 at 16:49
  • Lots of comments! You can specify the number of colums by adding columns=3 to the \makeindex command. You don't need the makeidx package for the prologue; \indexprologue{} is provided by the imakeidx package too. – Karalga Apr 16 '15 at 17:09
  • You can set the manual sorting order using the @ symbol: \index[biebel]{A@Korinther...}\index[biebel]{B@1. Johannes} will first display Korinther, followed by Johannes. If you just want to supply a sorted list of keys, I suggest you open another question, as I do not know the solution (and can't quickly find one) – Karalga Apr 16 '15 at 17:19
  • I am using an main.ist file, I don't know what noemcl.ist is - I suggest you amend your compile line. – Karalga Apr 16 '15 at 17:22
  • And your spacing code still works, I just uncommented it. – Karalga Apr 16 '15 at 17:26
  • I've changed to main.ist but still don't get an index and a nomenclature while I get one with my MWE. – laminin Apr 16 '15 at 17:32
  • have you created the main.ist file as per the stackoverflow question I linked? – Karalga Apr 16 '15 at 17:33
  • To right justify the page numbers I used the question http://tex.stackexchange.com/questions/132465/right-aligning-pagenumbers-in-index-with-imakeindex - there it tells you to define a new .ist file. – Karalga Apr 16 '15 at 17:44
  • To be honest I didn't understand this stackexchange answer. Do I have to generate manually a file? Because my system runs over Windows I don't use any command line. The editor just runs the commands from the code as I pasted 3 mins ago, but it's possible to run a individual command, so I can change this command. How should I do this? – laminin Apr 16 '15 at 17:47
  • I have updated the answer, it now contains the main.ist file you need to create. – Karalga Apr 16 '15 at 18:04
  • Ah! This is the first time I did manually a main.ist file. It worked. Could you also write something in your answer how you have combined your regular expression? – laminin Apr 16 '15 at 18:16
  • I opened a new question, because of the sorted index and because I get still problems trying to create the indexes: http://tex.stackexchange.com/questions/239006/how-to-make-a-sorted-index – laminin Apr 16 '15 at 20:10
  • updated my answer to include an explanation of the regular expression I used - but really, regular expressions are way to powerful to explain here. There are many good tutorials around. – Karalga Apr 16 '15 at 21:42
  • I've created the main.ist file in an empty folder and there is also the laminin.tex (your code) file. Can you give me the full commands you write in your console in order to generate a pdf with the two indexes, the glossar and the toc? – laminin Apr 17 '15 at 08:58
  • Something like a simple latexmk -f laminin.tex... but if you are using TexStudio, there should be sensible default compile options around. – Karalga Apr 17 '15 at 10:03
  • Thank you. I was able to do the translation with pdflatex -synctex=1 -interaction=nonstopmode %.tex|makeindex %.nlo -s nomencl.ist -o %.nls -t %.nlg|pdflatex -synctex=1 -interaction=nonstopmode %.tex|"C:/Program Files (x86)/Adobe/Reader 11.0/Reader/AcroRd32.exe" %.pdf – laminin Apr 17 '15 at 13:39