i have defined my new command:
% sets for lstlisting
\lstset{
basicstyle=\small\ttfamily,
columns=flexible,
breaklines=true,
frame=single,
rulecolor=\color{colorCodeBorder}
}
\newcommand{\mynote}[1]{
\begin{tcolorbox}[colframe=black!50]
{#1}
\end{tcolorbox}
}
and try to use it with lstlisting
\mynote{
always use this command:
\begin{lstlisting}
some code
\end{lstlisting}
}
but get error:
Package Listings Warning: Text dropped after begin of listing on input line ...
How could it be resolved?
EDIT: if i skip my command then it is ok:
\begin{tcolorbox}[colframe=black!20]
Always use this code:
\begin{lstlisting}
some code
\end{lstlisting}
\end{tcolorbox}
but i need to call it by \mynote due to other issues... So am i doing sth wrong with defining my command? Be gratefull for your any help..