I created a poster with the baposter class. The basic structure is defined through posterbox objects. Within these, I did embed pictures, using tcolorbox as frame.
Actual Code:
\begin{tcolorbox}[colframe=gray,colback=white,boxrule=2pt,arc=0.6em,boxsep=-1mm]
\includegraphics[width=5.8cm]{figure.eps}
\end{tcolorbox}
Minimal working example:
\documentclass[a0paper,portrait]{article}
\usepackage{tcolorbox}
\begin{document}
\title{Test}
\begin{tcolorbox}[colframe=gray,colback=white,boxrule=2pt,arc=0.6em,boxsep=-1mm]
\end{tcolorbox}
\end{document}
I did realize that the embedded image protrudes the rounded corners. How can I apply something like an inner margin? I did play with the boxsep argument, which did not seem to help.
Sorry for not providing the complete file. I would have to strip quite a lot, since the poster contains a lot of unpublished data.
Edit: Sorry for not providing an image! MWE also included now.
Also happens for empty tcolorboxes.
This portion added by Steven Segletes to better demonstrate the strange behavior. Changing the arc
units from em
to pt
changes the behavior completely.
\documentclass[a0paper,portrait]{article}
\usepackage{tcolorbox}
\begin{document}
\title{Test}
\begin{tcolorbox}[colframe=gray,colback=white,boxrule=2pt,arc=.3em,boxsep=-1mm]
\end{tcolorbox}
\begin{tcolorbox}[colframe=gray,colback=white,boxrule=2pt,arc=3.4pt,boxsep=-1mm]
\end{tcolorbox}
\end{document}
Best Answer
There is more than one question to answer here. I try to answer them step by step.
1. How to define an inner margin for a tcolorbox?
The margins are set by
left
,right
,top
,bottom
. Additionally,boxsep
is added to all these values for the resulting margin.E.g.
gives a total of
3pt
for the left and right margin, and a total of1pt
for the top and bottom margin.2. Content clipping
If rounded corners are used, but there is no margin or a very small margin, the text content (e.g. a picture) can protrude over the rounded corners. This can be avoided by using the
enhanced
andclip upper
options of theskins
library which clip the interior:3. Font dependend units
A
tcolorbox
is drawn inside apgfpicture
or atikzpicture
environment. Inside such an environment, a nullfont is used. If font dependend units likearc=.3em
are given, the actual sizing depends on where this setting is used exactly inside the internal implementation. If it is used (and expanded) before the actualtikzpicture
, it will have the intended size, but if it is used very lately in the drawing process, it may become zero.Using
gives an unlucky combination of this effect. The
outer arc
is computed automatically before the graphical environment is started. It gets the intended (expanded) size. The inner arc (i.e.arc
) stays at0.3em
and becomes0pt
inside the graphical environment.So, currently, one should use fixed units like
3pt
or3mm
to avoid such effects. But, for the nexttcolorbox
version (3.36
or higher), I will implement a sanitize procedure which freezes font depended units before entering the graphical environment.