2

I am making a document that includes many audio files. I also need to create an identical version that does not include any audio files. Since I am including hundreds of audio files, it is not ideal to simply remove the audio code. I tried using \usepackage[draft]{media9} but a box still appears with the text 'APlayer.swf'. Is there a way to remove the box or at least the text in draft mode? Or is there another way to easily make a version without the audio files?

Here is the code:

\documentclass[10pt,oneside]{article}
\usepackage[draft]{media9}
\begin{document}

\includemedia[
width=0.3cm,
height=0.3cm,
activate=onclick,
addresource=11.mp3,
transparent=false,
flashvars={source=11.mp3}
]{}{APlayer.swf}

\end{document}

Below is a screenshot of the box and text that I would like to remove:

draft mode box and text

  • Could you redefine the \includemedia command in your preamble so it provides no output? Then simply comment out to enable the standard behaviour. – penguinpreferred Dec 2 '14 at 23:44
  • I tried adding \renewcommand{\includemedia}{} to the preamble but then '[ width=0.3cm, height=0.3cm, activate=onclick, addresource=rec2/Rec2-11.mp3, transparent=false,flashvars= source=rec2/Rec2-11.mp3 ] APlayer.swf' appears in the pdf. – Brad Dec 2 '14 at 23:58
  • It would also be nice if the text box were still there but just transparent so that the text spacing and layout is the same as the one with the audio. – Brad Dec 3 '14 at 0:02
2
\documentclass[10pt,oneside]{article}
\usepackage[draft]{media9}
\let\oldincludemedia\includemedia
\renewcommand\includemedia[3][]{%
  \leavevmode\phantom{\oldincludemedia[#1]{#2}{#3}}}
\begin{document}

aaa\includemedia[
width=0.3cm,
height=0.3cm,
activate=onclick,
addresource=11.mp3,
transparent=false,
flashvars={source=11.mp3}
]{}{APlayer.swf}bbb

\end{document}

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.