2

I create my index with makeindex, my .ist-file looks like that:

% sty.file for mkidx32.exe - redefines:
quote '+'
headings_flag 0
%headings_flag 1
heading_prefix "{\\textbf "
heading_suffix "}\\nopagebreak%\n \\indexspace\\nopagebreak%"
delim_0 ": "
delim_1 ": "
delim_2 ": "
%delim_r "~--~"
delim_r "-"
%delim_0 "\\dotfill "
%delim_1 "\\dotfill "
%delim_2 "\\dotfill "
%delim_r "~--~"
suffix_2p "\\,f."
suffix_3p "\\,ff."

The publishers guidelines say "no index letters", so I've set headings_flag to 0, which works as expected. But the guidelines also require the first letter of each first entry to be bold, like:

Aaaa Abc Adddd Affff

Bar Brrr Buuu

...and I have no idea how to realize that... any idea appreciated.

edit: Sorry, the MWE:

\documentclass[a4paper,fontsize=10pt,numbers=noenddot]{scrbook}
\usepackage[T1]{fontenc} 
\usepackage[latin1]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{blindtext}

\usepackage[indentunit=0.75em]{idxlayout}

%\usepackage{makeidx}
\makeindex

\begin{document}

\blindtext\index{Aaronsen, John} Other names to be indexed are Mike Arjonen\index{Arjonen, Mike} and Jim Azzz\index{Azzz, Jim}. For B, there are John Baily\index{Baily, John} and Jim Bronson\index{Bronson, Jim}.

\printindex

\end{document}

And pls note I added: \usepackage[indentunit=0.75em]{idxlayout} for configuring the indention.

I also tried to set the first letter of each first entry bold manually (like \index{\textbf{A}aronsen, John}. Generally, this works, but I got a bigger line spacing after this first entry, which isn't an option...

binsky
  • 79
  • this will probably only work because you modify the *.ist file local on your system. the minute you turn in your *.tex files, this won't work at all. – naphaneal Jun 15 '18 at 21:44
  • Yes, I know that, but it would be okay in this case as I have to deliver the final PDF file. So a modification of the ist file is probably the way to go in here... any help for that would be highly appreciated – binsky Jun 15 '18 at 21:50
  • see if the answer in this forum helps: https://latex.org/forum/viewtopic.php?t=8096 – naphaneal Jun 15 '18 at 21:58
  • Unrelated, since you have the headings switched off, but the heading_prefix value is incorrect. It should be to "\\textbf{" or "{\bfseries "`` not "{\\textbf ". I recommend you add a minimal working example (MWE) with a few indexed examples as people are more likely to answer questions if they can copy and paste a small but complete test document to work on. (Scroll down the to Index section of the MWE answer for examples.) – Nicola Talbot Jun 16 '18 at 12:11
  • Sorry, forget that yesterday, here's a minimal working example: \documentclass[a4paper,fontsize=10pt,numbers=noenddot]{scrbook} \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} \usepackage[ngerman]{babel} \usepackage{makeidx} \makeindex \begin{document} text\index{Aaronsen, John} Other names to be indexed are Mike Arjonen\index{Arjonen, Mike} and Jim Azzz\index{Azzz, Jim}. For B, there are John Baily\index{Baily, John} and Jim Bronson\index{Bronson, Jim}. \printindex \end{document} – binsky Jun 16 '18 at 14:29
  • arguments for makeindex, set in texniccenter:
    "%tm.idx" -t "%tm.ilg" -o "%tm.ind" -l -s register.ist
    register.ist contains the code mentioned in original post.

    In my original version, headings_flag was set to 1: https://www.screencast.com/t/z4IeahcOyIaJ
    then I set headings_flag to 0:
    https://www.screencast.com/t/G4srXdma much better, but in here the A of Aronson and the B of Baily should be bold...

    – binsky Jun 16 '18 at 14:39

1 Answers1

3

This will fail if some “first entry” has accented characters:

\begin{filecontents*}{\jobname.mst}
quote '+'
headings_flag 1
heading_prefix "\\firstentry "
heading_suffix ""
delim_0 ": "
delim_1 ": "
delim_2 ": "
%delim_r "~--~"
delim_r "-"
%delim_0 "\\dotfill "
%delim_1 "\\dotfill "
%delim_2 "\\dotfill "
%delim_r "~--~"
suffix_2p "\\,f."
suffix_3p "\\,ff."
\end{filecontents*}

\documentclass[a4paper,fontsize=10pt,numbers=noenddot]{scrbook}
\usepackage[T1]{fontenc} 
\usepackage[ngerman]{babel}
\usepackage{blindtext}

\usepackage[indentunit=0.75em]{idxlayout}

\usepackage{makeidx}
\makeindex

\def\firstentry#1\item#2{\item\textbf{#2}}

\begin{document}

\blindtext\index{Aaronsen, John} Other names to be indexed are Mike Arjonen\index{Arjonen, Mike} and Jim Azzz\index{Azzz, Jim}. For B, there are John Baily\index{Baily, John} and Jim Bronson\index{Bronson, Jim}.

\printindex

\end{document}

I have used the MakeIndex feature that it will look for a file named <main>.mst and use it as the style file.

enter image description here

egreg
  • 1,121,712
  • Thanks a lot, this looks great! Unfortunately, I cannot reproduce it, I always get this: https://www.screencast.com/t/97CbLrZSyOEV Probably I didn't configure the .ist / .mst-usage correctly.
    I still use "%tm.idx" -t "%tm.ilg" -o "%tm.ind" -l -s register.ist in TexnicCenter - how would the proper setting be in this case? In the register.ist file, I have implemented the code of your "jobname.mst".
    I just don't get it at the moment...and think I have something essential missed in here. Could you please explain your settings a bit more detailed?
    – binsky Jun 17 '18 at 11:41
  • @binsky Sorry, a backslash got mangled in the .mst file, where it should be \\firstentry. – egreg Jun 17 '18 at 12:35
  • thank you so much for the suggested solution and the additional comment. this works absolutely perfect! – binsky Jun 17 '18 at 13:39