I have some code of around 350 lines, and I need to paste it inside a LaTeX file without losing the formatting such as the extra spaces. What do I need to use to get this in LaTeX?
Asked
Active
Viewed 2.9k times
5
1 Answers
7
You can use the package \usepackage{listings} and put your code in the following way
\begin{lstlisting}
Put your code here.
\end{lstlisting}
For information, you can read the wikibook LaTeX/Source Code Listings at https://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings
fyemath
- 276
verbatimthen)? Could you copy-paste a few lines here as an example? – Suzanne Soy Apr 21 '16 at 22:56\lstinputlisting. – Apr 21 '16 at 23:00