I have a quite long but narrow code I want to typeset inside a tcolorbox.
Is it possible to enable a two (or more) column mode inside the box (not break the box and set the parts adjacent). The remaining part of the document is single-column.
If possible I would like it to still be floatable if enabled, it doesn't need to be breakable.
EDIT: it seems not to be enough to escape \tcblower
from the minted
part. I tried it with the listings
package and it just broke the layout.
\documentclass{report}
\usepackage{tcolorbox}
\tcbuselibrary{minted}
\usepackage{blindtext}
\begin{document}
\blindtext
\begin{tcblisting}{title=This is source code in another language (XML),
minted language=XML,listing only}
<project
name="Package tcolorbox"
default="documentation"
basedir="."
>
</project>
<project
name="Package tcolorbox"
default="documentation"
basedir="."
>
</project>
<project
name="Package tcolorbox"
default="documentation"
basedir="."
>
</project>
\end{tcblisting}
\blindtext
\end{document}
Best Answer
It's not perfect (I personally don't like how the code cuts mid tag) but it should do the job.
Basically, I unpacked the
tcblisting
environment and added amulticols
environment.