To find software at a CTAN site, you can use anonymous ftp
to
the host with the command 'quote site index <term>
', or the
searching script at http://www.dante.de/cgi-bin/ctan-index
To get the best use out of the ftp
facility you should remember that
<term>
is a Regular Expression and not a fixed string,
and also that many files are distributed
in source form with an extension different to the final file. (For
example LaTeX packages are often distributed sources with extension
dtx
rather than as package files with extension sty
.)
One should make the regular expresion general enough to find the file
you are looking for, but not too general, as the ftp
interface will
only return the first 20 lines that match your request.
The following examples illustrate these points.
To search for the LaTeX package 'caption
',
you might use the command:
quote site index caption.stybut it will fail to find the desired package (which is distributed as
caption.dtx
) and does return unwanted 'hits' (such as
hangcaption.sty
). Also, although this example does not show it the
'.
' in 'caption.sty
' is used as the regular expression that
matches any character.
So
quote site index doc.stymatches such unwanted files as language/swedish/slatex/doc2sty/makefile
Of course if you know the package is stored as .dtx
you can
search for that name, but in general you may not know the extension
used on the archive.
The solution is to add '/
' to the front of the package name and
'
to the end. This will then search for a file name that consists
solely of the package name between the directory separator and the
extension. The two commands:
.
quote site index /caption\\. quote site index /doc\\.do narrow the search down sufficiently. (In the case of doc, a few extra files are found, but the list returned is sufficiently small to be easily inspected.)
If the search string is too wide and too many files would match, the
list will be truncated to the first 20 items found. Using some
knowledge of the CTAN directory tree you can usually narrow the search
sufficiently. As an example suppose you wanted to find a copy of the
dvips
driver for MSDOS. You might use the command:
quote site index dvipsbut the result would be a truncated list, not including the file you want. (If this list were not truncated 412 items would be returned!) However we can restrict the search to MSDOS related drivers as follows.
quote site index msdos.*dvipsWhich just returns relevant lines such as systems/msdos/dviware/dvips/dvips5528.zip
A basic introduction to searching with regular expressions is:
"a"
matches "a"
etc.;
"."
matches any character;
"[abcD-F]"
matches any single character from the set
{"a"
,"b"
,"c"
,"D"
,"E"
,"F"}
;
"*"
placed after an expression matches zero or more occurrences
so "a*"
matches "a"
and "aaaa"
, and "[a-zA-Z]*"
matches a
'word';
"\"
'quotes' a special character such as "."
so "\."
just
matches "."
;
"^"
matches the beginning of a line;
"$"
matches the end of a line.
For technical reasons in the quote site index command, you need to
'double' any \
hence the string /caption
\
\.
in the above example.
The quote site command ignores the case of letters. Searching for
caption
or CAPTION
would produce the same result.