从这个问题继续前进: Animateinline 无法与 \setbeamertemplate{} 配合使用,我把代码修改成了这个MWE(不用回头看前面的问题,留着做参考):
\documentclass{beamer}
\mode<presentation> {
\usetheme{Marburg}
\usecolortheme{beaver}
\setbeamertemplate{navigation symbols}{}
}
\usepackage{tikz}
\usepackage{animate}
\usepackage{pgfplots}
\setbeamertemplate{title page}{%
\begin{animateinline}[autoplay, loop, begin={\begin{tikzpicture}\useasboundingbox (0,0) rectangle (7,7);}, end={\end{tikzpicture}}]{6}
\multiframe{10}{i=1+1}{
\newframe
\node[anchor=south west]
at (0,-4) (anime)
{\includegraphics[trim = 15mm 10mm 10mm 10mm,clip,width=0.5\textwidth]{md-angles-\i}};
}
\end{animateinline}
}
\titlegraphic{\includegraphics[width=3cm]{iitm_logo}}
\title[My Short Title]{My Long Title}
\titlegraphic{\includegraphics[width=3cm]{logo}%
}
\author[{Vishnu}]{Vishnu}
\institute[My Institute]
{
Designation \\
}
\date{}
\begin{document}
\begin{frame}[plain]
\advance\textwidth2cm
\hsize\textwidth
\columnwidth\textwidth
\titlepage
\end{frame}
\end{document}
但是,我收到以下错误:
! LaTeX Error: File 'md-angles-\i' not found.
索引 '\i'multframes
似乎无法转换为值。如何在代码中用 i 的值代替 '\i'?
答案1
\animategraphics
可以放入 Ti钾Z 节点,如果要将由外部文件构建的动画插入幻灯片上的绝对位置。无需\includegraphics
在环境内使用。此外,的裁剪/修剪/调整tikzpicture
大小/缩放/剪辑选项可以与一起使用。\multiframe
animateinline
\includegraphics
\animategraphics
(使用文件序列的示例exp_0.pdf
... exp_8.pdf
)
\documentclass{beamer}
\usepackage{tikz}
\usepackage{animate}
\setbeamertemplate{title page}{%
\begin{tikzpicture}\useasboundingbox (0,0) rectangle (7,7);
\node[anchor=south west] at (3,1) (anime) {
\animategraphics[width=4cm,height=4cm,keepaspectratio,autoplay,loop]{6}{exp_}{0}{8}};
\end{tikzpicture}
% \begin{animateinline}[
% autoplay, loop,
% begin={\begin{tikzpicture}\useasboundingbox (0,0) rectangle (7,7);},
% end={\end{tikzpicture}}]{6}
% \multiframe{9}{i=0+1}{
% \node[anchor=south west] at (3,1) (anime) {\includegraphics[width=4cm,height=4cm,keepaspectratio]{exp_\i}};
% }
% \end{animateinline}
}
\begin{document}
\begin{frame}[plain]
\titlepage
\end{frame}
\end{document}