# How to activate hyphenation in \ttfamily without explictly setting a font?

I am suprised that in the code below no hyphenation is done. And I can not find something about that on the web. Maybe I used the wrong words for searching.

\documentclass{scrartcl}
\usepackage{xltxtra}
\usepackage{polyglossia}
\setdefaultlanguage[spelling=new]{german}
\usepackage{tabu}

\begin{document}
\begin{ttfamily}
A&
B&
Sichtweise, Haltung, Akzeptanz, useability, Anwenderfreundlichkeit&
D\\
\end{tabu}
\end{ttfamily}
\end{document}


• Does Anwenderfreundlichkeit hyphenate in regular text? – Zarko Feb 2 '16 at 15:00
• LaTeX doesn't hyphenate typewriter type text – egreg Feb 2 '16 at 15:09

By default, LaTeX doesn't hyphenate typewriter type text.

With fontspec you can revert this decision quite easily, but you have to newly define a monospaced font.

\documentclass{scrartcl}
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage[spelling=new]{german}

\setmonofont{Latin Modern Mono}[HyphenChar={-}]

\usepackage{tabu}

\begin{document}
\begin{ttfamily}
A&
B&
Sichtweise, Haltung, Akzeptanz, useability, Anwenderfreundlichkeit&
D\\
\end{tabu}
\end{ttfamily}
\end{document}


• I don't think that [HyphenChar={-}] is needed, I get a font with hyphenation directly with \setmonofont{Latin Modern Mono}. As far as I can see fontspec sets hyphenchar to -1 only for the default lmtt. – Ulrike Fischer Feb 3 '16 at 9:18
• @UlrikeFischer Possibly, but I think it's clearer this way. Since legacy monospaced fonts all disable hyphenation, I can't exclude fontspec will do the same in the future. – egreg Feb 3 '16 at 10:14

This solves the problem.

\usepackage[htt]{hyphenat}