Querying the CTAN Database with JSON – List of Packages
The list of packages can be obtained under the URL
The result is an JSON file as in the following listing:
[{"key":"a0poster","name":"a0poster","caption":"Support for designing posters on large paper"},
{"key":"a2ac","name":"a2ac","caption":"AFM to AFM plus Composites"},
{"key":"a2ping","name":"a2ping","caption":"Advanced PS, PDF, EPS converter"},
{"key":"a4","name":"a4","caption":"Support for A4 paper sizes"},
{"key":"a4wide","name":"a4wide","caption":"\"Wide\" a4 layout"},
{"key":"a5comb","name":"a5comb","caption":"Support for a5 paper sizes"},
{"key":"aaai","name":"aaai","caption":"AAAI style"},
{"key":"aaai-named","name":"aaai-named","caption":"BibTeX style for AAAI"},
{"key":"aastex","name":"aastex","caption":"Macros for Manuscript Preparation for AAS Journals"},
{"key":"abbr","name":"abbr","caption":"Simple macros supporting abreviations for Plain and LaTeX"},
{"key":"abbrevs","name":"abbrevs","caption":"Text abbreviations in LaTeX"},
{"key":"abc","name":"abc","caption":"Support ABC music notation in LaTeX"},
{"key":"abc2mtex","name":"abc2mtex","caption":"Notate tunes stored in ABC notation"},
…
The packages contained in this list are ordered ascending on the key of the packages.
package-
Each package is contained as object. This object has several attributes:
key- This attribute contains the key of the package. This attribute is mandatory.
name- This attribute contains the name of the package. This attribute is mandatory.
caption- This attribute contains a short descriptive text about the content of the package.
Selecting
The list can be restricted to contain part of the packages only.
The condition is that the key starts with a given string. This string is
specified with the parameter key.
The following example extracts all packages for which the key starts with the letter n:
Aliases
A package can have one or more aliases. Those aliases are not treated as packagaes themself. Instead a request for such an aliased package is automatically redirected to the underlying package.
The list can be restricted to additionally contain the aliases as
separate items. This feature is specified with the parameter
include-aliases.
This leads to output of the following kind:
[{"key":"a0poster","name":"a0poster","caption":"Support for designing posters on large paper"},
…
{"key":"a0poster","name":"a0poster","caption":"Support for designing posters on large paper"},
…
{"alias":"tikz",name:"TikZ",pkg:"pgf" }
…
]
Each alias is contained within a map. This map has several attributes:
alias- This attribute contains the key of the package alias. This attribute is mandatory.
name- This attribute contains the name of the package alias. This attribute is mandatory.
pkg- This attribute contains the key of the package for which we see an alias.
The same parameter include-aliases can be added when a
key parameter is also specified. In this case in addition
to the matching packages the aliases are returned where the key of the
alias matches the given key parameter.