I want to add a background color to the minted environment in my LaTeX document. However, when I add the the background color the environment does not start in a new line. Could someone help me fix this problem?
\documentclass[11pt,letterpaper]{article}
\usepackage[left=1.00in, right=1.00in, top=1.00in, bottom=1.00in]{geometry}
\usepackage{minted}
\definecolor{bg}{rgb}{0.85,0.85,0.85}
\newminted[bashcode1]{bash}{linenos=true, texcl=true, bgcolor=bg}
\newminted[bashcode2]{bash}{linenos=true, texcl=true}
\listfiles
\begin{document}
\noindent The following minted environment does not begin in a new line because of adding a background color to the minted environment.
\begin{bashcode1}
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer # Java version 8
\end{bashcode1}
When I remove the background color the environment begins in a new line, which is what I am looking for.
\begin{bashcode2}
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer # Java version 8
\end{bashcode2}
\end{document}
The following is the result of listfiles.
*File List*
article.cls 2007/10/19 v1.4h Standard LaTeX document class
size11.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
geometry.sty 2010/09/12 v5.6 Page Geometry
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
ifpdf.sty 2011/01/30 v2.3 Provides the ifpdf switch (HO)
ifvtex.sty 2010/03/01 v1.5 Detect VTeX and its facilities (HO)
ifxetex.sty 2010/09/12 v0.6 Provides ifxetex conditional
geometry.cfg
minted.sty 2011/09/17 v1.7 Yet another Pygments shim for LaTeX
fancyvrb.sty 2008/02/07
xcolor.sty 2007/01/21 v2.11 LaTeX color extensions (UK)
color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX
infwarerr.sty 2010/04/08 v1.3 Providing info/warning/error messages (HO)
ltxcmds.sty 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
float.sty 2001/11/08 v1.3d Float enhancements (AL)
ifthen.sty 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
calc.sty 2007/08/22 v4.3 Infix arithmetic (KKT,FJ)
ifplatform.sty 2010/10/22 v0.4 Testing for the operating system
pdftexcmds.sty 2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
ifluatex.sty 2010/03/01 v1.3 Provides the ifluatex switch (HO)
catchfile.sty 2011/03/01 v1.6 Catch the contents of a file (HO)
etexcmds.sty 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
supp-pdf.mkii
mintedproblem.pyg
mintedproblem.out.pyg
mintedproblem.out.pyg
I get the following output from the MWE.




tcolorbox. It is just a great package. – shashashamti2008 Apr 28 '14 at 04:43tcolorboxwith no problem. However, when I put it in my document I getIllegal parameter number in definition of \next #error and texstudio highlights the line which points tocolback=bg,. When I comment the line:colback=bg,I still get the same error. Could you advise me on this? – shashashamti2008 Apr 28 '14 at 18:47bgto something else. Remember to make afragileframe. – egreg Jul 08 '16 at 16:35bg, the background becomes gray, but no code shows up. – IVlad Jul 08 '16 at 16:45