Text failing to be justified, hyphenated, and set raggedright:

\documentclass{article}
\usepackage[T1]{fontenc}%A typewriter font.
\renewcommand*\familydefault{\ttdefault}
\setbox0\hbox{\texttt{ }}
\dimen0=\wd0
\setlength\textwidth{50\dimen0}
\begin{document}
\bigskip\hrule\bigskip
in the preamble instead of the default font, the beautiful
word-wrapping that happens no longer works and words just go off the
page willy-nilly. Is there some option/package I can use to return
LaTeX to normal behaviour?
\bigskip\hrule\bigskip
{\hyphenchar\font`\- \hyphenation{th-e w-o-r-k-s th-ere l-a-t-e-x}\lefthyphenmin=0 \righthyphenmin=0
in the preamble instead of the default font, the beautiful
word-wrapping that happens no longer works and words just go off the
page willy-nilly.\\ Is there some option/package I can use to return
LaTeX to normal behaviour?
}
\bigskip\hrule\bigskip
{\raggedright
in the preamble instead of the default font, the beautiful
word-wrapping that happens no longer works and words just go off the
page willy-nilly. Is there some option/package I can use to return
LaTeX to normal behaviour?
}
\bigskip\hrule\bigskip
\end{document}
\ttfamilyor thetype writerfont can't break and wrap! You've changed the font settings to use\ttdefault. Did you mean\rmdefaultactually? – Oct 16 '15 at 12:16\textttused for individual words can often make sense (as there is flexibility in the rest of the line) enabling hyphenation in a block of text that is all monospace is always going to poke you in the eye. – David Carlisle Oct 16 '15 at 13:31\raggedright? – David Carlisle Oct 16 '15 at 13:33