如同这个答案,我正在 TikZ 环境中嵌入视频。我还启用了外部化,即除了主 pdf 之外,我还得到了另一个只包含此 tikz 图片的 pdf。是否可以将此 pdf 嵌入另一个 beamer 文件中,以便视频也在新文件中播放?如果可以,我该怎么做?
梅威瑟:
图形.tex
\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{media9}
\usepackage{tikz}
\usetikzlibrary{shapes, arrows, positioning, calc, external}
\tikzexternalize[prefix=figures/]
% --------------------------- TikZ blocks - Start --------------------------------%
\tikzstyle{process} = [rectangle, rounded corners, minimum width=2.5cm, minimum height=1cm, text centered, text width=2cm, fill=orange!30]
\tikzstyle{arrow} = [thick,->,>=stealth]
% --------------------------- TikZ blocks - End --------------------------------%
\begin{document}
\tikzsetnextfilename{Video_PDF}
\begin{tikzpicture}[node distance=2cm]
\draw [arrow] (-2,0) -- (2,0);
\draw [arrow] (0,-2) -- (0,2);
\node [align=center] at (3,0) {X-axis};
\node [align=center] at (0,2.5) {Y-axis};
\node at (1,1) {\includemedia[
width=2cm,
height=1.5cm,
activate=pageopen,
addresource=../../../videos/video1.mp4,
flashvars={
source=../../../videos/video1.mp4
&autoPlay=true
&loop=true
},
passcontext, transparent
]{}{VPlayer.swf}};
\node at (-1,1) {\includegraphics[width=2cm]{../../../others/figures/powerpoint/Image2.png}};
\node at (-1,-1) {\includegraphics[width=2cm]{../../../others/figures/powerpoint/Image3.png}};
\node at (1,-1) {\includegraphics[width=2cm]{../../../others/figures/powerpoint/Image4.png}};
\end{tikzpicture}
\end{document}
我尝试将生成的 PDF 嵌入为图像和视频,但都没有成功
主文本:
\documentclass[t]{beamer}
\setbeamertemplate{caption}[numbered]
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{media9}
\usepackage{xcolor}
\begin{document}
\begin{frame}
\frametitle{Embedding as an image}
\begin{center}
\includegraphics[width=\linewidth]{./res/videos/Video_PDF.pdf}
\end{center}
\end{frame}
\begin{frame}
\frametitle{Embedding as a video}
\begin{center}
\includemedia[
width=5cm,
height=5cm,
activate=pageopen,
addresource=./res/videos/Video_PDF.pdf,
flashvars={
source=./res/videos/Video_PDF.pdf
&autoPlay=true
&loop=true
},
passcontext,
transparent,
]{}{VPlayer.swf}%
\end{center}
\end{frame}
\end{document}
在我的 Video_PDF.pdf 文件中,我可以看到视频正在播放。但在我的 Main.tex 文件中,视频无法播放。当我将 pdf 嵌入为图像时,播放按钮与其他图像一起显示在视频的位置。当我将 pdf 嵌入为视频时,什么都看不到。