3

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.

4

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
  • Did you ever receive a reply aka is this fixed with newer versions of the package? – stefanct May 11 at 16:55
  • @stefanct I just tried with a current texlive and it isn't fixed. But I don't know if someone actually reported it. – Ulrike Fischer May 11 at 16:59
  • @trekky0623 could tell us, or even JosephWright (tex.stackexchange.com/questions/302437/…) ;) – stefanct May 11 at 17:03

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.