Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

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

2 Answers 2

up vote 39 down vote accepted

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

share|improve this answer
8  
Package versions are announced in the .log file even without \listfiles. –  Andrey Vihrov Mar 13 '11 at 12:28
5  
@Andrey: makes them easier to find, thought :-) –  Joseph Wright Mar 13 '11 at 12:30
2  
It might be interesting to write a command line tool to check that. –  ℝaphink Sep 16 '11 at 8:54

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).

share|improve this answer
    
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
1  
@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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.