General ⇒ Indented text for code example
Indented text for code example
I need to add in a report a piece of code i wrote in matlab. I though I could do that with \begin{quote} ... \end{quote}. The problem is that it doesn't keep the indentation. Does anyone know how to make the text as it looks like in matlab?
Thanks
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Indented text for code example
Re: Indented text for code example
I was wondering if there was an environment that could recognize the indentation, but I guess that I have to do it manually.
Thanks again
Indented text for code example
Code: Select all
\documentclass{article}
\begin{document}
\begin{verbatim}
text
text
text
text
\end{verbatim}
\end{document}
Re: Indented text for code example
That is exactly what I was looking for!