# file compiles OK in Texlive, but error in MikTex. Using animate package. Why?

Using TL 2017, this MWE compiles OK with no error

This is LuaTeX, Version 1.0.4 (TeX Live 2017)


MWE below. I have some .png files which I am trying to make animation with using the animate package. It works OK on TL 2017 but will not compile under MiKtex on windows 7.

\documentclass{article}
\usepackage{animate}
\usepackage{graphicx}
\begin{document}

\begin{center}
\animategraphics[controls,width=\textwidth]{1}{r}{1}{41}
\end{center}

\end{document}


But under Miktex

        This is LuaTeX, Version 1.07.0 (MiKTeX 2.9.6600 64-bit)


it gives this error

(C:/Users/me/AppData/Roaming/MiKTeX/2.9/tex/latex/l3packages/l3keys2e/l3keys2e.
sty)) ("C:/Program Files/MiKTeX 2.9/tex/latex/ocgx2/ocgbase.sty")
(C:/Users/me/AppData/Roaming/MiKTeX/2.9/tex/context/base/supp-pdf.mkii
)) ("C:/Program Files/MiKTeX 2.9/tex/latex/graphics/graphicx.sty") (./foo.aux)
("C:/Program Files/MiKTeX 2.9/tex/latex/oberdiek/epstopdf-base.sty"
("C:/Program Files/MiKTeX 2.9/tex/latex/oberdiek/grfext.sty")
("C:/Program Files/MiKTeX 2.9/tex/latex/oberdiek/kvoptions.sty"))
! Undefined control sequence.
\@anim@xform #1#2#3->\pbs_pdfxform:nnn
{#1}{#2}{#3}\xdef \@anim@lastxform {\...

l.7 ...phics[controls,width=\textwidth]{1}{r}{1}{41}

?


looking at the foo.log file, I see this

("C:/Program Files/MiKTeX 2.9/tex/latex/oberdiek/grfext.sty"
Package: grfext 2016/05/16 v1.2 Manage graphics extensions (HO)
)
("C:/Program Files/MiKTeX 2.9/tex/latex/oberdiek/kvoptions.sty"
Package: kvoptions 2016/05/16 v3.12 Key value format for package options (HO)
)
Package epstopdf-base Info: Redefining graphics rule for .eps' on input line 43
8.
Package grfext Info: Graphics extension search list:
(grfext)             [.pdf,.png,.jpg,.mps,.jpeg,.jbig2,.jb2,.PDF,.PNG,.JPG,.JPEG
,.JBIG2,.JB2,.eps]
(grfext)             \AppendGraphicsExtensions on input line 456.
)
! Undefined control sequence.
\@anim@xform #1#2#3->\pbs_pdfxform:nnn
{#1}{#2}{#3}\xdef \@anim@lastxform {\...
l.9 ...phics[controls,width=\textwidth]{1}{r}{1}{41}

? X


I put the zip file with the above file and all the images needed to run the file on my site. frame.zip

Unzipping the file will create a folder called frames/ which has the latex file and 41 png images. I tried lualatex foo.tex and also pdflatex foo.tex and both work OK on TL 2017 but fail on Miktex. any additional information needed? I tried to get \listfiles from miktex, but since it give compile error, I do not see such a list generated. I wante to find out what version of the animate package miktex is using and compare it to TL.

• Easy way to find out which package version, if the program cannot do it: Dig into the texmf folder, find the *.sty file, and look at it in a plain text editor. Also: Be sure that you do not have a conflicting file in your texmf-local.
– user139954
Apr 23, 2018 at 4:44
• @nasser Certainly too old file animate.sty. \pbs_pdfxform:nnn changed to \pbs_pdfxform:nnnn in version 2017/03/16. Acc. to miktex.org/packages the package is current on their server. Maybe there is some old animate.sty lying around. Try kpsewhich animate.sty from within your working directory. If it is the expected, installed file, update the package database and run the package manager afterwards to update MiKTeX. Apr 23, 2018 at 7:20
• @AlexG Thanks., I actually installed animate using package manager for miktex. I also did full Update. Still get the error. kpsewhich finds only one animate.sty file. In C:\Users\me\AppData\Roaming\MiKTeX\2.9\tex\latex\animate But how do I find its version? It has this \NeedsTeXFormat{LaTeX2e} \def\@anim@version{2016/06/08} This is all confusing. But it works ok in TL 2017. may be miktex packages are not updated? Apr 23, 2018 at 7:40
• \def\@anim@version{2016/06/08} is definitely too old. miktex.org/packages/animate says: "Packaged on: 3/1/2018 9:11:04 PM". I guess it's the 2018/02/28 version from CTAN they mean. Apr 23, 2018 at 8:08
• You have a multiuser installation and animate is in your user profile. Did you check for updates as user? (My animate version is newer, 2018/02/28, so miktex certainly has it). Apr 23, 2018 at 8:57

I think I'll expand my earlier comment into an answer. The OP already diagnosed the problem, but was mystified as to why. Perhaps this is a frequent problem for MikTeX users, given the large number of related questions that appear here. So, let's talk about Windows (7 or later):

When you install a program (not just MikTeX), you normally get a system alert, asking you whether or not you wish to make changes to your system. That's the Windows way of doing "sudo" in Linux, more or less, except that you normally don't need a password.

If you agree, then the program is installed to either C:\Program Files or to C:\Program Files (x86) depending on its architecture.

The installed program has its own default, system-wide settings. They will usually be installed alongside the program in the same folder. Or (not sure whether this began with Windows 7 or a later version) the system-wide setting may be installed in C:\ProgramData.

All of the above locations require super-user (admin) privilege to make changes. For example, if you enter one of those folders, and attempt to change some plain-text settings in a text editor, you will get a system alert. Again, this is like Linux "sudo". It does not matter if you are logged in as the default user (who always is admin). Similar behavior on Linux.

For user-specific program data, often including a basic set of data created at program install, a new folder is created somewhere in your User\Yourself home folder. In that location, admin privileges are not required. You can change things there, without getting the system alert. Again, Linux works the same way, with your user home folder.

The canonical location for user program data is in the user's AppData\Roaming folder. This folder is normally hidden, but can be revealed. The Linux equivalent is ~/.local. Just as with Linux, the user's data may be in the canonical location, or in some non-canonical location within the user home folder. All that's really necessary is that the program knows where to find its own data.

In TeX, the user may place data in a location customarily named texmf-local. Anything there will over-ride system settings, custimarily found in texmf or texmf-dist folders.

It seems that with MikTeX, the user's own settings are placed in AppData\Roaming\MikTeX, which is a very good place for them to be. That's the texmf-local. But that's only non-admin settings. Any admin settings are placed alongside the program itself.

Thus, if you ever do a non-admin install or update, some material will be in AppData\Roaming and will over-ride admin data held in the program folder. If the roaming data is older, then an admin update will be ineffective.

A problem can arise if you had MikTeX in the past, then uninstalled it, leaving its AppData\Roaming\MikTeX folder behind. That residual data may over-ride a new installation. The solution: If you uninstall, then be sure to get rid of the roaming data. I'd also use a program such as CCleaner to get rid of stray registry entries.

When I use MikTeX, I use a portable installation. All of the settings are in one place, and thus do not contradict each other. No admin install. Best of all, I can occasionally ZIP the whole thing, and keep the ZIP for restoring all of MikTeX to an earlier time.

• ugh... so many people are talking about this mobile version of miktex, that I am considering to get into that business myself. I have a thesis to write, for heck's sake! Apr 25, 2018 at 10:09
• @thymaro The portable version has never failed for me. And, I can put it on a USB.
– user139954
Apr 25, 2018 at 14:20

I found the problem, but I can't explain it.

This is screen shot of the animate.sty files found on my C:\ drive when I did the search.

The whole windows setup is all messed up with Miktex. There are files in places called AppData\Roaming\MiKTeX\2.9 and also files in C:\Program Files\MiKTeX 2.9.

The animate.sty in the Roaming folder was OLD. 2 years old. but this is the file that kpsewhich sees. So I deleted the whole animate folder from Roaming.

Now it compiles OK. What a big mess. I had no idea why there are duplicates old files there and what this Roaming doing there. This is a single user PC running windows 7. I did do Miktex update, as admin as well. So I assumed I was using latest animate package.

This is why I use Linux and TeXLive for latex. Much more clean environment.

• Your AppData\Roaming (hidden by default) is where Windows places most user-specific program settings that do not require admin privileges. However, if settings are changed using admin privileges, they are likely to be placed in the Program folder, or in Program Data, which are not user-specific. I do not advise ever installing a program in admin mode, but if you do, then there will always be problems if you change (or update) sometimes as admin, sometimes not. The AppData\Roaming is like a hidden texmf-local`. For this reason I always suggest portable programs, which never use admin.
– user139954
Apr 23, 2018 at 18:20
• You might want to consider installing a portable version of MiKTeX. Word goes that "[a]ll of the settings are in one place, and thus do not contradict each other" ( @RobtAll ). Sounds very practical to me! ;D Apr 25, 2018 at 10:14