I want to create a command, accepting an argument, which sets the content of the argument as a TikZ picture. Problem: The argument is a minted/FancyVrb environment.


%!TEX OPTIONS = --shell-escape
\newcommand{\tikzverb}[1]{\tikz{\node (text) [draw=blue, thick] {#1}; \fill [opacity=0.5] (text.north east) circle (5pt);}}

Some background: This MWE is boiled down and simplified from a command from my slides, which I set via LaTeX Beamer. I configured minted for source code highlighting, so I'd rather use this package instead of other verbatim environments. In the slides, the command should display bash shell output.
During assembling of this MWE, I found out that using a savebox does not solve the issue, which was usually one of the solutions in other questions like this. A combination of savebox and lstlisting environments works (see also this), but that'd mean another package which needs to be configured separately. I rather stick to minted, if I can (because it's great).

  • 2
    tcolorbox supports minted and making a background box. – TeXnician Aug 19 '17 at 13:57
  • Didn't know tcolorbox. Although it's another abstraction layer on top, let's see how far I come! Thanks! – AndiH Aug 19 '17 at 14:53

This does not directly answer my posed question, but the underlying problem (creating a fake bash shell). As suggested by @TeXnician, I use tcolorbox (which indeed is another package with all kind of new commands; but it's quite awesome).

I'm happy with the result: enter image description here

Any further suggestions to improve upon my code?

% \usepackage[minted]{tcolorbox}
% \tcbuselibrary{skins}
  listing engine=minted, 
  minted language=text, 
  listing only, 
  frame hidden, 
    \fill [fill=quit] ([xshift=3mm]title.west) circle (1mm);
    \fill [fill=min] ([xshift=6mm]title.west) circle (1mm);
    \fill [fill=max] ([xshift=9mm]title.west) circle (1mm);
$ echo `date`
Mon Aug 21 09:21:35 CEST 2017

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.