I read this answer, and this one about how to hyphenate \texttt
text and handling special chars. However, it is not really doing what I intend.
\documentclass{scrreprt}
\usepackage{classicthesis,lipsum} % classicthesis to make it closer to my actual document
\DeclareFontFamily{\encodingdefault}{\ttdefault}{\hyphenchar\font=23}
\lccode`\:`\:
\begin{document}
This is a meaningless line of text \texttt{and:this:is:meaninglessly:typewritten:text}.
This line is equally meaningless, but also also also also also also contains a \texttt{somewhatlongishwordwhichshouldbehyphenated}
\end{document}
produces
So apparently, \font=23
is not the codepoint of the character mentioned in this answer. So I figured I could simply \usepackage[T1]{fontenc}
, but this un-typewrites the text:
\documentclass{scrreprt}
\usepackage{classicthesis,lipsum}
\usepackage[T1]{fontenc}
\DeclareFontFamily{\encodingdefault}{\ttdefault}{\hyphenchar\font=23}
\lccode`\:`\:
\begin{document}
This is a meaningless line of text \texttt{and:this:is:meaninglessly:typewritten:text}.
This line is equally meaningless, but also also also also also also also also contains a \texttt{somewhatlongishwordwhichshouldbehyphenated}
\end{document}
This "hyphenates" correctly, but the font is wrong
How can I get both T1 font encoding with hyphenation and typewritten text?
-
sign.