4

I want index entries to be visible in the margins. We are using the indexpackage for multiple indexes. This package provides the option to display the index entries in the margin. For some cases I get a black box. I do not want to disable the black boxes all together since they are needed for normal text, but I do not want to see them with the index entries. Is there a way to disable them locally?

\documentclass[draft]{scrbook}

\usepackage[ papersize={170mm,240mm}
        ,top=27.4mm 
        ,inner=20mm 
        ,outer=25mm
                    ,marginparwidth=50pt
        ]{geometry}

\usepackage{index}
\makeindex

\proofmodetrue

\begin{document}

~
\newpage
This is some text and there is some index\index{package!lsp-gb4e} entry.

\end{document}

Edit: An alternative would be to make LaTeX break these long items in the margin and put them into two lines. Is this possible?

Stefan Müller
  • 6,901
  • 3
  • 29
  • 61
  • That box should disappear once you switch from draft to final. It's just there to alert you to the problem. – Ingmar Dec 06 '13 at 10:53
  • Yes, I know. But there is no problem in terms of overfull boxes that I have to be alerted of as far as the margin notes are concerned, since they will be gone in the finalversion as well. I want to be in draft mode and see the black boxes for normal text, but not in the margins. Actually the boxes are not in the margins but cover the main text. This is the reason why I want to get rid of them. – Stefan Müller Dec 06 '13 at 11:10

1 Answers1

5

You can set the \indexproofstyle for example to use a smaller, non typewriter, font and make the marginpar ragged right. This will avoid many of the overfull boxes:

Sample output

\documentclass[draft]{scrbook}

\usepackage[papersize={170mm,240mm}
  ,top=27.4mm
  ,inner=20mm, 
  ,outer=25mm
  ,marginparwidth=50pt
  ]{geometry}

\usepackage{index}
\makeindex

\proofmodetrue
\indexproofstyle{\raggedright\footnotesize}

\begin{document}

~
\newpage
This is some text and there is some index\index{package!lsp-gb4e} entry.

\end{document}

If you just wish to switch off the black boxes, then you could write

\indexproofstyle{\setlength{\overfullrule}{0pt}\footnotesize\ttfamily}

Sample tt

Note the typewriter fonts don't hyphenate by default. See How to automatically hyphenate within \texttt? for some ways to change this.

Andrew Swann
  • 95,762