有没有办法让透明的图形变得“坚固”,就像可以让透明的块变得坚固一样?
仅使标题透明,而不是生成上图的实际图形代码
\documentclass[10pt]{beamer}
\mode<presentation> {
\usetheme{Frankfurt}
}
\usepackage{graphicx} % Allows including images
\setbeamercovered{transparent}
\begin{document}
\begin{frame}
\begin{block}{t}
test
\end{block}
%
\pause
\begin{block}{t}
test
\end{block}
\begin{figure}
\includegraphics[width = 0.2\textheight]{example-image}
\caption{1}
\end{figure}
\begin{figure}
\includegraphics[width = 0.2\textheight]{example-image}
\caption{2}
\end{figure}
\end{frame}
\end{document}
非常感谢您的帮助
答案1
您可以使用以下visible on
样式这个很好的答案。请注意,建议的样式现在由aobs-tikz
包。而不是将其设置opacity
为0
另一个符合您需要的值(我不知道beamer
使用的默认不透明度。
\documentclass[10pt]{beamer}
\usepackage{tikz}
\tikzset{
invisible/.style={opacity=0.3},
visible on/.style={alt=#1{}{invisible}},
alt/.code args={<#1>#2#3}{%
\alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} % \pgfkeysalso doesn't change the path
},
}
\newcommand{\includegraphicswithwisibility}[3]{
\begin{tikzpicture}
\node[visible on={#1}] at (0,0) {\includegraphics[#2]{#3}};
\end{tikzpicture}
}
\mode<presentation> {
\usetheme{Frankfurt}
}
\usepackage{graphicx} % Allows including images
\setbeamercovered{transparent}
\begin{document}
\begin{frame}
\begin{block}{t}
test
\end{block}
%
\pause
\begin{block}{t}
test
\end{block}
\begin{figure}
\includegraphicswithwisibility{<1->}{width = 0.2\textheight}{example-image}
\caption{1}
\end{figure}
\begin{figure}
\includegraphicswithwisibility{<2->}{width = 0.2\textheight}{example-image}
\caption{2}
\end{figure}
\end{frame}
\end{document}
编辑
要使用aobs-tikz
功能,请替换
\usepackage{tikz}
\tikzset{
invisible/.style={opacity=0.3},
visible on/.style={alt=#1{}{invisible}},
alt/.code args={<#1>#2#3}{%
\alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} % \pgfkeysalso doesn't change the path
},
}
和
\usepackage{aobs-tikz}
\tikzset{invisible/.style={opacity=0.3}}
作为aobs-tikz
加载tikz
。但是包将invisible
样式定义为,invisible/.style={opacity=0,text opacity=0}
因此重新定义了样式。