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.
  • The answer of the linked question is similar to your problem: tex.stackexchange.com/questions/23744/… 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. Jan 15 '12 at 16:03

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


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.