After code block

\begin{codelisting}

\caption{Listing caption 1}\label{lst:code1}

\begin{Shaded}
\begin{Highlighting}[]
\OtherTok{main ::} \DataTypeTok{IO}\NormalTok{ ()}
\NormalTok{main }\OtherTok{=} \FunctionTok{putStrLn} \StringTok{"Hello World!"}
\end{Highlighting}
\end{Shaded}

\end{codelisting}

\begin{codelisting}

\caption{Listing caption 2}\label{lst:code2}

\begin{Shaded}
\begin{Highlighting}[]
\OtherTok{main ::} \DataTypeTok{IO}\NormalTok{ ()}
\NormalTok{main }\OtherTok{=} \FunctionTok{putStrLn} \StringTok{"Hello World!"}
\end{Highlighting}
\end{Shaded}

\end{codelisting}

\begin{codelisting}

\caption{Listing caption 3}\label{lst:code3}

\begin{Shaded}
\begin{Highlighting}[]
\OtherTok{main ::} \DataTypeTok{IO}\NormalTok{ ()}
\NormalTok{main }\OtherTok{=} \FunctionTok{putStrLn} \StringTok{"Hello World!"}
\end{Highlighting}
\end{Shaded}

\end{codelisting}

\begin{codelisting}

\caption{Listing caption 4}\label{lst:code4}

\begin{Shaded}
\begin{Highlighting}[]
\OtherTok{main ::} \DataTypeTok{IO}\NormalTok{ ()}
\NormalTok{main }\OtherTok{=} \FunctionTok{putStrLn} \StringTok{"Hello World!"}
\end{Highlighting}
\end{Shaded}

\end{codelisting}

\begin{Shaded}
\begin{Highlighting}[]
\OtherTok{main ::} \DataTypeTok{IO}\NormalTok{ ()}
\NormalTok{main }\OtherTok{=} \FunctionTok{putStrLn} \StringTok{"Hello World!"}
\end{Highlighting}
\end{Shaded}

: Listing caption 5 (invalid)

\begin{Shaded}
\begin{Highlighting}[]
\OtherTok{main ::} \DataTypeTok{IO}\NormalTok{ ()}
\NormalTok{main }\OtherTok{=} \FunctionTok{putStrLn} \StringTok{"Hello World!"}
\end{Highlighting}
\end{Shaded}

: Listing caption 6 (invalid)

Before code block

\begin{codelisting}

\caption{Listing caption 11}\label{lst:code11}

\begin{Shaded}
\begin{Highlighting}[]
\OtherTok{main ::} \DataTypeTok{IO}\NormalTok{ ()}
\NormalTok{main }\OtherTok{=} \FunctionTok{putStrLn} \StringTok{"Hello World!"}
\end{Highlighting}
\end{Shaded}

\end{codelisting}

\begin{codelisting}

\caption{Listing caption 12}\label{lst:code12}

\begin{Shaded}
\begin{Highlighting}[]
\OtherTok{main ::} \DataTypeTok{IO}\NormalTok{ ()}
\NormalTok{main }\OtherTok{=} \FunctionTok{putStrLn} \StringTok{"Hello World!"}
\end{Highlighting}
\end{Shaded}

\end{codelisting}

\begin{codelisting}

\caption{Listing caption 13}\label{lst:code13}

\begin{Shaded}
\begin{Highlighting}[]
\OtherTok{main ::} \DataTypeTok{IO}\NormalTok{ ()}
\NormalTok{main }\OtherTok{=} \FunctionTok{putStrLn} \StringTok{"Hello World!"}
\end{Highlighting}
\end{Shaded}

\end{codelisting}

\begin{codelisting}

\caption{Listing caption 14}\label{lst:code14}

\begin{Shaded}
\begin{Highlighting}[]
\OtherTok{main ::} \DataTypeTok{IO}\NormalTok{ ()}
\NormalTok{main }\OtherTok{=} \FunctionTok{putStrLn} \StringTok{"Hello World!"}
\end{Highlighting}
\end{Shaded}

\end{codelisting}

\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}

: Listing caption 15 (invalid)

\begin{Shaded}
\begin{Highlighting}[]
\OtherTok{main ::} \DataTypeTok{IO}\NormalTok{ ()}
\NormalTok{main }\OtherTok{=} \FunctionTok{putStrLn} \StringTok{"Hello World!"}
\end{Highlighting}
\end{Shaded}

: Listing caption 16 (invalid)

\begin{Shaded}
\begin{Highlighting}[]
\OtherTok{main ::} \DataTypeTok{IO}\NormalTok{ ()}
\NormalTok{main }\OtherTok{=} \FunctionTok{putStrLn} \StringTok{"Hello World!"}
\end{Highlighting}
\end{Shaded}

lst.~\ref{lst:code1}

lst.~\ref{lst:code2}

lst.~\ref{lst:code3}

lst.~\ref{lst:code4}

lst.~\ref{lst:code11}

lst.~\ref{lst:code12}

lst.~\ref{lst:code13}

lst.~\ref{lst:code14}
