I want to create a table with a fancy outer box. I thought it is a good idea to use this example from texample.net
The problem is that it is not possible to use floats inside the tikzpicture and the other bigger problem is, I want to set my caption in a way that ut appeards in the fancytitle but it should be a "real" caption as I use \listoftables.
If it is important: In this example there is this $\clubsuit$ on the right side of the box. In my application there will be a custom small tikzpicture.
Is it possible to achive this without tikz? Is it possible anyway?
MWE
\documentclass{article}
\usepackage{longtable}
\usepackage{caption}
% tikz example taken from http://www.texample.net/tikz/examples/boxes-with-text-and-math/
\usepackage{tikz}
\usetikzlibrary{shapes,snakes}
% Define box and box title style
\tikzstyle{mybox} = [draw=red, fill=blue!20, very thick, rectangle, rounded corners, inner sep=10pt, inner ysep=20pt]
\tikzstyle{fancytitle} = [fill=red, text=white]
\begin{document}
\listoftables
\begin{tikzpicture}
\node [mybox] (box){%
% put table here
% \begin{table}
% \caption{the cpation}
% \centering
% \begin{tabular}{l l}
% a &b \\
% b &d
% \end{tabular}
% \label{tab:tab}
% \end{table}
};
\node[fancytitle, right=10pt] at (box.north west) {the fancy caption}; % put caption here, it must be a "real" caption since I need the cpation for \listoftables
\node[fancytitle, rounded corners] at (box.east) {$\clubsuit$};
\end{tikzpicture}%
\end{document}
Wanted Output




tcolorboxpackage. all of those fancyness is available – percusse Aug 13 '16 at 16:39