Beamer \transições de slide visíveis, legenda não funciona

Beamer \transições de slide visíveis, legenda não funciona

Tenho o MWE com transições "visíveis"; existem elementos visíveis em <1> e elementos visíveis em <2>.

Obtenho o resultado desejado até tentar mexer nas legendas; no momento em que tento adicionar a legenda da Figura B em <2> (comentado no MWE), recebo cerca de um milhão de erros, começando com:

\spacefactor impróprio. \end{quadro}

OBSERVE QUE QUERO ADICIONAR LEGENDAS DIFERENTES PARA AS FIGURAS A E B.

Este é o MWE:

\documentclass{beamer}

\usepackage{tikz}
\usetikzlibrary{positioning,calc}
\usepackage[labelformat=empty,font=scriptsize,skip=0pt,
justification=raggedright,singlelinecheck=false]{caption}
\usepackage{threeparttable}

\begin{document}

\begin{frame}
    \begin{figure}
    \begin{measuredfigure}
    \begin{tikzpicture}[remember picture, every node/.style={inner sep=0,outer sep=0,align=left}]
    \node (node1) at (0,0) {\includegraphics[width=6.8cm]{example-image}};

    \visible<1>{
        \node[right=6.9cm of node1.south west, anchor=south west] (node2) {\includegraphics[width=3.75cm]{example-image-a}};
    }
    \visible<2>{
        \node[right=6.9cm of node1.south west, anchor=south west] (node2) {\includegraphics[width=3.75cm]{example-image-b}};
    }
    \end{tikzpicture}
    \visible<1>{
        \captionof{figure}{\hspace{6.9cm}caption of figure A}
    }
    %\visible<2>{%WORKS UNTIL I TRY TO ADD THIS CAPTION
    %   \captionof{figure}{\hspace{6.9cm}caption of figure B}
    %}
    \end{measuredfigure}
    \end{figure}
\end{frame}

\end{document}

O que produz:

A

B

Observe a ausência de legenda em B... Como posso fazer isso funcionar?? Obrigado!!

Responder1

Editar: tente o seguinte MWE:

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{positioning}

\begin{document}
\begin{frame}
    \begin{figure}
\begin{tikzpicture}[
    node distance =0mm and 5mm,
    every node/.style={anchor=west, align=center}
                    ]
\node (a) {\includegraphics[width=6.8cm]{example-image}};
\visible<1>{
\node (b) [above right=of a.south east] {\includegraphics[width=3.75cm]{example-image-a}};
\node[below=of b] {caption of figure A};
            }
\visible<2>{
\node (b) [above right=of a.south east] {\includegraphics[width=3.75cm]{example-image-b}};
\node[below=of b] {caption of figure B};
            }
\end{tikzpicture}
    \end{figure}
\end{frame}
\end{document}

No caso de legenda multilinha, é sensato definir um estilo separado para nós com legenda. Por exemplo:

 capt/.style = {text width=#1, align=left}

e em vez disso \node[below=of b] {caption of figure B};usar

\node[capt=3.75cm, below=of b] {caption of figure B};

informação relacionada