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.
\draw ($(minted1.north west)-(0cm,5cm)$) rectangle ++($(minted1.east) - (minted1.west) - (0cm,1cm)$);
– mlt Feb 2 '12 at 4:47@
character :) – percusse Mar 31 '12 at 11:50