Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
Setting the same distance from the top of the page for chapter and index titles

When compiling the following example, you can see that the heading heading "Index" (created by \printindex) has a different vertical position than the first two headings.

Strangely, it gets better when you comment out the line \KOMAoption{open}{right} although the positioning is still different.

What is the reason for this behavior and how can I fix it?

\documentclass{scrreprt}

\KOMAoption{open}{right}

\usepackage{makeidx}
\makeindex


\begin{document}

  \chapter{First Test}
  \chapter{Second Test}
  \index{test}
  \printindex

\end{document}
share|improve this question

marked as duplicate by lockstep, Werner, Stefan Kottwitz May 7 '12 at 19:37

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
I have a bit older version of TeXLive and really old versions of KOMA-script. Anyways, the word "Index" is a bit lower on the page than "2 Second Test", even without \KOMAoption{open}{right}. –  tohecz Mar 29 '12 at 14:57
add comment

2 Answers 2

up vote 4 down vote accepted

The index is set in twocolumn mode, and \twocolumn interferes with \topskip (LaTeX bug 3126). One solution is to load my idxlayout package which uses multicol instead.

(Note: In the process of answering this question, I stumbled upon what seems to be an incompatibility between idxlayout and v3.10a of the KOMA-Script classes -- the automatic loading of the ragged2e package fails. As a workaround, you have to load ragged2e manually.)

EDIT: idxlayout v0.4d, which fixes the mentioned incompatibility, is on its way to CTAN.

\documentclass{scrreprt}

\KOMAoption{open}{right}

\usepackage{makeidx}
\makeindex

\usepackage{idxlayout}
\usepackage{ragged2e}

\begin{document}

  \chapter{First Test}
  \chapter{Second Test}
  \index{test}
  \printindex

\end{document}
share|improve this answer
    
using your idxlayout package solved the problem - thanks! –  boothby81 Mar 30 '12 at 11:52
add comment

It seems to be a bug related to the command \twocolumn. If you load the imakeidx package instead of makeidx, the theindex environment will be redefined without \twocolumn and the problem disappears.

share|improve this answer
    
Adding \usepackage{imakeidx} to the OP's example results in the error message Misplaced \printindex for me. –  lockstep Mar 29 '12 at 15:41
    
@lockstep Not to me. –  egreg Mar 29 '12 at 15:51
    
Using imakeidx worked for me and it also results in a correct vertical alignment of the heading. However, the space inserted between the heading and the first index entry differs from the space between a standard chapter heading and the first line of the following paragraph. That effect didn't show up when using idxlayout therefore I accepted lockstep's answer. –  boothby81 Mar 30 '12 at 11:57
    
@boothby81 idxlayout sets \multicolsep to 0pt within the theindex environment. –  lockstep Mar 30 '12 at 21:38
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.