I've got a code snippet, that I'd like to annotate with arrows, boxes, and bubbles pointing to the various parts of the code.
Right now, I've got the code in a minted
environment, inside a minipage
, inside a tikzpicture
.
I'm wondering, is it possible to draw on top of the minipage, so that I can point to various parts of the code inside the minipage with arrows?
What I have:
\documentclass{article}
\usepackage{tikz}
\usepackage{minted}
\begin{document}
\tikzstyle{mybox} = [draw=blue, fill=green!20, very thick,
rectangle, rounded corners, inner sep=10pt, inner ysep=20pt]
%
\begin{tikzpicture}[transform shape, baseline=-3.5cm]
\node [mybox] (box) {%
\begin{minipage}[t!]{0.5\linewidth}
Foo
\end{minipage}
\begin{minipage}[t!]{0.5\linewidth}
\begin{minted}{haskell}
let
map = \f -> \l -> case l of
[] -> []
(a :: b) -> (f a) :: (map f b)
in case map (\x->x) [1,2] of
(h :: t) -> (h,t)
\end{minted}
\end{minipage}
};
\end{tikzpicture}
%
\end{document}
What I want:
tikzmark
?minipage
s.tikzmark
works with listings / lstlistings and has specific code to modify the hooks provided, but minted isn't mentioned. (For some reason, I thought it was, but I must have been confused.)