
У меня есть MWE с «видимыми» переходами; есть элементы, которые видны в <1>, и элементы, которые видны в <2>.
Я получаю желаемый результат до тех пор, пока не пытаюсь поиграться с подписями; в тот момент, когда я пытаюсь добавить подпись к рисунку B в <2> (прокомментированном в MWE), я получаю около миллиона ошибок, начиная с:
Неправильный \spacefactor. \end{frame}
ОБРАТИТЕ ВНИМАНИЕ, ЧТО Я ХОЧУ ДОБАВИТЬ РАЗНЫЕ ПОДПИСИ ДЛЯ РИСУНКОВ A И B.
Это МВЭ:
\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}
Что производит:
Обратите внимание на отсутствие подписи под B... Как мне заставить это работать?? Спасибо!!
решение1
Редактировать: попробуйте следующий 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}
В случае многострочной подписи имеет смысл определить отдельный стиль для узлов с подписью. Например:
capt/.style = {text width=#1, align=left}
и чем вместо этого \node[below=of b] {caption of figure B};
использовать
\node[capt=3.75cm, below=of b] {caption of figure B};