1

MWE:

\documentclass{article}

\usepackage{listings}

\begin{document}

IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII hardware/software

\end{document}

This results in this output:

With Listings

If \usepackage{listings} is commented out, the hyphenation rules return to normal:

Without Listings

And just to note, in the actual environment I'm working in, it will also hyphenate between hard•ware, while with listings enabled, it hyphenates hardware/•software, as in the first image:

Listings Further Example

Two questions:

  1. Why is this happening?

  2. Is there a way to disable this? I don't really want this behaviour just because I'm typing code occasionally in a document.

2

listings changes the \lccode of the slash to 47. This looks like a bug to me. Write to the maintainer.

As a workaround you can set it back to 0:

\documentclass{article}
\usepackage{listings}
\lccode`\/=0
\begin{document}

IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII hardware/software

\end{document}
  • Thank you. It looks like this same bug has been talked about before (but with the tilde) here, and was reported three years ago. I'll try reporting again. – trekky0623 Jan 16 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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