I have been trying to put separate frames around a figure, its caption and caption name. Please see the image below:
I already managed to create a frame around the image itself and the caption:
But how can I put the caption name (e.g. Fig.1) in a separate box?
My code looks like this so far:
\documentclass[t,8pt]{beamer}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{caption}
\usepackage{tcolorbox}
\usepackage[framemethod=tikz]{mdframed}
\newmdenv[
innerlinewidth=0.1mm,
roundcorner=4pt,
linecolor=black,
innerleftmargin=6pt,
innerrightmargin=6pt,
innertopmargin=6pt,
innerbottommargin=6pt]{mybox}
% Framed figure
\newcommand{\framedFigure}[2]{%
\vspace{-2mm}
\begin{figure}
\begin{mybox}
\centering
#1
\end{mybox}
\vspace{-3.5mm}
\begin{tcolorbox}[
boxrule=0.2mm,boxsep=-3.5mm,lowerbox=ignored,colback=lightgray,
colframe=black
]
\caption{#2}
\end{tcolorbox}
\vspace{-3mm}
\end{figure}
}
\begin{document}
\begin{frame}{}
\framedFigure{
\begin{tikzpicture}[scale=1.3]
\node[draw=black,circle,fill=lightgray] (A) at (0,0){\textbf{A}};
\node[draw=black,circle,fill=lightgray] (B) at (3,0){\textbf{B}};
\draw[->,dashed] (A) -- node[above]{$k$} (B);
\end{tikzpicture}
}{$k$-$folgt$ Relation für die kritischen Abschnitte A und B}
\end{frame}
\end{document}
Any help would be appreciated. Thanks in advance. :) Daniel
\documentclass{...}
, the required\usepackage
's,\begin{document}
, and\end{document}
. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Henri Menke Oct 26 '16 at 15:12