I have an article in latex that has two columns. I am also using the lstlisting package to display code, and want the code two span over both columns similar to how \begin{figure*} works. If I place the listing in \onecolumn \twocolumn the listing is placed on a page by its own, but I would like the listing on the same page as text.
\documentclass[APA,STIX2COL]{WileyNJD-v2}
\lstdefinestyle{basic}{
numbers= none,
numberstyle=\scriptsize,
basicstyle=\ttfamily\scriptsize,
tabsize=2,
breaklines=true,
backgroundcolor=\color{black!10}
}
\begin{document}
\begin{lstlisting} [style=basic,float,floatplacement=htbp]
public class Main {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
\end{lstlisting}
\end{document}
Document class can be found here https://www.overleaf.com/latex/templates/a-demonstration-of-the-latex-class-file-for-wiley-njd-journals/bfwqvgnbgcjc
Use Figure. For example: