# Which package version am I using?

Is there a LaTeX command for printing the versions of the currently installed packages? I need to know the installed version of the pgfplots package.

-
with vanilla TeXLive distro, On command line/Terminal invoking tlmgr info pgfplots gives the version of pgfplots installed. – texenthusiast Apr 4 '14 at 14:56

Add \listfiles to your preamble and then look at the .log file. This will tell you the current version of all the packages loaded.

-
Package versions are announced in the .log file even without \listfiles. – Andrey Vihrov Mar 13 '11 at 12:28
@Andrey: makes them easier to find, thought :-) – Joseph Wright Mar 13 '11 at 12:30
It might be interesting to write a command line tool to check that. – ℝaphink Sep 16 '11 at 8:54
@ℝaphink I have attempted, but the fact that TeX hard-wraps the output makes it very difficult. – Sean Allred Oct 24 at 16:30

If you need to know this 'programmatically', then you can use the LaTeX kernel function \@ifpackagelater to test by date:

\@ifpackagelater{<package>}{2011/03/13}
{%
% Do something for the newer version
}
{%
% Do something different for the older version
}%

The information is stored inside a special macro, so if you just want to 'take a peek' you can use that. Taking pgfplots as an example

\expandafter\show\csname ver@pgfplots.sty\endcsname

Notice here that this needs the full file name we are interested in, so works for any file that contains suitable information (i.e. form \ProvidesPackage, \ProvidesClass or \ProvidesFile).

-
Thanks, this is definitely useful as well. – Tim N Mar 13 '11 at 12:37
you can load the name into a macro by \edef\foo{\csname ver@pgfplots.sty\endcsname} – wasteofspace Mar 13 '11 at 12:48
@anon: It's already in a macro, just one with an awkward name :-) – Joseph Wright Mar 13 '11 at 12:51
@Andrey: Done, clearly I hope. – Joseph Wright Mar 13 '11 at 13:02