I was reading about creating coordinate systems in the pgfmanual and was surprised to see the use of \define@key in one of the examples
\makeatletter
\define@key{cylindricalkeys}{angle}{\def\myangle{#1}}
\define@key{cylindricalkeys}{radius}{\def\myradius{#1}}
\define@key{cylindricalkeys}{z}{\def\myz{#1}}
\tikzdeclarecoordinatesystem{cylindrical}%
{%
\setkeys{cylindricalkeys}{#1}%
\pgfpointadd{\pgfpointxyz{0}{0}{\myz}}{\pgfpointpolarxy{\myangle}{\myradius}}
}
\begin{tikzpicture}[z=0.2pt]
\draw [->] (0,0,0) -- (0,0,350);
\foreach \num in {0,10,...,350}
\fill (cylindrical cs:angle=\num,radius=1,z=\num) circle (1pt);
\end{tikzpicture}
I copied and pasted this into a document whose class was article and only loaded one package, tikz. Everything compiled fine.
So I added a line to list the files:
\documentclass{article}
\usepackage{tikz}
\listfiles
\begin{document}
\makeatletter
\define@key{cylindricalkeys}{angle}{\def\myangle{#1}}
\define@key{cylindricalkeys}{radius}{\def\myradius{#1}}
\define@key{cylindricalkeys}{z}{\def\myz{#1}}
\tikzdeclarecoordinatesystem{cylindrical}%
{%
\setkeys{cylindricalkeys}{#1}%
\pgfpointadd{\pgfpointxyz{0}{0}{\myz}}{\pgfpointpolarxy{\myangle}{\myradius}}
}
\begin{tikzpicture}[z=0.2pt]
\draw [->] (0,0,0) -- (0,0,350);
\foreach \num in {0,10,...,350}
\fill (cylindrical cs:angle=\num,radius=1,z=\num) circle (1pt);
\end{tikzpicture}
\end{document}
I discovered that the following key value packages loaded:
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
pgfkeys.sty
pgfkeys.code.tex
kvdefinekeys.sty 2011/04/07 v1.3 Define keys (HO)
kvsetkeys.sty 2012/04/25 v1.16 Key value parser (HO)
I assumed (rather incorrectly, apparently) that it was the pgfkeys package loading these dependencies. But, when I made a document which only used pgfkeys, the listed files were only:
*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)
pgfkeys.sty
pgfkeys.code.tex
***********
I could continue in this manner of loading only one package at a time and listing its package dependencies. But that's rather tedious. Is there in general a less tedious way to better discover how the various packages are depending upon one another?
Note: I'm not asking just about tikz or pgf. It was only via playing with those two packages that this question arose.
Update
It looks like How to design a command inquiring internally required packages? provides something of a solution. Though the answer provided @HeikoOberdiek only seems to list the dependencies the first time they're encountered. If a subsequent packages requires a package that has already been required, then it's not printed out a second time.
tikz.styrequirespgf.stywhich requirespgfcore.stywhich requireskeyval.sty. Not easy to follow. The packages in theoberdiekbundle do something similar. – egreg Apr 12 '14 at 14:49\usepackage,\RequirePackage, etc. to keep track of what loads what and save that information in a first pass, and produce some directed graph of dependencies between class/packages in a second pass, couldn't you? That would actually be a nice package. – jub0bs Apr 12 '14 at 14:53.styor.code.texfile and doing a file chanse, is there a more direct way provided to track down such chains of dependencies. (Again, this isn't really a question abouttikzorpgfper se. They just happen to be large packages.) – A.Ellett Apr 12 '14 at 14:53