[OS X TeX] embedding quicktime movies in LaTeX

Bruno Voisin bvoisin at mac.com
Mon Mar 29 08:14:00 EST 2004


Le 27 mars 04, à 16:02, Luis Sequeira a écrit :

> I am preparing a talk using the Prosper LaTeX document class, and I  
> would like to add some quicktime movies to it. I have googled around  
> and looked at some faqs, but came out empty.
> I do remember having a little template file that had an example of how  
> to do this, but it was a while ago and cannot find it in my hard  
> drive.
>
> Can someone point me in the right direction?

Trying different search strategies in Mail, there seems to have been  
different threads on this since early 2002:

- First one post, which gave an almost satisfactory solution (the only  
answer to this post involved ConTeXt, not prosper).

> De: Guido Mocken
> Date: 10 janvier 2002 17:10:28 GMT+01:00
> À: "TeX on Mac OS X Mailing List"
> Objet: [Mac OS X TeX] how to embed movies in a presentation?
>
> I would like to create a presentation using LaTeX and the "prosper"
> package. I'm using tetex, dvips and finally ps2pdf to create a PDF that
> is suitable for Acrobat Reader. Now, I want couple of quicktime movies
> to appear on some of the slides.
>
> Browsing through Adobe's PDF-Reference, the web, several newsgroups,  
> and
> other forums, I have found the following piece of code - which *almost*
> does the trick:
>
> \special{!
> [
> /Type /Annot
> /Subtype /Movie
> /Rect [ 200 600 440 790 ]
> /Movie
> << /F (My_Movie.mov) /Aspect [ 190 240 ] /Poster true /Rotate 0 >>
> /A
> << /ShowControls true /Volume 0.1 /Mode /Once /Rate 1.0 >>
> /ANN pdfmark
> }
>
> The only problem with this code is that all my movies appear on the
> very first slide - not on the pages where they are supposed to be.
>
> Can anyone give me a hint on how to correct for that?
> (I know a working solution for pdftex - "\pdfannot"-  but  
> unfortunately, I cannot use
> pdftex in this case, because the "prosper" package does not work in  
> pdftex.)

- Then later the same solution again, modified but still requiring  
pdfTeX:

> De: Gérard Degrez
> Date: 5 février 2002 18:00:53 GMT+01:00
> À: "TeX on Mac OS X Mailing List"
> Objet: Rép : [Mac OS X TeX] pdf presentations
>
>> Speaking of presentations: I'm still looking for a way to ...
>>
>> [...]
>>
>> - include quicktime movies in presentations created by LaTeX/prosper  
>> (not pdfTeX)
>
> Why not pdftex? It's so easy (once you know):
> \begin{center}
> \begin{picture}(320,158)
> \put(0,79){\pdfannot width 320pt height 79pt depth 79 pt
> {/Subtype /Movie%
> /Title (Vorticity)%
> /Movie << /F (re3900-persp-2.avi) /Poster true >>%
> /A << /Mode /Repeat >>}
> }
> \end{picture}
> \end{center}
>
> "/Poster true" and "/Mode /Repeat" are optional. The dimensions depend  
> on the specific movie.

and or not requiring it:

> De: Mark Moll
> Date: 5 février 2002 18:04:41 GMT+01:00
> À: "TeX on Mac OS X Mailing List"
> Objet: Rép : [Mac OS X TeX] pdf presentations
>
>>>> On Tue, 5 Feb 2002 17:42:11 +0100, Guido Mocken (GM) wrote:
> GM> Speaking of presentations: I'm still looking for a way to ...
> GM> - include quicktime movies in presentations created by  
> LaTeX/prosper (not
> GM> pdfTeX)
>
> Put these two movie macros in the preamble of your document:
>
> \makeatletter
> \define at key{PDF}{Movie}{\pdf at addtoks{#1}{Movie}}
> \define at key{PDF}{Activation}{\pdf at addtoks{#1}{Activation}}
> \newcommand{\moviewithpreview}[3]{% args: width, preview, movie
>    \pdfmark[{\includegraphics[width=#1]{#2}}]{%
>    pdfmark=/ANN,Subtype=/Movie,Movie=<< /F (#3) >>,%
>    Activation=<< /ShowControls true /Mode /Repeat >>}}
> \newcommand{\movie}[3]{% args: width, height, movie
>    \pdfmark[{\hbox to #1 {\vbox to #2 { }}}]{%
>    pdfmark=/ANN,Subtype=/Movie,Movie=<< /F (#3) /Poster true >>,%
>    Activation=<< /ShowControls true /Mode /Repeat >>}}
> \makeatother
>
> The Activation part seems to be ignored by Acrobat 5, but hopefully  
> that'll
> be fixed in a future version.

- More recently people have mentioned the easymovie.sty package:

> De: Thomas Schröder
> Date: 6 février 2004 18:23:54 GMT+01:00
> À: TeX on Mac OS X Mailing List
> Objet: [OS X TeX] easymovie.sty
>
> Has anybody tried lately to succesfully use easymovie.sty that was  
> discussed once on this list to include movies? Somehow I can't get it  
> to work with pdflatex. With the latex-dvips-ps2pdf-route it works  
> fine, though.
>
> This is my source file:
>
> ---------------
>
> \documentclass{article}
> \usepackage{easymovie}
> \usepackage{hyperref}
> \begin{document}
>
> Test.
>
> \fbox{\easymovie[poster,once,controls]{\easybox{4in}{4in}}{movie.avi}}
>
> \end{document}
>
> ---------------
>
> [...]
>
> It seems like hyperref doesn't load the definitions of its own file  
> pdfmark.def. When I try something like
>
> \usepackage[pdfmark]{hyperref}
>
> then the dvips driver will be used which doesn't work with pdflatex,  
> obviously. Then I tried using the essential bits of hyperref's  
> pdfmark.def, or even to include the file itself via
>
> \input pdfmark.def
>
> but neither of these methods worked. I've run out of ideas, so, I'd  
> really be grateful for any help :-)

and its extension easymoviex.sty for non-pdfTeX situations:

> De: Constantinos Antoniou
> Date: 6 février 2004 19:00:59 GMT+01:00
> À: TeX on Mac OS X Mailing List
> Objet: Rép : [OS X TeX] easymovie.sty
>
> I had never heard of easymovie, and was very intrigued by your email.  
> A short googling session led me to find easymoviex which apparently is  
> an extension of easymovie that works with pdflatex... (cf.  
> http://www.bas.uni-muenchen.de/Mitarbeiter/tuerk/latexTips/ 
> latexTips.html)

with a fix to be applied:

> De: Ross Moore
> Date: 6 février 2004 20:16:57 GMT+01:00
> À: TeX on Mac OS X Mailing List
> Objet: Rép : [OS X TeX] easymovie.sty
>
> On 06/02/2004, at 9:23 AM, Thomas Schröder wrote:
>
>> ! Undefined control sequence.
>> \@easymovie ...clear \setkeys {easy}{#1}{\pdfmark
>>                                                    
>> [#2]{pdfmark=/ANN,Subtype=...
>> l.8 ...e,controls]{\easybox{4in}{4in}}{movie.avi}}
>>
>> ? x
>> No pages of output.
>> Transcript written on test2.log.
>
> This is for the pdfmark technique of embedding PDF within PostScript
> (within .dvi produced by TeX).
>
> pdftex (and hence pdflatex) constructs PDF directly, so  pdfmark  is  
> not
> applicable.  It uses more direct means.
>
>> It seems like hyperref doesn't load the definitions of its own file  
>> pdfmark.def. When I try something like
>>
>> \usepackage[pdfmark]{hyperref}
>>
>> then the dvips driver will be used which doesn't work with pdflatex,  
>> obviously. Then I tried using the essential bits of hyperref's  
>> pdfmark.def, or even to include the file itself via
>>
>> \input pdfmark.def
>>
>> but neither of these methods worked. I've run out of ideas, so, I'd  
>> really be grateful for any help :-)
>
> The above explanation should help you understand why this gave no joy.
>
> The  easymoviex.sty  package copes with *both* situations,
> however there is a bug in its detection method.
> This is easily patched, as follows:
>
> %%%%%
> %%%%% Autodetect pdftex
> \newif\ifpdf
> \ifx\pdfoutput\undefined
>    \pdffalse % we are not running PDFLaTeX
> \else
>   \ifnum\pdfoutput=0
>    \pdffalse % we are running PDFLaTeX but generating dvi
>   \else
>    \pdftrue % we are running PDFLaTeX for PDF
> \fi \fi
> %%%%%%
>
> Use the above (which detects 3 alternatives) to replace block
> in  easymovie.sty  that assumes only 2 cases are possible.

Hope this helps,

Bruno Voisin
-----------------------------------------------------
Please see <http://www.esm.psu.edu/mac-tex/> for list
guidelines, information, and LaTeX/TeX resources.





More information about the MacOSX-TeX mailing list