Sign up ×
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.

I have written a LaTeX Document and it compiles fine on my machine, but now I would like to give the sources to someone else. Is there a quick way to list all the packages that have been used for compilation?

share|improve this question

migrated from Feb 20 '12 at 21:35

This question came from our site for professional and enthusiast programmers.

difficult. You should use Tex Live anyway which has all you need packaged. – three Feb 20 '12 at 21:26
I didn't install the TeX distribution but it seems that TeX Live is used in some way as it occurs a lot of times in the generated lag file. – zero-divisor Feb 20 '12 at 21:33

1 Answer 1

up vote 20 down vote accepted

Yes. Add \listfiles somewhere in your document preamble. The output should be posted in your .log file. Here's an example from a test document containing 2 packages in the preamble and compiled using TeX Live 2009:


The .log file now includes

 *File List*
 article.cls    2007/10/19 v1.4h Standard LaTeX document class
  size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
   array.sty    2008/09/09 v2.4c Tabular extension package (FMi)
hyperref.sty    2010/05/04 v6.81a Hypertext links for LaTeX
 ltxcmds.sty    2010/04/26 v1.7 LaTeX kernel commands for general use (HO)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
kvsetkeys.sty    2010/03/01 v1.9 Key value parser (HO)
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/message (HO)
etexcmds.sty    2010/01/28 v1.3 Prefix for e-TeX command names (HO)
pdfescape.sty    2010/03/01 v1.9 Provides hex, PDF name and string conversions 
pdftexcmds.sty    2010/04/01 v0.9 Utility functions of pdfTeX for LuaTeX (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
   ifpdf.sty    2010/01/28 v2.1 Provides the ifpdf switch (HO)
  ifvtex.sty    2010/03/01 v1.5 Switches for detecting VTeX and its modes (HO)
 ifxetex.sty    2009/01/23 v0.5 Provides ifxetex conditional
 hycolor.sty    2009/12/12 v1.6 Color options of hyperref/bookmark (HO)
xcolor-patch.sty    2009/12/12 xcolor patch
letltxmacro.sty    2008/06/24 v1.3 Let assignment for LaTeX macros (HO)
  pd1enc.def    2010/05/04 v6.81a Hyperref: PDFDocEncoding definition (HO)
 intcalc.sty    2007/09/27 v1.1 Expandable integer calculations (HO)
hyperref.cfg    2002/06/06 v1.2 hyperref configuration of TeXLive
kvoptions.sty    2010/02/22 v3.7 Keyval support for LaTeX options (HO)
     url.sty    2006/04/12  ver 3.3  Verb mode for urls, etc.
  bitset.sty    2007/09/28 v1.0 Data type bit set (HO)
bigintcalc.sty    2007/11/11 v1.1 Expandable big integer calculations (HO)
atbegshi.sty    2010/03/25 v1.12 At begin shipout hook (HO)
 hpdftex.def    2010/05/04 v6.81a Hyperref driver for pdfTeX
atveryend.sty    2010/03/24 v1.5 Hooks at very end of document (HO)
rerunfilecheck.sty    2010/03/16 v1.6 Rerun checks for auxiliary files (HO)
uniquecounter.sty    2009/12/18 v1.1 Provides unlimited unique counter (HO)
 nameref.sty    2010/04/30 v2.40 Cross-referencing by name of section
refcount.sty    2008/08/11 v3.1 Data extraction from references (HO)
gettitlestring.sty    2009/12/18 v1.3 Cleanup title references (HO)

So, you can see that loading only array and hyperref (say), actually loads a large number of other packages as well.

share|improve this answer
Great, thanks! That's exactly what I was looking for. – zero-divisor Feb 20 '12 at 21:46
I have some recollection of a script that uses \listfilesto actually bundle up all files that are belonging to a particular document for archival purposes. Anybody having a pointer? – Frank Mittelbach Feb 20 '12 at 22:54
Great answer. Is there a way to only get the 1st level? As in only those that I've explicitly specified in the TeX file, and not those loaded because a package I've used needs them? Over time, changes occur and you can have quite a list of packages at the top of the document, but I'm not longer making use of maybe 10% of them. – Travis Bemrose Feb 13 at 21:13
@TravisBemrose: There is no easy way to do this, as all package inclusions use the same mechanism (\input or \include or \usepackage or ...). One way would be to define a macro \usemypackage{<package>} which could accumulate package names, then do a search-and-replace for \usepackage in your main document to \usemypackage. As such, there's no easy, out-of-the-box solution. Of course, you could just start removing any packages that you think you don't use or are obsolete (see How to keep up with packages and know which ones are obsolete?. – Werner Feb 13 at 22:27

Your Answer


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.