1

I got an assignment where i have to explain some code and to do that i have to show my code as normal text. I have no idea how to show my code so is there anyone that could show me how it's done?

\begin{enumerate}
\item test.
\item test.
\item test.
\end{enumerate}
Bernard
  • 271,350
teera
  • 11

1 Answers1

1

Try with \verbatim:

\documentclass{book}

\begin{document}

\begin{verbatim}
\begin{enumerate}
\item test.
\item test.
\item test.
\end{enumerate}
\end{verbatim}

\end{document}

You can also do it with \listings

\documentclass{article}

\usepackage{listings}

\begin{document}

\begin{lstlisting}
\begin{enumerate}
\item test.
\item test.
\item test.
\end{enumerate}
\end{lstlisting}

\end{document}
Chüngel
  • 189