Menu
CTAN
Comprehensive TeX Archive Network
Cover Upload Browse Search

Query­ing the CTAN Database – Pack­age

The in­for­ma­tion about a sin­gle pack­age can be ob­tained un­der the URL like

http://www.ctan.org/xml/pkg/tex

The last el­e­ment in the URl is the key of the pack­age as used by CTAN. Those keys are also listed in the list of pack­ages.

The re­sult is an XML file as in the fol­low­ing list­ing:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE authors SYSTEM 'http://www.ctan.org/xml/catalogue.dtd'>
<entry id='tex'>
  <name>TeX</name>
  <caption>A sophisticated typesetting engine</caption>
  <authorref id='auth:knuth' />
  <copyright owner='D. E. Knuth' year='1982' />
  <license type='knuth'/>
  <version  number="3.1415926" />
  <description>
    TeX is a typesetting system that incorporates a macro processor.
    A TeX source document specifies or incorporates a number of macro
    definitions that instruct the TeX engine how to typeset the
    document.  The TeX engine also uses font metrics generated by
    Metafont, or by any of several other
    mechanisms that incorporate fonts from other sources into an
    environment suitable for TeX.
    
    TeX has been, and continues, a basis and an inspiration for
    several other programs, including e-TeX
    and PDFTeX.
    
    The distribution includes the source of Knuth’s
    TeX book; this source is there to read, as an
    example of writing TeX — it should not be processed
    without Knuth’s direct permission.
  </description>
  <ctan path='/systems/knuth/dist/tex' />
  <miktex location='miktex-tex-bin-2.9' />
  <texlive location='tex' />
  <keyval key='topic' value='engine' />
</entry>  

The en­try has the outer tag <package>. This tag has sev­eral at­tributes:

id
This at­tribute con­tains the unique id of the pack­age. This at­tribute is manda­tory.
<name>
The en­try has the manda­tory in­ner tag <name>. The name con­tains the print rep­re­sen­ta­tion of the pack­age name. This tag has no at­tributes.
<caption>
The en­try has the manda­tory in­ner tag <caption>. The cap­tion con­tains a short de­scrip­tion of the pack­age. This tag has no at­tributes.
<authorref>
The en­try can have zero or more the in­ner tags <authorref>. It car­ries the ref­er­ence to an au­thor. This tag has sev­eral at­tributes:
id
This at­tribute con­tains the id of the au­thor. The at­tribute is pre­fixed with auth: for his­tor­i­cal rea­sons. This at­tribute is manda­tory.
givenname
This at­tribute con­tains the given name of the au­thor. It is present only if the pa­ram­e­ter author-name is true and the given name is known.
familyname
This at­tribute con­tains the fam­ily name of the au­thor. It is present only if the pa­ram­e­ter author-name is true and the fam­ily name is known.
<copyright>
The en­try can have zero or more the in­ner tags <copyright>. It car­ries the in­for­ma­tion about the copy­right. This tag has sev­eral at­tributes:
owner
This at­tribute con­tains the name of the copy­right holder. This at­tribute is manda­tory.
year
This at­tribute con­tains the year or years of the copy­right. This at­tribute is manda­tory.
<version>
The en­try has the in­ner tag <version>. It car­ries the in­for­ma­tion about the ver­sion of the pack­age. This tag has sev­eral at­tributes:
number
This at­tribute con­tains the ver­sion num­ber.
date
This at­tribute con­tains the ver­sion date.

At least one of number or date have to be given. Other­wise the tag is sup­pressed.

