I've tried
\begin{listing}
\begin{minted}{SQL}
SELECT COUNT(*) FROM lineitem
WHERE l_shipdate <= :shipdate
\end{minted}
\label{test}
\end{listing}
but it doesn't work. \cref{test}
reference to the parent section
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityYou need something that has a number, i.e. a \caption
:
\documentclass{article}
\usepackage{minted}
\usepackage{cleveref}
\begin{document}
\begin{listing}
\begin{minted}{SQL}
SELECT COUNT(*) FROM lineitem
WHERE l_shipdate <= :shipdate
\end{minted}
\caption{Testing}
\label{test}
\end{listing}
See \cref{test}.
\end{document}
\begin{minted}[frame=lines]{SQL}
, but the manual mentions that both the tcolorbox
and mdframed
packages have interfaces for minted
, so in that sense there is a lot of flexibility with regard to frames. To move the caption to the top, see tex.stackexchange.com/a/256796/586
Jun 30, 2017 at 18:19
\documentclass
and ending with\end{document}
.