I was thinking how can I frame particular pieces of minted environment for beamer slides. I had a choice either to use overlays and split code across several blocks ( Beamer vs. Minted: overlays ) or just to draw some frame on top. I feel like the second should be a bit better though it would require some absolute coordinates for selection to roughly match code.
I've read Wrapping minted in a Tikz box with a command and it works just fine, however I'd like to be able to refer to each node by some unique name. For instance the following allows me to refer to a single minted block later as a.
\renewenvironment{minted@colorbg}[1]{%
\noindent
\begin{lrbox}{\minted@bgbox}
\begin{minipage}{.8\linewidth}}
{\end{minipage}
\end{lrbox}%
\tikz\node[text width=\linewidth,] (a) %mintedbox,
{\usebox{\minted@bgbox}};
}
%\newmint[jscode]{javascript}{}
\tikzstyle{every picture}+=[remember picture]
So I can have later something like
\begin{tikzpicture}[overlay]
\draw (a.north west) rectangle ++(2cm,-1cm);
\end{tikzpicture}
I'd like it to be less hard-coded. Is it possible to pass a name into that \renewenvironment definition via somehow redefined minted or something?
If there are better alternatives to point into particular fragments of minted environment on beamer slides, I'd be interested.
Would you mind sharing an idea if it is possible to utilize \label and if possible use different coordinate system of tikz such that I naturally use line numbers instead of cm in vertical direction?
It would complete the way to put an emphasis on parted of minted block.
– mlt Feb 02 '12 at 03:59
– mlt Feb 02 '12 at 04:47\draw ($(minted1.north west)-(0cm,5cm)$) rectangle ++($(minted1.east) - (minted1.west) - (0cm,1cm)$);@character :) – percusse Mar 31 '12 at 11:50