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?
[Tex/LaTex] Find out which packages are used
packages
Related Solutions
I didn't use these packages (I have written my own, which I'm redesigning now, and I had a talk about it during EuroBachoTeX 2011 - you can download the slides from http://www.gust.org.pl/bachotex/2011/program#section-5), but I've skimmed through their docs and this is what I can say:
With exercise you can typeset exercises (possibly split in parts) with answers. You can hide (= not typeset) exercises or answers, or typeset exercises or answers in another part of the document (although they are remembered in a vbox, which is imho one of the worst ways usually). With each exercise you can associate its origin and difficulty (and typeset them if you wish). You can customize the way an exercise is displayed, and also you can select exercises to typeset (based on a list of labels). Markup is quite nice, maybe not the best possible (personally, I tend more towards more formalized markup, like in XML, not the free-form known in the LaTeX world), but still.
The answers package seems to be quite sophisticated and powerful, although not very user-friendly. Probably not something you would like to use five minutes before your deadline, but definitely worth checking. Ah, and the name Joseph Wright should guarantee that it works well.
The probsoln package is written by Nicola Talbot (quite a prolific and good package author - you should definitely check her
datatool
bundle!), and seems to be less complicated (and less powerful) thananswers
, but is probably a bit more user-friendly. Also, it has a few quite unique features: you can select a random subset from a pool of exercises, and also you have\correctitem
and\incorectitem
for use inenumerate
-like environments (these commands mark right and wrong answers in choice tests, but only if you typeset your exercises with solutions.).
Hope that helps.
I'd also recommend reading my slides (which I mentioned before). They are far from perfect (and may contain mistakes), but they contain some possibly useful information. One of the more important isuues is that when typesetting problem sets you should definitely consider some design problems: do you want to maintain a separate, external problem-database (and if yes, should it be generated manually or with the extract
package or a similar way) or not? (There are other design issues like that.)
(In case you have any questions about those slides, feel free to email me at mbork
, then the "at" sign, then mbork
, then dot and finally pl
.)
As I mentioned, I'm currently designing my own package with the same purpose, which (I hope) will have some unique features I personally need, too; it will be definitely easier to use than answers, but will have a similar set of features (and even more). Unfortunately, I have no idea when I'll be able to release usable code (a few months seem to be a reasonable time).
You can access the list as a comma separated list of filenames in \@filelist
If you need this check after \begin{document}
use \listfiles
so LaTeX saves that information.
\listfiles
does
\@for\@currname:=\@filelist\do{%
.....
to iterate over this list.
So for example you could define
\makeatletter
\def\test#1#2{%
\def\hmma{#1.sty}%
\let\hmmb\@empty
\@for\@currname:=\@filelist\do{%
\ifx\@currname\hmma
\def\hmmb{#2.sty}%
\fi
\ifx\@currname\hmmb
\typeout{#1 loaded before #2}%
\fi}}
then using this as:
\test{marginnote}{geometry}
will type out
marginnote loaded before geometry
if that is in fact the case.
As noted in the comments you might want to use different comand names in production code, also if the two .sty
are removed from the test you can test other files such as class and def files that are listed by LaTeX, but would need to explicitly use the extension, so \test{marginnote.sty}{geometry.sty}
Best Answer
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 includesSo, you can see that loading only
array
andhyperref
(say), actually loads a large number of other packages as well.