TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to download the package files only be knowing the CTAN package name (which can be a (La)TeX package, class, bundle, font, etc.)? I'm aware that http://www.ctan.org/pkg/<NAME> shows the package entry and tug.ctan.org/tex-archive/help/Catalogue/entries/<NAME>.html shows the similar catalogue entry. Both of them link to the CTAN directory holding the package files, which is fine for manual browsing. I however look for an automatic way to retrieve the package files (mainly the DTX and INS files) without needing to parse a HTML page for the directory URL. The idea is to write a script which allows to install most CTAN packages directly from CTAN.

To elaborate: I'm looking for an online resource where I can use the CTAN package name in an URL and I get redirected to the CTAN directory of this package, on any mirror. This is similar to http://texdoc.net just not for the documentation but for the DTX/INS files. If there is no such thing I probably will create it myself (by altering the some source code of CTAN-HG), but I see no reason to duplicate something which already exists.

share|improve this question
Have you looked at the TL scripts for updating packages? They already have the (long) list of 'special cases' you'd need to allow for. – Joseph Wright May 26 '12 at 19:31
@JosephWright: I didn't saw these scripts yet. Can you give me a link, please? However, I have experience with exceptions from my work on CTAN-HG. – Martin Scharrer May 26 '12 at 20:21
Now there you have me. I know these scripts exist, but I'd have to ask on the TL list where they actually are :-) – Joseph Wright May 26 '12 at 20:24
ctan hosts allow any directory to be retrieved as a zip file so if you know the directory you can get all the files, in one go, – David Carlisle May 26 '12 at 20:50
For the scripts in TL see tug.org/svn/texlive/trunk/Master/tlpkg/libexec/…, tug.org/svn/texlive/trunk/Master/tlpkg/bin/…, ... but these are not standalone and might need minor adjustments. – Mojca Miklavec May 30 '12 at 0:24

[Combining comments into a answer]

You can retrieve any directory from CTAN as a .zip file so if you know the directory you can get all the files, in one go. TeX Live uses a series of scripts, which can be downloaded from http://tug.org/svn/texlive/trunk/Master/tlpkg/libexec/ctan2tds?view=markup and http://tug.org/svn/texlive/trunk/Master/tlpkg/bin/tlpkg-ctan-check?view=markup, but these are not standalone and might need minor adjustments.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.