I am trying to embed a video in a beamer presentation. I am using the media9 package. I get the following error message:

! You can't use `\dimexpr' in restricted horizontal mode.
<argument> \dimexpr 

l.62 \end{frame}


Others posts have recommended to update the packages, which I did. The versions of my softwares are the following: WinEdt v7.1; MiKTex v2.9.4533; media9 v0.43 (2014-04-07)

I run Latex -> dvi2ps -> ps2pdf

The error occurs for the following command line: latex.exe --src --interaction=errorstopmode --synctex=-1 "test.tex"

And a minimal code is






The *File List* section in the *.log file is:

 *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
  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)
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
 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
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
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)
 nameref.sty    2012/10/27 v2.43 Cross-referencing by name of section
gettitlestring.sty    2010/12/03 v1.4 Cleanup title references (HO)
image_acquisition.eps    Graphic file (type eps)
  • Please, further reduce your example to the bare minimum. That is, nothing more than \documentclass{beamer} and \usepackage{media9} in the preamble. – AlexG Apr 19 '14 at 11:31
  • Would you please remove the theme loading command and add \listfiles as the very first line. Try to compile again, open the *.log file, go to the *File List* section and insert the list content as another code box into your question body. – AlexG Apr 22 '14 at 6:49
  • I used TeXLive-2013 and MiKTeX-2.9, both updated today. No problem with the compilation here. – AlexG Apr 22 '14 at 13:43
  • Alex, I edited my *.tex file as you recommended and compiled. Unfortunately, there is no *File List* section in the *.log file. Is it because the compilation is unsuccessful? – Jerome Apr 22 '14 at 22:14
  • In regard to your second comment, I have the same version of MiKTeX as you. Maybe that I can try updating WinEdt to the latest version. – Jerome Apr 22 '14 at 22:16

This answer is a bit generic. Try to run this code and see if it works because you have already updated your packages, so just see if this works:



%% Video stuff


%%% Start of the presentation
\title{Adding video in a beamer presentation}
\author{By \myurlshort{http://biostat.jhsph.edu/~lcollado/}{L Collado-Torres}}
December 5th, 2012





  \frametitle{You might want to check}
  \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.


  \frametitle{Youtube video}
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

    \frametitle{What you need for media9}
Basically, the newest version of texlive and a new version of Acrobat Reader (above 9 something).

  • Subham Soni, I run into the exact same error when compiling your code. – Jerome Apr 23 '14 at 17:06
  • It complies perfectly in my machine.. Try running tlmgr update self then tlmgr update all. That should work – subham soni Apr 23 '14 at 17:08

Any update of MikTeX as described above did not solve my problem.

So I ended completely uninstalling MikTeX from my machine, downloading the latest version from http://miktex.org/download and reinstalling it (I effectively updated it from version 2.9.4533 to version 2.9.5105). And now, my problem is resolved.

Thanks to Subham and AlexG for proving to me that there was an issue with the version of MikTeX.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.