LaTeX Listing Not Visible

2.4k Views Asked by At

I am using the listings package, but only the caption is showing, not the inner text. The code is definitely not showing anywhere in the document, including after downloading the PDF (I'm using overleaf). I have the following (simplified to core elements) code:

\usepackage{listings}
\begin{document}
\begin{lstlisting}[caption={irace Parameters}, label={lst:irace}]
example
\end{lstlisting}
\end{document}

But all that is showing is the below (text above listing caption and below for context).

enter image description here

2

There are 2 best solutions below

0
Ken Reid On BEST ANSWER

Turns out it is actually working fine, but only on my windows 8.1 workstation laptop, but not working on my windows 10 office pc. I assume this is an issue with Overleaf v2.

0
Jonas On

Solution to me was hidden in the comment of Yushan ZHANG: Not only in overleaf but also locally the listings package does not properly work with the draft option. Passing final to the package fixes the issue.

\usepackage[final]{listings}