\chapter*{Index Title}{\printindex{indexname}}
This doesn't work because \printindex starts a new page, so the
heading sits alone with the index starting on the next page. It is
possible to redefine \printindex or to restyle its heading format?
Rich
If you are using the book or report class, the index /is/ printed with
a chapter heading.
What are you trying to get, really?
Ciao
Enrico
> If you are using the book or report class, the index /is/ printed with
> a chapter heading.
>
> What are you trying to get, really?
>
> Ciao
> Enrico
Thanks for the reply
I'm using report class. If I use the following command I get a heading
- but it doesn't look like my other chapter headings.
\printindex{indexname}{Index Title}
I'm trying to get consistency in my headings font and layout.
Rich
then please provide more information, preferably a minimal example,
the heading for \printindex should be printed as \chapter*, so if you
have made some changes, we'd like to see them
--
/daleif (remove RTFSIGNATURE from email address)
LaTeX FAQ: http://www.tex.ac.uk/faq
LaTeX book: http://www.imf.au.dk/system/latex/bog/ (in Danish)
Remember to post minimal examples, see URL below
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl
http://www.minimalbeispiel.de/mini-en.html
\printindex doesn't take arguments. I'm afraid I don't understand.
You should index the terms you want in the document (with the \index
command). Then, after a LaTeX run, run also "makeindex". Another
LaTeX run will show the index. Example:
==== gnus.tex ====
\documentclass[a4paper]{report}
\usepackage{makeidx}
\makeindex
\begin{document}
\chapter{First}
Gnus\index{gnu} are big animals\index{animal}.
\printindex
\end{document}
====
Now with the commands
pdflatex gnus
makeindex gnus
pdflatex gnus
I get the index with its proper heading.
Ciao
Enrico
Why are you doing this? \printindex works just on its own: there are no
arguments.
To change the name of the index, reset it with
\renewcommand{\indexname}{Index Title}
\printindex will print that as a chapter-style title.
///Peter
Thanks for the replies.
I didn't mention before (because I didn't know it was important) that
I'm using the multind package. But I now know that with this package
the \printindex command is modified so that it doesn’t create its own
chapter or section heading.
So I have my two indexes appearing fine with their correct names, but
I really want chapter-styled headings. I have tried modifying
multind.sty, but this is proving beyond my latex capabilities.
Rich
Try this:
====
\usepackage{multind}
\makeatletter
\renewcommand{\printindex}[2]
{\if@twocolumn
\@restonecolfalse
\else
\@restonecoltrue
\fi
\twocolumn[\@makeschapterhead{#2}]%
\@mkboth{\MakeUppercase#2}%
{\MakeUppercase#2}%
\addcontentsline{toc}{chapter}{#2}%
\thispagestyle{plain}\parindent\z@
\@input{#1.ind}}
\renewenvironment{theindex}
{\parskip\z@ \@plus .3\p@\relax
\columnseprule \z@
\columnsep 35\p@
\let\item\@idxitem}
{\if@restonecol\onecolumn\else\clearpage\fi}
\makeatother
====
Ciao
Enrico
Perfect Grazie
This code looks like it also organises the columns. If I want index_A
to have 3 columns and index_B to have 2 columns then I have to adjust
this to the floating headings, right?
Rich
> Perfect Grazie
>
> This code looks like it also organises the columns. If I want index_A
> to have 3 columns and index_B to have 2 columns then I have to adjust
> this to the floating headings, right?
Try this:
====
\usepackage{multicol,multind}
\makeatletter
\def\number@of@cols{2}
\renewcommand{\printindex}[3][2]{%
\chapter*{#3}%
\@mkboth{\MakeUppercase{#3}}{\MakeUppercase{#3}}%
\addcontentsline{toc}{chapter}{#3}%
\parindent\z@ \def\number@of@cols{#1}%
\@input{#2.ind}%
}
\renewenvironment{theindex}
{\begin{multicols}{\number@of@cols}
\parskip\z@ \@plus .3\p@\relax
\columnseprule \z@
\columnsep 35\p@
\let\item\@idxitem}
{\end{multicols}}
\makeatother
\makeindex{indexa}
\makeindex{indexb}
====
Then write
\printindex[3]{indexa}{Name of Index A}
\printindex{indexb}{Name of Index B}
The optional argument is the number of columns (it should
be >1); default is 2.
Ciao
Enrico
Brilliant, thanks - that works perfectly and looks like this:
http://www.scribd.com/doc/30950790/Thesis-Indexes
This uses the bibleref package to create the Scripture index - which
still needs some styling (to make the headings bold and left aligned)
Rich