Add code in overleaf

code

I have to copy-paste some code in an overleaf document. But the code has tons of percentage symbols that overleaf takes as comments. I wanted to ask if there is any way I can just paste the code as it is without overleaf taking it too literally.

I'm very naive in latex so I'm sorry if this all sounds silly.

Best Answer

If you want to “hide” your code from LaTeX, as it were, there are multiple options. Perhaps simplest is the \begin{verbatim} … \end{verbatim} environment.

Overleaf covers this topic on their pages as well.

Related Question