4

I've tried to include a second U3D model to my document and got the following error:

! LaTeX error: "kernel/command-already-defined"
! 
! Control sequence \l_mix_vfile_stream already defined.

The (minimal) code to include the models is:

% COMPILED WITH PDF LATEX
% USING THE UP-TO-DATE VERSIONS OF media9 AND l3kernel
\documentclass[ a4paper, 11pt, twoside, openleft ]{book}
\usepackage[dvipdfmx]{media9}

\begin{document}
% Include model1
\includemedia[%
activate=onclick,%
deactivate=pageinvisible,%
3Dviews=model1.vws]{}%
{model1.u3d}% Binary file
% Include model2
\includemedia[%
activate=onclick,%
deactivate=pageinvisible,%
3Dviews=model2.vws]{}%
{model2.u3d}% Binary file
\end{document}

.u3d files are binary and the .vws looks like:

% modelX.vws - Nothing special here.
VIEW=MATLABfig
COO=0.35        0.35        0.05
C2C=3.8613     -4.3644       1.671
ROO=0.596
ROLL=0
ORTHO=0.83893

PART=Mesh1
    RENDERMODE=SolidWireframe
END

PART=Mesh2
    RENDERMODE=SolidWireframe
END
END

The error disappears if I remove the 3Dviews options from one of them. But then I cannot configure the rendering of one model (transparency, light, etc).

I'm not familiar to the internals of latex, but looking at media9.sty it is clear that the command

\l_mix_vfile_stream

is used to open/close the .vws file.

Is this a bug from media9? or from latex 3?

Felipe
  • 41
  • could you make the sequences available for others? In that way we can test it. Moreover, try and include a full MWE so that we exactly can see your used packages etc. :) – nickpapior Sep 28 '12 at 20:56
  • 1
    Completed the MWE. The .u3d files are binaries, so you will have to create somme dummy one to test it. – Felipe Sep 28 '12 at 21:58
  • 2
    It seems like a bug in media9: the declaration \ior_new:N\l_mix_vfile_stream should go outside the definition of \includemedia. – egreg Sep 28 '12 at 22:00
  • I'm not familiar with the syntax, but I will try to move it out. I'll keep you posted. – Felipe Sep 28 '12 at 23:34
  • Moving the declaration to line 98 did the work for me! Thanks. We should file a bug to the maintainer. – Felipe Sep 29 '12 at 00:03
  • @egreg: Thanks for figuring out! Indeed, it is a bug. – AlexG Oct 04 '12 at 09:17
  • @AlexG: It seems that this is fixed in the package now, so I am voting to close. – cyberSingularity Jan 06 '13 at 13:38

0 Answers0