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/cv

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.
<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.

<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.
<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/cv?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/cv?no-xml=true
Guest Book Sitemap Contact