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?
5 Answers
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.
-
5I 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.) Aug 14, 2010 at 20:47
-
-
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, 2012 at 22:54
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.
-
3Yeah, try googling for something that explains the difference between \newcommand and \newcommand*! Jul 27, 2010 at 14:11
-
1Fortunately, that one is fairly easy to do http://www.google.com/search?q=What+is+the+diference+between+\newcommand+and+\newcommand*? It's just a few hits down.– TH.Sep 24, 2010 at 10:16
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
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...
-
1Could I ask why. The usual feeling is that Robin's database entries are a pretty good place to start.– Joseph Wright ModAug 18, 2010 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. Aug 18, 2010 at 19:05
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.
[[
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 wholehttp://ctan.org/pkg/
thing.