11

I am trying to learn the animate package. While I was trying to compile some example codes, I always run into the problem that

**LaTex Error: File `ocgbase.sty' not found.** 

I am using Miktex 2.9, and it installed the animate package automatically. I have Windows 7 Enterprise as OS.

Can any one tell me how I can fix the problem?

This is the file that I was trying to compile:

\documentclass{article}
\usepackage{animate}
\usepackage{media9}
\usepackage{graphicx}
\begin{filecontents}{timeline.txt}
::0x0 % coordinate system & y=e^x, repeated until last frame
::1 % one blue curve per frame
::2
::3
::4
::5
::6
::7
::8
\end{filecontents}
\begin{document}
    \begin{center}
        \animategraphics[
        label=taylor,
        controls, loop,
        timeline=timeline.txt
        ]{4}{exp_}{0}{8}
        \mediabutton[
        jsaction={
        if(anim[’taylor’].isPlaying)
            anim[’taylor’].pause();
        else
            anim[’taylor’].playFwd();
        }
        ]{\fbox{Play/Pause}}
    \end{center}
\end{document}
sajid
  • 197
  • miktex installed the file on my system without problem. Probably your package databases are not up-to-date. Start the package managers (user and admin) and synchronize. See http://tex.stackexchange.com/questions/108447/how-should-one-maintain-and-update-a-miktex-installation/108490#108490 – Ulrike Fischer Nov 11 '15 at 17:51

2 Answers2

9

Installing package ocgx2 will fix the problem. (As ocgbase.sty is part of the ocgx2 package, as referenced here.)

2

Yes Installing ocgx2 solved the problem for me.

Details: I got the same error when I was using the "animate" package. Then I checked my installed packages where I saw the package "ocgx2" is not installed. (not only that many packages were not upto date.) ocgx2 not installed

So to be on the safe side I updated all my packages, now everything runs smoothly. Updating all packages will not only solve the current issue but also the possible future issues as well :D ...

Note: I use MacOS and the way we update packages are through TexLive. There should be a way to update packages in the setup you use in Windows as well.

ranga
  • 21