[Tex/LaTex] Latex equivalent of

verbatim

This is probably a simple question, but I can't find the answer anywhere. How can I tell tex (latex specifically) not to format a piece of text? I.e. I want to keep indentation, line breaks, etc.

Best Answer

I think the closest thing that will do what you want is the alltt package:

\documentclass{article}
\usepackage{alltt}
\begin{document}
\begin{alltt}
\rmfamily
hello \emph{emph}
  there
lipsum
\end{alltt}
\end{document}

Unfortunately alltt doesn't contain any features to globally change the font it uses, but as you can see setting it to use roman manually works fine.

Related Question