summaryrefslogtreecommitdiffstats
path: root/Doc/newind.py
blob: b3a263b3fecb8e693b637a02c28205453e43a7ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /usr/bin/env python

"""Really nasty little script to create an empty, labeled index on stdout.

Do it this way since some shells seem to work badly (and differently) with
the leading '\b' for the first output line.  Specifically, /bin/sh on
Solaris doesn't seem to get it right.  Once the quoting works there, it
doesn't work on Linux any more.  ;-(
"""
__version__ = '$Revision$'
#  $Source$

import sys

if sys.argv[1:]:
    label = sys.argv[1]
else:
    label = "genindex"

print "\\begin{theindex}"
print "\\label{%s}" % label
print "\\end{theindex}"