# How to adjust layout of the first page of index?

In my book I have a page with index. The content of it exceeds one page only with two items, so I would like to decrease some vertical spaces on this page to hold the whole index on this page.

By default the layout of the first index page is set with \indexsetup{level=\chapter*}, and then the index looks as follows:

When I change the index layout with \indexsetup{level=\section*} then all index records fall into a single page (what I want), but the title word "Index" is too small:

I tried to find the solution in idxlayout package manual - without any effect. I found something that seems to be connected with the problem, but I don't know how to use it: \renewcommand*{\indexstheadcase}{\Huge} (?). A bit similar question is here (without answer).

My code:

\documentclass{book}
\usepackage[
paperwidth=8cm,paperheight=8cm,
top=10mm,bottom=10mm,left=10mm,right=10mm,
]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{imakeidx}

\usepackage{fancyhdr}
\pagestyle{fancy}

\usepackage{titlesec}
\titlespacing*{\chapter}{0pt}{-5pt}{20pt}
\titleformat{\chapter}[display]{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{15pt}{\Huge}

\indexsetup{level=\section*}
\makeindex[columnsep=8mm]

\begin{document}

\tableofcontents

\chapter{Introduction}
The Coyotewill\index{Coyote} has lower continuous po\-wer.

AAA\index{AAA} aaa\index{aaa} BBB\index{BBB} bbb\index{bbb}.

CCC\index{CCC} ccc\index{ccc} DDD\index{DDD} ddd\index{ddd}.
\clearpage

\chapter{Some section}
This is an exemplary text\index{text}
which serves to demonstration the problem with index layout\index{index}.

More text on the page\index{page}.

\printindex
\end{document}

• Change \titlespacing for \chapter just before \printindex. – egreg Mar 21 '17 at 16:05
• @egreg Thx. That solves my problem at all. But I wonder how to manage with the similar problem it which are few indexes along the book (not only on the last page)... – forrest Mar 21 '17 at 16:19
• I see no reason for changing the chapter style. Anyway, what does prevent you from restoring the spacing afterwards? – egreg Mar 21 '17 at 16:21
• @egreg OK. Thx. Your answer is very helpful for me. I understand... – forrest Mar 21 '17 at 16:24

I see no reason for changing the chapter style.

Anyway, you can change \titlespacing before \printindex and if necessary, restore it afterwards.

You can of course define a wrapper command:

\newcommand{\myprintindex}[1][]{%
% change the spacing
\if\relax\detokenize{#1}\relax
\printindex
\else
\printindex[#1]%
\fi
% restore
\titlespacing*{\chapter}{0pt}{-5pt}{20pt}%
}

• Thx. In MWE it works very well ...but now I am looking for a reason why it doesn't affect the index page layout in the book I am working with... – forrest Mar 21 '17 at 16:45
• How to manage with the problem in which my code have commented the line with the \titleformat command? – forrest Mar 23 '17 at 9:23
• @forrest Sorry, but I can't see your code. – egreg Mar 23 '17 at 9:26
• I thought about the code which I put in my question. Why putting % before \titleformat{\chapter}[display]{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{15pt}{\Huge} causes that method doesn't work? – forrest Mar 23 '17 at 12:21
• If you don't use \titleformat, then titlesec does nothing to chapters – egreg Mar 23 '17 at 17:46