I have this MWE
\documentclass{article}
\usepackage[many]{tcolorbox}
\usepackage{minted}
\usepackage{graphicx}
\usepackage{mwe}
\setminted{linenos}
\tcbset{
common/.style={
before=\vskip2\baselineskip\noindent,
enhanced,
title empty,
frame empty,
segmentation empty,
middle=0.7cm,
top=0.5cm,
left*=1.5mm, right*=1.5mm, bottom=0pt
}
}
\DeclareTColorBox{coolbox}{O{}mO{}}{
common,
interior code={
\filldraw[ultra thick,fill=white,draw=black,rounded corners=10pt,#1] (frame.north west) -- (frame.north east)[sharp corners] -- (frame.south east);
\node at ([xshift=-30pt,yshift=3pt]interior.north east) {\includegraphics[#3]{#2}};
},
}
\begin{document}
\begin{coolbox}{example-image}[width=1.5cm,angle=-20]
\begin{minted}{bash}
ENV="() { :; }; echo foo" bash
\end{minted}
\end{coolbox}
\begin{minted}{bash}
ENV="() { :; }; echo foo" bash
\end{minted}
\end{document}
latexmk -interaction=nonstopmode -shell-escape -synctex=1 -lualatex ./foo.tex
But as you can notice there is a problem with number of lines (I highlighted it with the purple color). In particular the first minted
environment is inside coolbox
but the second one not. So the first minted
is squashed inside coolbox
.
The question: Is it possible to avoid the squashing on the left side of coolbox
(only on the left because it always opens) to align number of lines outside and inside of it?
left*=0mm
in line 19 give what you want?