Querying the CTAN Database with XML – List of Packages
The list of packages can be obtained under the URL
The result is an XML file as in the following listing:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE packages SYSTEM 'https://www.ctan.org/xml/3.0/catalogue.dtd'> <packages> <package key="a0poster" name="a0poster" caption="Support for designing posters on large paper" /> <package key="a2ac" name="a2ac" caption="AFM to AFM plus Composites" /> <package key="a2ping" name="a2ping" caption="Advanced PS, PDF, EPS converter" /> <package key="a4" name="a4" caption="Support for A4 paper sizes" /> <package key="a4wide" name="a4wide" caption=""Wide" a4 layout" /> <package key="a5comb" name="a5comb" caption="Support for a5 paper sizes" /> <package key="aaai" name="aaai" caption="AAAI style" /> <package key="aaai-named" name="aaai-named" caption="BibTeX style for AAAI" /> <package key="aastex" name="aastex" caption="Macros for Manuscript Preparation for AAS Journals" /> … </packages>
The list has the outer tag <packages>.
The packages contained in this list are ordered ascending on the key of the packages.
<package>-
Each package is contained within the tag
<package>. This tag 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:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE packages SYSTEM 'https://www.ctan.org/xml/3.0/catalogue.dtd'> <packages> <package key="a0poster" name="a0poster" caption="Support for designing posters on large paper" /> … <alias key="tikz" name="TikZ" pkg="pgf" /> … </packages>
Each alias is contained within the tag <alias>.
This tag has several attributes:
key- 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.
Omitting Or Enforcing the Doctype Declaration
The list of licenses may include a doctype declaration. This declaration can
be suppressed with the URL parameter no-dtd which should be set
to true as in
A doctype declaration can be enforced with the URL parameter
no-dtd which should be set to false in this case.
The default is no-dtd=true.
Omitting Or Enforcing the Schema Declaration
The list of licenses may include a XML schema declaration. This declaration
can be suppressed with the URL parameter no-xsd which should be
set to true as in
A schema declaration can be enforced with the URL parameter
no-xsd which should be set to false in this case.
The default is no-xsd=false.
Omitting the XML Declaration
The list of licenses starts with an XML declaration. This declaration can
be suppressed with the URL parameter no-xml which should be
set to true as in