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.
Asked
Active
Viewed 2.1k times
24
-
8\begin{verbatim}...\end{verbatim} cannot help you? – Display Name Dec 03 '10 at 02:57
2 Answers
23
What you probably want is actually the "verbatim" environment. http://www.maths.tcd.ie/~dwilkins/LaTeXPrimer/PreFormatted.html
\documentclass{article}
\begin{document}
\begin{verbatim}
Preformatted
Text
Here
\end{verbatim}
\end{document}
This compiles to:

bradreaves
- 331
12
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.
Will Robertson
- 73,872