我正在尝试在演示文稿中嵌入视频beamer
。我正在使用该media9
包。我收到以下错误消息:
! You can't use `\dimexpr' in restricted horizontal mode.
<argument> \dimexpr
l.62 \end{frame}
?
其他帖子建议更新软件包,我照做了。我的软件版本如下:WinEdt v7.1;MiKTex v2.9.4533;media9 v0.43(2014-04-07)
我跑Latex -> dvi2ps -> ps2pdf
以下命令行发生错误:latex.exe --src --interaction=errorstopmode --synctex=-1 "test.tex"
最小代码如下
\nonstopmode
\listfiles
\documentclass[hyperref={pdfpagelabels=false},dvips]{beamer}
\usepackage{graphicx}
\usepackage{media9}
\begin{document}
\begin{frame}
\frametitle{Title}
\framesubtitle{Sub-title}
\begin{center}
\includemedia[activate=onclick,width=0.75\textwidth]{\includegraphics{figs_defense/image_acquisition.eps}}{figs_defense/image_acquisition.swf}
\end{center}
\end{frame}
\end{document}
*File List*
该文件中的部分内容*.log
如下:
*File List*
beamer.cls 2013/12/02 3.33 A class for typesetting presentations (rcs-revi
sion 332bfd3ce558)
beamerbasercs.sty 2013/12/25 (rcs-revision 31cc758a62ae)
beamerbasemodes.sty 2013/09/03 (rcs-revision 768f2d98ca64)
beamerbasedecode.sty 2010/05/01 (rcs-revision efa082c6111d)
ifpdf.sty 2011/01/30 v2.3 Provides the ifpdf switch (HO)
beamerbaseoptions.sty 2013/03/10 (rcs-revision 47431932db0d)
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
geometry.sty 2010/09/12 v5.6 Page Geometry
ifvtex.sty 2010/03/01 v1.5 Detect VTeX and its facilities (HO)
ifxetex.sty 2010/09/12 v0.6 Provides ifxetex conditional
geometry.cfg
size11.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
pgfcore.sty 2010/04/11 v2.10 (rcs-revision 1.7)
graphicx.sty 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
trig.sty 1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg 2007/01/18 v1.5 graphics configuration of teTeX/TeXLive
dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
pgfsys.sty 2010/06/30 v2.10 (rcs-revision 1.37)
pgfrcs.sty 2010/10/25 v2.10 (rcs-revision 1.24)
everyshi.sty 2001/05/15 v3.00 EveryShipout Package (MS)
pgfrcs.code.tex
pgfsys.code.tex
pgfsyssoftpath.code.tex 2008/07/18 (rcs-revision 1.7)
pgfsysprotocol.code.tex 2006/10/16 (rcs-revision 1.4)
xcolor.sty 2007/01/21 v2.11 LaTeX color extensions (UK)
color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
pgfcore.code.tex
xxcolor.sty 2003/10/24 ver 0.1
atbegshi.sty 2011/10/05 v1.16 At begin shipout hook (HO)
infwarerr.sty 2010/04/08 v1.3 Providing info/warning/error messages (HO)
ltxcmds.sty 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
hyperref.sty 2012/11/06 v6.83m Hypertext links for LaTeX
hobsub-hyperref.sty 2012/04/25 v1.12 Bundle oberdiek, subset hyperref (HO)
hobsub-generic.sty 2012/04/25 v1.12 Bundle oberdiek, subset generic (HO)
hobsub.sty 2012/04/25 v1.12 Construct package bundles (HO)
ifluatex.sty 2010/03/01 v1.3 Provides the ifluatex switch (HO)
intcalc.sty 2007/09/27 v1.1 Expandable calculations with integers (HO)
etexcmds.sty 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
kvsetkeys.sty 2012/04/25 v1.16 Key value parser (HO)
kvdefinekeys.sty 2011/04/07 v1.3 Define keys (HO)
pdftexcmds.sty 2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
pdfescape.sty 2011/11/25 v1.13 Implements pdfTeX's escape features (HO)
bigintcalc.sty 2012/04/08 v1.3 Expandable calculations on big integers (HO)
bitset.sty 2011/01/30 v1.1 Handle bit-vector datatype (HO)
uniquecounter.sty 2011/01/30 v1.2 Provide unlimited unique counter (HO)
letltxmacro.sty 2010/09/02 v1.4 Let assignment for LaTeX macros (HO)
hopatch.sty 2011/06/24 v1.1 Wrapper for package hooks (HO)
xcolor-patch.sty 2011/01/30 xcolor patch
atveryend.sty 2011/06/30 v1.8 Hooks at the very end of document (HO)
refcount.sty 2011/10/16 v3.4 Data extraction from label references (HO)
hycolor.sty 2011/01/30 v1.7 Color options for hyperref/bookmark (HO)
auxhook.sty 2011/03/04 v1.3 Hooks for auxiliary files (HO)
kvoptions.sty 2011/06/30 v3.11 Key value format for package options (HO)
pd1enc.def 2012/11/06 v6.83m Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive
url.sty 2013/09/16 ver 3.4 Verb mode for urls, etc.
hdvips.def 2012/11/06 v6.83m Hyperref driver for dvips
pdfmark.def 2012/11/06 v6.83m Hyperref definitions for pdfmark specials
rerunfilecheck.sty 2011/04/15 v1.7 Rerun checks for auxiliary files (HO)
beamerbaserequires.sty 2010/05/01 (rcs-revision efa082c6111d)
beamerbasecompatibility.sty 2012/05/01 (rcs-revision 67c48b3b652d)
beamerbasefont.sty 2013/10/18 (rcs-revision 72f39e01808a)
amssymb.sty 2013/01/14 v3.01 AMS font symbols
amsfonts.sty 2013/01/14 v3.01 Basic AMSFonts support
sansmathaccent.sty 2013/03/28
filehook.sty 2011/10/12 v0.5d Hooks for input files
beamerbasetranslator.sty 2010/06/11 (rcs-revision 85fd1cc7fc42)
translator.sty 2010/06/12 ver 1.10
translator-language-mappings.tex
beamerbasemisc.sty 2013/09/03 (rcs-revision a55719c41d85)
beamerbasetwoscreens.sty 2010/05/01 (rcs-revision efa082c6111d)
beamerbaseoverlay.sty 2013/12/25 (rcs-revision f6bd5e3805da)
beamerbasetitle.sty 2010/09/21 (rcs-revision f0446ed0b6ae)
beamerbasesection.sty 2013/06/07 (rcs-revision 60b9fe0f342f)
beamerbaseframe.sty 2013/10/02 (rcs-revision cdc8e9a3aaac)
beamerbaseverbatim.sty 2012/08/30 (rcs-revision dfdb135076b3)
beamerbaseframesize.sty 2011/09/12 (rcs-revision 70f9d8411e54)
beamerbaseframecomponents.sty 2013/10/18 (rcs-revision 5cf6c5555a45)
beamerbasecolor.sty 2010/06/06 (rcs-revision d1a9b48be06d)
beamerbasenotes.sty 2012/12/19 (rcs-revision 1686da3db3c9)
beamerbasetoc.sty 2013/05/23 (rcs-revision 0fdf5bc43be8)
beamerbasetemplates.sty 2010/05/01 (rcs-revision efa082c6111d)
beamerbaseauxtemplates.sty 2013/09/04 (rcs-revision 4ac715c499d0)
beamerbaseboxes.sty 2012/05/13 (rcs-revision 56972908a390)
beamerbaselocalstructure.sty 2013/09/04 (rcs-revision 4ac715c499d0)
enumerate.sty 1999/03/05 v3.00 enumerate extensions (DPC)
beamerbasenavigation.sty 2013/10/05 (rcs-revision 62be157fe783)
beamerbasetheorems.sty 2010/06/06 (rcs-revision 7e7cc5e53e9d)
amsmath.sty 2013/01/14 v2.14 AMS math features
amstext.sty 2000/06/29 v2.01
amsgen.sty 1999/11/30 v2.0
amsbsy.sty 1999/11/29 v1.2d
amsopn.sty 1999/12/14 v2.01 operator names
amsthm.sty 2004/08/06 v2.20
beamerbasethemes.sty 2010/05/01 (rcs-revision efa082c6111d)
beamerthemedefault.sty 2010/06/17 (rcs-revision d02a7cf4d8ae)
beamerfontthemedefault.sty 2012/12/19 (rcs-revision 1686da3db3c9)
beamercolorthemedefault.sty 2012/12/19 (rcs-revision 1686da3db3c9)
beamerinnerthemedefault.sty 2013/10/15 (rcs-revision 65cb471f9634)
beamerouterthemedefault.sty 2012/12/19 (rcs-revision 1686da3db3c9)
media9.sty 2014/03/25 v0.43 acrobat-9/X compatible media
expl3.sty 2014/01/07 v4646 L3 Experimental code bundle wrapper
l3names.sty 2014/01/04 v4640 L3 Namespace for primitives
l3bootstrap.sty 2014/01/04 v4640 L3 Experimental bootstrap code
etex.sty 1998/03/26 v2.0 eTeX basic definition package (PEB)
l3basics.sty 2014/01/04 v4642 L3 Basic definitions
l3expan.sty 2014/01/04 v4642 L3 Argument expansion
l3tl.sty 2013/12/27 v4625 L3 Token lists
l3seq.sty 2013/12/14 v4623 L3 Sequences and stacks
l3int.sty 2013/08/02 v4583 L3 Integers
l3quark.sty 2013/12/14 v4623 L3 Quarks
l3prg.sty 2014/01/04 v4642 L3 Control structures
l3clist.sty 2013/07/28 v4581 L3 Comma separated lists
l3token.sty 2013/08/25 v4587 L3 Experimental token manipulation
l3prop.sty 2013/12/14 v4623 L3 Property lists
l3msg.sty 2013/07/28 v4581 L3 Messages
l3file.sty 2013/10/13 v4596 L3 File and I/O operations
l3skip.sty 2013/07/28 v4581 L3 Dimensions and skips
l3keys.sty 2013/12/08 v4614 L3 Experimental key-value interfaces
l3fp.sty 2014/01/04 v4642 L3 Floating points
l3box.sty 2013/07/28 v4581 L3 Experimental boxes
l3coffins.sty 2013/12/14 v4624 L3 Coffin code layer
l3color.sty 2012/08/29 v4156 L3 Experimental color support
l3luatex.sty 2013/07/28 v4581 L3 Experimental LuaTeX-specific functions
l3candidates.sty 2014/01/06 v4643 L3 Experimental additions to l3kernel
l3regex.sty 2013/12/14 v4623 L3 Experimental regular expressions
l3tl-build.sty 2011/12/08 v3039 L3 Experimental token list construction
l3tl-analysis.sty 2011/12/08 v3039 L3 Experimental token lists analysis
l3str.sty 2013/07/24 v4576 L3 Experimental strings
l3flag.sty 2011/12/08 v3039 L3 Experimental flags
l3str-convert.sty 2013/01/08 v4339 L3 Experimental string encoding conversio
ns
l3keys2e.sty 2013/12/31 v4634 LaTeX2e option processing using LaTeX3 keys
xparse.sty 2013/12/31 v4634 L3 Experimental document command parser
atenddvi.sty 2007/04/17 v1.1 At end DVI hook (HO)
zref-abspage.sty 2012/04/04 v2.24 Module abspage for zref (HO)
zref-base.sty 2012/04/04 v2.24 Module base for zref (HO)
zref-lastpage.sty 2012/04/04 v2.24 Module lastpage for zref (HO)
tikz.sty 2010/10/13 v2.10 (rcs-revision 1.76)
pgf.sty 2008/01/15 v2.10 (rcs-revision 1.12)
pgfcomp-version-0-65.sty 2007/07/03 v2.10 (rcs-revision 1.7)
pgfcomp-version-1-18.sty 2007/07/23 v2.10 (rcs-revision 1.1)
pgffor.sty 2010/03/23 v2.10 (rcs-revision 1.18)
pgfkeys.sty
pgfkeys.code.tex
pgffor.code.tex
tikz.code.tex
nameref.sty 2012/10/27 v2.43 Cross-referencing by name of section
gettitlestring.sty 2010/12/03 v1.4 Cleanup title references (HO)
test.out
test.out
translator-basic-dictionary-English.dict
translator-bibliography-dictionary-English.dict
translator-environment-dictionary-English.dict
translator-months-dictionary-English.dict
translator-numbers-dictionary-English.dict
translator-theorem-dictionary-English.dict
image_acquisition.eps Graphic file (type eps)
***********
答案1
这个答案有点笼统。尝试运行此代码,看看它是否有效,因为您已经更新了软件包,因此只需看看它是否有效:
\documentclass[aspectratio=169]{beamer}
\usetheme{CambridgeUS}
\usepackage{color}
\usepackage{amsfonts}
\usepackage{comment}
\usepackage{moreverb}
%% Video stuff
\usepackage{media9}
\newcommand{\myurlshort}[2]{\href{#1}{\textcolor{gray}{\textsf{#2}}}}
%%% Start of the presentation
\title{Adding video in a beamer presentation}
\author{By \myurlshort{http://biostat.jhsph.edu/~lcollado/}{L Collado-Torres}}
\date{
December 5th, 2012
}
\begin{document}
\begin{frame}[allowframebreaks]
\titlepage
\end{frame}
\begin{frame}[allowframebreaks]
\tableofcontents
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Sources}
\begin{frame}
\frametitle{You might want to check}
\begin{itemize}
\item \myurlshort{http://pages.uoregon.edu/noeckel/PDFmovie.html}{PDF with animations} is a great post that ultimately points you to media9.
\item \myurlshort{http://www.ctan.org/tex-archive/macros/latex/contrib/media9/}{media9 CTAN page}
\item \myurlshort{http://ctan.mirrorcatalogs.com/macros/latex/contrib/media9/doc/media9.pdf}{media9 manual}: open it with Acrobat to see all the nice things.
\item \myurlshort{http://makarandtapaswi.wordpress.com/2009/07/10/movie-package-movie15/}{Post about using movie15}: note that movie15 is deprecated.
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Test}
\begin{frame}
\frametitle{Youtube video}
\includemedia[
width=7.11cm,height=4cm,
activate=onclick,
flashvars={
modestbranding=1 % no YT logo in control bar
&autohide=1 % controlbar autohide
&showinfo=0 % no title and other info before start
&rel=0 % no related videos after end
},
url % Flash loaded from URL
]{}{http://www.youtube.com/v/9bZkp7q19f0?rel=0}
\end{frame}
\begin{frame}
\frametitle{What you need for media9}
Basically, the newest version of texlive and a new version of Acrobat Reader (above 9 something).
\end{frame}
\end{document}
答案2
如上所述的任何更新MikTeX
都无法解决我的问题。
所以我彻底卸载了MikTeX
我的电脑,并从http://miktex.org/download并重新安装它(我有效地将其从版本 2.9.4533 更新到版本 2.9.5105)。现在,我的问题解决了。
感谢 Subham 和 AlexG 向我证明 MikTeX 的版本存在问题。