# how to draw a bicolor tcolorbox without frame?

Sometimes I want to draw tcolorboxes without frames and although I use boxrule=0pt some border frame is still visible. I would like to know why.

As an example, take a look at next code which draws a bicolor box.

\documentclass{article}
\usepackage{lmodern}
\usepackage[most]{tcolorbox}

\begin{document}

\begin{tcblisting}{bicolor, colback=blue!15,
colbacklower=white, boxrule=0pt}
This is an example of a \emph{bicolor} \texttt{tcolorbox}
\end{tcblisting}

\end{document}


As you can see the frame around the box is clearly visible. I've tested with different viewers and all of them show the border.

My opinion is that this border shows a little difference between frame dimensions and inner upper and lower parts, but I'm not sure because boxsep=0pt doesn't affect it. But colframe=white hiddes it because the paper is also white. This could be a solution except if background is colorful (like in beamer). And I would like to understand what happens.

If I use an empty skin nothing except the text is shown, but I don't now how to reproduce a bicolor skin from an empty one.

• Ulrike Fischer gave the answer I also would have given. In your case, the frame is drawn as a filled rectangle with near-black color. Then, the same space is filled with the upper and lower part of the bicolor interior. Theoretically, you should see nothing of the frame anymore. But many previewers show a ghost line with 0pt width. frame hidden switches the frame drawing completely off. – Thomas F. Sturm May 29 '15 at 6:20
• @ThomasF.Sturm Thank's for confirming it and for tcolorbox, of course! – Ignasi May 29 '15 at 6:42
• @ThomasF.Sturm Interesting. What if I want a top rule but not the other three? I would set toprule=2pt and all others to 0pt. Then I'd probably get 3 ghost rules that I don't want, and I can't use frame hidden in this case. – Cyker Jun 21 '20 at 7:37
• @Cyker See the documentation for borderline north for a top rule. Alternatively, an underlay allows adding additional TikZ code. – Thomas F. Sturm Jun 21 '20 at 9:43

You can use frame hidden

 \documentclass{article}
\usepackage{lmodern}
\usepackage[most]{tcolorbox}

\begin{document}

\begin{tcblisting}{bicolor, colback=blue!15,
colbacklower=white, boxrule=0pt,frame hidden}
This is an example of a \emph{bicolor} \texttt{tcolorbox}
\end{tcblisting}

\end{document}


• Thanks, but do you know why the frame is seen even with boxrule=0pt? – Ignasi May 28 '15 at 21:28
• Imho pixel rounding. You get a border also with \begin{tikzpicture} \fill[gray] (0,0)rectangle (1,1); \fill[white] (0,0)rectangle (1,1); \end{tikzpicture}. – Ulrike Fischer May 28 '15 at 22:04
• @UlrikeFischer Yes, that's exactly the reason. tcolorbox draws the frame first, then the interior is drawn above. – Thomas F. Sturm May 29 '15 at 6:15

Not sure if this is what you wanted, but you can add \tcbset{colframe=white} to your preamble (or locally).

## Code

\documentclass{article}
\usepackage{lmodern}
\usepackage[most,listings]{tcolorbox}

\tcbset{colframe=white}

\begin{document}

\begin{tcblisting}{bicolor, colback=blue!15,colbacklower=white, boxrule=0pt}
This is an example of a \emph{bicolor} \texttt{tcolorbox}
\end{tcblisting}

\end{document}

• As I already commented, this solution only works if background is also white. – Ignasi May 28 '15 at 21:27
• @Ignasi Oh I had missed that line. Wouldn't setting it using the colour of the background work? Unless the background has multiple colours (which would be quite ugly). – Alenanno May 28 '15 at 21:55

The frame hidden option accomplishes what you are asking. Take a look at the documentation of this option (screenshot here)

See minimal working example below (screenshot here)

\documentclass{article}

\usepackage[skins, listings]{tcolorbox}

\usepackage{lipsum, showframe}

\begin{document}

\lipsum[1][1-4]
\begin{tcblisting}{
bicolor,
colback = blue!10!white,
colbacklower = blue!5!white,
boxrule = 0pt,
frame hidden,
}
This is an example of a \emph{bicolor} \texttt{tcolorbox}
\end{tcblisting}
\lipsum[2][1-4]

\end{document}


Note that i still needed to set the boxrule option to 0pt. Otherwise, the tcolorbox environment won't occupy the whole width (see proof here.)