Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm familiar with the Defining a command for a minted environment question. In addition to defining the mint parameters I also want to wrap the minted code inside a Tikz box for its nice looks.

I've tried the following code which obviously doesn't work due to the command issue. But I can't find how combine it with the tools the minted library provides:

\begin{tikzpicture} \node [mintedbox] (box){ \begin{minipage}{\textwidth}
    \end{minipage}  }; \end{tikzpicture}

Perhaps superfluous but here is the error I get:

! Paragraph ended before \FV@BeginScanning was complete.
share|improve this question
The answer of the linked question is similar to your problem: tex.stackexchange.com/questions/23744/… –  Marco Daniel Jan 15 '12 at 15:40
I'm trying to figure out how. Those work with different environments. So indeed it is similar but the \newminted command doesn't provide in customisation/wrapping options similar to the two mentioned in your link. –  Alessandro Vermeulen Jan 15 '12 at 16:03
add comment

1 Answer

up vote 6 down vote accepted

The problem with defining a command contains verbatim material is shown in the link.

Whatever I think the easiest method is to redefine the internal colorbg environment and set the bgcolor-option global.

Based on the redefinition you can use the command \newmint to define your \jscode



  \tikz\node[mintedbox,text width=\linewidth,] 



enter image description here

share|improve this answer
This did the trick for me. Thank You! –  Alessandro Vermeulen Jan 16 '12 at 17:38
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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