1

Consider the code

\documentclass{book}
\usepackage{imakeidx}
\let\cleardoublepage\clearpage
\makeindex
\usepackage{idxlayout}
\usepackage{lipsum}

\usepackage[none]{hyphenat} % To prevent hyphenation \begin{document} \large \lipsum[13]\index{HEADING@\textbf{\textit{HEADING}}! \lipsum[3]}

\idxlayout{columns=1} \printindex \end{document}

which produces the Index:

enter image description here

I have prevented hyphenation in the document by inserting \usepackage[none]{hyphenat} into the preamble; however, I would like to permit hyphenation in the Index.

QUESTION: Is it possible to permit hyphenation in the Index while simultaneously precluding it from occurring in the rest of the document? If so, how may I do this?

Thank you.

DDS
  • 8,816
  • 4
  • 9
  • 36

1 Answers1

2

Try resetting the hyphenpenalty before the index:

\documentclass{book}
\usepackage{imakeidx}
\let\cleardoublepage\clearpage
\makeindex
\usepackage{idxlayout}
\usepackage{lipsum}

\usepackage[none]{hyphenat} % To prevent hyphenation \begin{document} \large \lipsum[13]\index{HEADING@\textbf{\textit{HEADING}}! \lipsum[3]}

\hyphenpenalty=1000 \hbadness=1000 \idxlayout{columns=1} \printindex \end{document}

jak123
  • 4,252
  • 5
  • 26
  • 49
  • Thank you for posting this answer. I tried running it without the \hbadness=1000 and hyphenation occurred in the index, as I wanted. Would you tell me what this command does and why it might be needed? Thank you again. – DDS Jan 02 '22 at 03:05
  • \hbadness is not really needed, it's just helpful to report overfull boxes in the logs. You can read some useful info here: https://tex.stackexchange.com/questions/241343/what-is-the-meaning-of-fussy-sloppy-emergencystretch-tolerance-hbadness/241355 – jak123 Jan 02 '22 at 03:58