<description>
The en­try has some op­tional in­ner tags <description>. The value is a longer de­scrip­tion of the pack­age. This de­scrip­tion can make use of HTML for for­mat­ting. The tag may have an at­tribute:
lang
This at­tribute con­tains the ISO code for the lan­guage of the de­scrip­tion.
<ref>
An in­ner tag of <description> is <ref>. It is used to ref­er­ence a pack­age. The tag may have an at­tribute:
refid
This at­tribute con­tains the ref­er­ence.
<documentation>
The en­try has some op­tional in­ner tags <documentation>. Th­ese tags in­di­cate ref­er­ences to doc­u­men­ta­tion. The tag may have at­tributes:
lang
This at­tribute con­tains the ISO code for the lan­guage of the de­scrip­tion.
details
This at­tribute con­tains the (English) text de­scrib­ing this doc­u­men­ta­tion item.
href
This at­tribute con­tains a ref­er­ence to the doc­u­men­ta­tion. The pre­fix ctan: in­di­cates a ref­er­ence to a di­rec­tory on CTAN. If the pa­ram­e­ter keep-url is true then this at­tribute con­tains al­ways a valid URL with­out the ctan: pre­fix.
<ctan>
The en­try has the op­tional in­ner tag <ctan>. It car­ries the lo­ca­tion of the pack­age in the CTAN tree. This tag has sev­eral at­tributes:
path
This at­tribute con­tains the rel­a­tive path of the pack­age in the CTAN tree. This at­tribute is manda­tory.
file
This at­tribute con­tains the in­di­ca­tor that this pack­age con­sists of a sin­gle file only. This is in con­trast to a whole pack­age di­rec­tory. This at­tribute is op­tional and de­faults to false.
<install>
The en­try has the op­tional in­ner tag <install>. It car­ries the lo­ca­tion of the pack­age on CTAN in form of an in­stal­lable TDS-com­pli­ant zip archive. This tag has sev­eral at­tributes:
path
This at­tribute con­tains path rel­a­tive to the CTAN di­rec­tory /in­stall. This at­tribute is manda­tory.
<miktex>
The en­try has the op­tional in­ner tag <miktex>. It car­ries the name of the pack­age in MikTeX. This tag has sev­eral at­tributes:
location
This at­tribute con­tains name of the pack­age in MikTeX. This at­tribute is manda­tory.
<texlive>
The en­try has the op­tional in­ner tag <texlive>. It car­ries the name of the pack­age in TeXlive. This tag has sev­eral at­tributes:
location
This at­tribute con­tains name of the pack­age in TeXlive. This at­tribute is manda­tory.
<keyval>
The en­try has zero or more in­ner tags <keyval>. It is meant as ex­ten­sion point to add ar­bi­trary key-value pairs. This tag has sev­eral at­tributes:
key
This at­tribute con­tains key of the key-value pair. This at­tribute is manda­tory.
value
This at­tribute con­tains value of the key-value pair. This at­tribute is manda­tory.

The fol­low­ing keys are cur­rently in use:

topic
With this key the value con­tains the name of one of the top­ics.
index
With this key the value is also in­dexed for the CTAN search.

Omit­ting the Doc­type

The pack­age file in­cludes a doc­type dec­la­ra­tion. This dec­la­ra­tion can be sup­pressed with the pa­ram­e­ter no-dtd which should be set to true as in

http://www.ctan.org/xml/pkg/tex?no-dtd=true

Omit­ting the XML Dec­la­ra­tion

The pack­age file starts with an XML dec­la­ra­tion. This dec­la­ra­tion can be sup­pressed with the pa­ram­e­ter no-xml which should be set to true as in

http://www.ctan.org/xml/pkg/tex?no-xml=true

Ex­pand­ing Author In­for­ma­tion

The au­thor in­for­ma­tion is con­tained as id ref­er­enc­ing an en­try in the au­thors file. If the pa­ram­e­ter author-name can be set to true to in­clude the first name and fam­ily name of the au­thor as well. Ex­am­ple:

http://www.ctan.org/xml/pkg/tex?au­thor-name=true

Select­ing Fields

Some­times it might be de­sir­able to get some of the fields only. This can be ac­com­plished with the pa­ram­e­ter drop. It takes a comma sep­a­rated list of fields to drop. Ex­am­ple:

http://www.ctan.org/xml/pkg/tex?drop=doc­u­men­ta­tion,de­scrip­tion

The fol­low­ing fields are rec­og­nized in the drop list:

author, caption, copyright, ctan, description, documentation, home, index, install, miktex, name, texlive, topic, version
Query­ing the CTAN Database

Changes

1.3.15

  • Pa­ram­e­ter author-name and the as­so­ci­ated at­tributes givenname and familyname in­tro­duced.
  • Pa­ram­e­ter drop in­tro­duced.
  • <version> is omit­ted en­tirely if nei­ther num­ber nor date are set.
  • Pa­ram­e­ter keep-url in­tro­duced.
Guest Book Sitemap Contact