--- TableOfContents.py	2002-12-03 22:15:28.000000000 +0100
+++ NewTableOfContents.py	2003-12-04 16:27:13.000000000 +0100
@@ -6,6 +6,8 @@
 
     Optional integer argument: maximal depth of listing.
 
+    DN: Optional second integer argument: start listing at this depth
+
     $Id: TableOfContents.py,v 1.6 2002/12/03 22:15:28 jhermann Exp $
 """
 
@@ -21,16 +23,27 @@
     lineno = 0
     titles = {}
 
+    # parse args
+    if args:
+        arglist = args.split(',')
+    else:
+        arglist = ''
+
     try:
         mindepth = int(macro.request.getPragma('section-numbers', 1))
     except (ValueError, TypeError):
         mindepth = 1
 
     try:
-        maxdepth = max(int(args), 1)
-    except (ValueError, TypeError):
+        maxdepth = max(int(arglist[0]), 1)
+    except (IndexError, ValueError, TypeError):
         maxdepth = 99
 
+    try:
+        startdepth = min(int(arglist[1]),maxdepth)
+    except (IndexError, ValueError, TypeError):
+        startdepth = 1
+
     for line in macro.parser.lines:
         # Filter out the headings
         lineno = lineno + 1
@@ -43,6 +56,7 @@
         # Get new indent level
         newindent = len(match.group(1))
         if newindent > maxdepth: continue
+        if newindent < startdepth: continue
         if newindent < mindepth: continue
         if not indent:
             baseindent = newindent - 1
