135

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.

Martin Scharrer
  • 262,582
Tim N
  • 10,219
  • 13
  • 63
  • 88

3 Answers3

116

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

Seamus
  • 73,242
64

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

\IfPackageAtLeast{<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).

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
1

To find a package version, you can just open the package source file on your file system and look the version directly by yourself with some text editor as Sublime Text.

Here are the paths and references for the latex paths on Linux and Windows for the biblatex package:

  1. Miktex (Windows) D:\Programs\Mikyex\latex\texmfs\install\tex\latex\biblatex-abnt\bbx\abnt.bbx

    ...
    \ProvidesFile{abnt.bbx}%
    [2017/07/28\space v3.1\space ABNT BibLaTeX citation style]%
    ...
    
  2. TeX Live (Linux) /usr/share/texlive/texmf-dist/tex/latex/biblatex-abnt/abnt.bbx

    ...
    \ProvidesFile{abnt.bbx}%
    [2017/11/09\space v3.2\space ABNT BibLaTeX citation style]%
    ...
    
Marijn
  • 37,699
user
  • 4,745
  • 1
    note you should check the files using the paths reported by tex in the log not "reference" paths as above. The most common issues for which people need to check versions is where they have multiple tex installations and tex is not using the package they think it is using (eg miktex user and admin installs, or linux tex and a vanilla texlive from tug etc) So the important question is not do you have the latest version of the package installed, it is is your tex using that version. – David Carlisle Apr 27 '19 at 20:15