-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multicols #375
Comments
Yes but this doesn't work with \inputminted inside a tcolorbox, as in \begin{tcolorbox}[%
unbreakable, enhanced, colback={red}, colframe={yellow}, %
sharp corners, boxrule=1pt, enhanced jigsaw, %
opacityback=.50, boxsep=0pt, width=\textwidth, left=3pt, %
right=3pt, top=3pt, bottom=2pt, arc=0pt, outer arc=0pt]
\inputminted{python}{helloworld.py}%
\end{tcolorbox} |
% !TeX TXS-program:compile = txs:///pdflatex/{%.tex} -shell-escape "%.tex"
\begin{filecontents}[noheader]{sample-doc.tex}
\documentclass{article}
\usepackage{amsmath}
\begin{document}
content
\[
a^2 + b^2 = c^2
\]
\end{document}
\end{filecontents}
\documentclass{article}
\usepackage{minted}
\usepackage{multicol}
\usepackage{tcolorbox}
\tcbuselibrary{breakable, skins}
\begin{document}
\begin{tcolorbox}[
unbreakable, enhanced, colback={red}, colframe={yellow},
sharp corners, boxrule=1pt, enhanced jigsaw,
% "opacityback=.50" changed to "opacityback=.20"
opacityback=.20, boxsep=0pt, width=\textwidth, left=3pt,
right=3pt, top=3pt, bottom=2pt, arc=0pt, outer arc=0pt,
before upper=\begin{multicols}{2}, after upper={\end{multicols}} % <<< added
]
\inputminted{tex}{sample-doc.tex}
\end{tcolorbox}
\end{document} Here \begin{tcolorbox}[before upper=\begin{multicols}{2}, after upper={\end{multicols}}]
content
\end{tcolorbox} is equivalent to \begin{tcolorbox}
\begin{multicols}{2}
content
\end{multicols}
\end{tcolorbox} PS: Only environments that don't collect its content can be used this way (through options |
Great! This works. Thank you. |
@emeth69 it seems this issue is solved for you, so, can you close this :) |
can you explain this a bit more? |
@goyalyashpal It's hard to give a formal definition. For \begin{tcolorbox}[before upper=\begin{multicols}{2}, after upper={\end{multicols}}]
content
\end{tcolorbox} and \begin{tcolorbox}
\begin{multicols}{2}
content
\end{multicols}
\end{tcolorbox} give the same output. But for some other environments, only the second form works and the first form may even fail to compile. Apart from verbatim-like envs, |
Dear Minted Experts,
is there a way to have code formatted by minted in 2 or more columns side by side as the multicols=«number» option of the listings package? Or some workaround to have it implemented?
Thank you
The text was updated successfully, but these errors were encountered: