45

Many of the answers will probably be of the form "Use package whatever to solve your problem." Wouldn't it be nice if we have some light syntax to make whatever point to the appropriate package in the CTAN catalogue?

  • Sounds good. Is it technically possible? Something like [[CTAN:package-name]] should link to it. – Loop Space Jul 27 '10 at 14:04
  • Is [[something]] already valid markup? I think not, and then it would be awesome (and definitely technically possible) if we could write [[geometry]] and [[\newcommand]] to get links to, respectively, the package and the command documentation. – Juan A. Navarro Jul 27 '10 at 14:55
  • 1
    [[ and ]] have no built-in meaning in Markdown, so I'd reckon they're fair game. I'd love to see something like this, since I'm often too lazy to type out the whole http://ctan.org/pkg/ thing. – Will Robertson Sep 23 '10 at 11:54
20

It's a very good idea. Some of us might have typed http://ctan.org/pkg/ hundreds of times.

  • A minimally-invasive way would be adding a CTAN button: clicking that button makes the highlighted packagename into an url packagename. This encourages writers to provide links and the readers benefit from that comfort.

  • A more reliable solution would be using a special markup like mentioned in the comments. This has an advantage: if CTAN would change the path or the way how to access the package information, for instance by a paramater like this link: packagename, the whole site could respond accordingly. If a site would completely rely on a link structure to another site, it might end in hundreds or thousands of dead links some years later.

  • 5
    I think a CTAN button would be good enough for now. (In the unlikely event that CTAN URLs should change, maybe we could ask the admins to run some scripts that automatically fix all broken URLs; it should be a fairly simple search & replace anyway.) – Jukka Suomela Aug 14 '10 at 20:47
  • What is the status of this feature request? – yo' Jul 6 '12 at 22:53
  • I would really like to see something like [pkg:packagename] for link to ctan.org/pkg/packagename since it could be used in comments too, not just in posts. – yo' Jul 6 '12 at 22:54
7

Good idea. The same would be nice for core (La)TeX macros, too. Especially since some of them aren’t that easy to google for.

6

I now wrote a JavaScript file which does link all packages written in back-ticks to the CTAN catalogue or package information page. You can use it with Firefox browsers using the Greasemonkey extension. If it should point to the package information page instead

Downloads:

Links to the CTAN Catalogue:                                     autolink_packages.user.js
Links to the CTAN Package Information Page:         autolink_packages_info.user.js

For this to work the package name must be written on its own inside back-ticks, like `hyperref`. The package must be known to the script which contains the current list of packages. It should work in question, answers and comments on the main site and on meta.

Tests:

The following packages should be linked once the script is installed:
hyperref, array, svn-multi, pgf

The following other texts in back-ticks should not be linked:
\usepackage{array}, %^^&*(, notapackagename, unknownpackage

Manually linked packages should not be changed:
svn-multi tikz-timing

  • The links in these scripts seem to need updating now. – cyberSingularity Aug 21 '12 at 10:25
1

I'd greatly prefer links into the /tex-archive/ (e.g., /tex-archive/macros/latex/contrib/geometry/) hierarchy to ones into the /pkg/ hierarchy (e.g., /pkg/geometry, which is what /cgi-bin/ctanPackageInformation.py?id=geometry aliases to).

Makes automation that bit trickier, of course...

  • 1
    Could I ask why. The usual feeling is that Robin's database entries are a pretty good place to start. – Joseph Wright Aug 18 '10 at 18:10
  • @Joseph: I tend to find the information in the README more useful, and nearly always find the links more useful. Sometimes, the /pkg/ link is a nuisance, e.g., tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=xypic links to a raw Apache directory list, rather than the usual /tex-archive/ summary view. I have some impression that the READMEs are overall better maintained than the poackage summaries, although there are clear exceptions. – Charles Stewart Aug 18 '10 at 19:05
1

There are client-side workarounds for this too. I use TextExpander for the Mac. I type the package name, cut it to the clipboard, type ,ctan, and I get the proper link. AutoHotKey for Windows does something similar.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .