[Tex/LaTex] Boxed caption and figure, with colored caption


I'm trying to recreate a figure and caption effect from a journal. An example of it can be seen on PDF version of Figure 1 from this article:

enter image description here

It's basically a large grey bordered box that goes around the image and caption, and the bottom section, where the caption is filled in grey.

I'm currently using


in the preamble, and


This creates a box around the whole figure and caption, and then a subbox around the caption, but they don't lineup, and I can't figure out how to change the border colour.

Any help would be appreciated.

Best Answer

Below I present one option using tcolorbox to define a figurebox environment. This environment has an optional argument to specify placement options (just as for the standard figure environment).

Instead of using two boxes, I just used one box; the upper part is used for the image and the lower one, for the caption. Use \tcblower just before \caption.

The caption package was used to easily change the color for the caption labels. Change the settings according to your needs:



  outer arc=0pt,
  enlarge left by=-5mm,
  enlarge right by=-5mm,
  text width=\textwidth-1.4pt,
  segmentation hidden=true,
  interior code={
    (interior.south west) rectangle (segmentation.north east);
    (segmentation.west) rectangle (interior.north east);
  \draw[draw=gray,line width=0.7pt]
    (segmentation.west) -- (segmentation.east);






The output:

enter image description here