[Tex/LaTex] Prevent column break in multicolumn index

indexingpage-breaking

I am using imakeidx to generate a multicolumn index with makeindex.

Here is an excerpt from my .ind:

  \item \BRbooktitlestyle {\BRepistlenumberstyle {1}Jean}                       
    \subitem \BRchapterstyle {2}\BRchvsep \BRversestyle {2} \dotfill            
                \textrm{18}                                                     
    \subitem \BRchapterstyle {4}\BRchvsep \BRversestyle {9}\BRvrsep \BRversestyle {10} \dotfill
                \textrm{18}   

where \BRfoo are bibleref formatting macros. Unfortunately, the \item is at the bottom of a left column, so the \subitems get pushed to the right column:

column break in index

Is there an equivalent to \nobreak which could be used here to prevent this behaviour, and how?

Best Answer

You want that a column break is preferred before each \item command; the usual definition of \item in an index is \par\hangindent 40\p@; so something like

\indexsetup{othercode={\let\item\breakitem}}

may do what needed, after saying in the preamble

\makeatletter
\def\breakitem{\par\goodbreak\hangindent 40\p@}
\makeatother

Another trick could be to add

\vadjust{\nobreak}

to the definition of \BRbooktitlestyle

Related Question