The \texttt
normally does not lead to automatic hyphenation or linebreaks. However, it apparently does when using the underscore
package:
\documentclass{article}
\usepackage[nohyphen]{underscore}
\begin{document}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam diam \texttt{_nonumynonumy} eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
\end{document}
The underscore is displayed in the first line, and the rest in the second line. Without the [nohyphen]
option, it even adds a hyphen. I need the underscore package, because otherwise LaTeX only allows _
in math mode.
How can I disable line-breaking and still use underscores in \texttt
?
\_
? Is it too much text with_
? – koleygr Sep 8 '18 at 18:32