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.
- 262,582
- 10,219
- 13
- 63
- 88
3 Answers
Add \listfiles to your preamble and then look at the .log file. This will tell you the current version of all the packages loaded.
- 73,242
-
38Package versions are announced in the
.logfile even without\listfiles. – Andrey Vihrov Mar 13 '11 at 12:28 -
13
-
6
-
3@ℝaphink I have attempted, but the fact that TeX hard-wraps the output makes it very difficult. – Sean Allred Oct 24 '15 at 16:30
-
@SeanAllred You can increase
max_print_lineintexmf.cnfto have it (practically) not wrap; see this question. – ShreevatsaR May 05 '17 at 06:06 -
If using pdfLatex, within the log output the result of \listfiles starts with the line File List – PWillms Oct 31 '17 at 17:32
-
Won't it be even better to add
\listfilesin the very beginning of the file, even before\documentclass? – Evan Aad Nov 15 '17 at 06:59
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).
- 259,911
- 34
- 706
- 1,036
-
1you can load the name into a macro by
\edef\foo{\csname ver@pgfplots.sty\endcsname}– wasteofspace Mar 13 '11 at 12:48 -
1Nowadays it can be accessed with the name
\IfPackageAtLeastTF. (documentation at no-idea-where, source code in source2e.pdf.) – user202729 May 18 '22 at 15:50 -
Remark, if
<package>happens to beexpl3then it only work after explicit\usepackage{expl3}even in versions where expl3 are available by default. Before loading it, it's inExplFileDateor the (internal, do not use)\c__kernel_expl_date_tl– user202729 Jul 13 '22 at 02:57
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:
Miktex (Windows)
D:\Programs\Mikyex\latex\texmfs\install\tex\latex\biblatex-abnt\bbx\abnt.bbx- How can I manually install a package on MiKTeX (Windows)
- On the file
abnt.bbx, you will find this at his top, , where the version is:v3.1
... \ProvidesFile{abnt.bbx}% [2017/07/28\space v3.1\space ABNT BibLaTeX citation style]% ...TeX Live (Linux)
/usr/share/texlive/texmf-dist/tex/latex/biblatex-abnt/abnt.bbx- https://askubuntu.com/questions/296681/latex-filepaths-in-ubuntu
- On the file
abnt.bbx, you will find this at his top, where the version is:v3.2
... \ProvidesFile{abnt.bbx}% [2017/11/09\space v3.2\space ABNT BibLaTeX citation style]% ...
-
1note 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
tlmgr info pgfplotsgives the version of pgfplots installed. – texenthusiast Apr 04 '14 at 14:56@ifpackageloaded– user202729 May 18 '22 at 23:20