假设我有以下演示文稿并想在下一张幻灯片上显示 umlcall。我尝试使用 onlyenv 环境覆盖,但它不适用于 pdfLaTeX:
\documentclass{beamer}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz,ifthen,xstring,calc,pgfkeys,pgfopts}
\usepackage{tikz-uml}
\begin{document}
\begin{frame}
\begin{tikzpicture}
\begin{umlseqdiag}
\umlobject[class=A]{a}
\umlobject[class=B]{b}
\begin{onlyenv}<2>
\begin{umlcall}[op=call(), return=ok]{a}{b}
\end{umlcall}
\end{onlyenv}
\end{umlseqdiag}
\end{tikzpicture}
\end{frame}
\end{document}
怎么了?
预先感谢!
答案1
改用\only<2>{...}
:
\documentclass{beamer}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz,ifthen,xstring,calc,pgfkeys,pgfopts}
\usepackage{tikz-uml}
\begin{document}
\begin{frame}
\begin{tikzpicture}
\begin{umlseqdiag}
\umlobject[class=A]{a}
\umlobject[class=B]{b}
%\begin{onlyenv}<2>
\only<2>{\begin{umlcall}[op=call(), return=ok]{a}{b}
\end{umlcall}}
%\end{onlyenv}
\end{umlseqdiag}
\end{tikzpicture}
\end{frame}
\end{document}