我使用 makeindex 创建索引,我的 .ist 文件如下所示:
% 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."
出版商指南规定“禁止索引字母”,因此我将 headlines_flag 设置为 0,效果符合预期。但指南还要求每个第一条目的首字母必须为粗体,例如:
Aaaa Abc Adddd Affff
乙ar Brrr Buuu
...我不知道如何实现这一点...任何想法都值得赞赏。
编辑:抱歉,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}
请注意我添加的:
\usepackage[indentunit=0.75em]{idxlayout}
用于配置缩进。
我还尝试手动将每个第一个条目的首字母设置为粗体(例如\index{\textbf{A}aronsen, John}
。通常,这有效,但是在第一个条目之后我得到了更大的行距,这不是一个选择......
答案1
如果某些“第一个条目”有重音字符,则此操作将会失败:
\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}
我使用了 MakeIndex 功能,它将查找名为的文件<main>.mst
并将其用作样式文件。