0

Is it possible to both left and right justify paragraphs and the like when using \texttt or \tt ?

I have never found an answer.

Consider the example:

\documentclass[12pt]{book}
\usepackage{lipsum}

\begin{document}
\begin{quote}
\item \texttt{\lipsum[1]}
\end{quote}
\end{document}

which produces

enter image description here

Is there a way have the output right justified (as well as left justified)?

I have not been able to figure this out without resorting to brute force.

Thank you.

0

1 Answer 1

1

It is somewhat unconventional (and breaks the monospaced appearance) but you can make the inter-word spaces stretchy:

enter image description here

\documentclass[12pt]{book}
\usepackage{lipsum}

\begin{document}
\begin{quote}\spaceskip1em plus 1em \xspaceskip 1em plus 2em\relax
\item \texttt{\lipsum[1]}
\end{quote}
\end{document}

Not the answer you're looking for? Browse other questions tagged .