Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

\printindex with \chapter heading

518 views
Skip to first unread message

RAD

unread,
May 3, 2010, 5:46:19 AM5/3/10
to
I can't figure this out. I wish to have a chapter-style heading for my
Index. I have tried this to print the index:

\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

Enrico Gregorio

unread,
May 3, 2010, 5:51:29 AM5/3/10
to
RAD <richardar...@gmail.com> wrote:

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

RAD

unread,
May 3, 2010, 6:03:42 AM5/3/10
to
On 3 May, 10:51, Enrico Gregorio <grego...@math.unipd.it> wrote:

> 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

Lars Madsen

unread,
May 3, 2010, 6:10:01 AM5/3/10
to

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

Enrico Gregorio

unread,
May 3, 2010, 6:15:50 AM5/3/10
to
RAD <richardar...@gmail.com> wrote:

\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

Peter Flynn

unread,
May 3, 2010, 3:04:07 PM5/3/10
to
RAD wrote:
> On 3 May, 10:51, Enrico Gregorio <grego...@math.unipd.it> wrote:
>
>> 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}

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

RAD

unread,
May 4, 2010, 11:05:33 AM5/4/10
to

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


Enrico Gregorio

unread,
May 4, 2010, 11:24:21 AM5/4/10
to
RAD <richardar...@gmail.com> wrote:

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

RAD

unread,
May 4, 2010, 12:00:55 PM5/4/10
to

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

Enrico Gregorio

unread,
May 4, 2010, 4:21:37 PM5/4/10
to
RAD <richardar...@gmail.com> wrote:

> 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

RAD

unread,
May 5, 2010, 6:15:30 PM5/5/10
to
On May 4, 9:21 pm, Enrico Gregorio <grego...@math.unipd.it> wrote:

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


renata....@gmail.com

unread,
Jul 1, 2016, 5:43:23 PM7/1/16
to
Hi Enrico,

I was wondering if you could help me too....I need to finish my masters' and haven't been able to figure it out, as well.

My case is exactly similar to RAD's but I am using a few ams-packages (amsmath,amssymb,amsopn,amsthm,amsfonts) so, the 'multind' did not work for me.

This: http://www.tex.ac.uk/FAQ-multind.html instructed to use the 'amsmidx'-package instead. (so I: 1. replaced the \usepackage - command from 'multind' to 'amsmidx', 2. am using the '\printindex{authors}{Author Index}'-command, as seen here: ftp://ftp.ams.org/ams/amslatex/classes/amsmidx.pdf.

Now, I am getting even 2 blank pages prior to the index (RAD gets one).

Please, help me.

jon

unread,
Jul 1, 2016, 8:44:02 PM7/1/16
to
help tends to come more quickly and more usefully if the person in need of
help first provides a minimal .tex file that others can run and which will
produce the same error/problem.

this means providing something that starts with \begin{document} and goes
to \end{document], but does not contain any packages, commands, or content
that is not needed to show the problem/error.

cheers,
jon.
0 new messages