@@ -107,6 +107,7 @@ data Opt = Opt
107107 , optWriter :: String -- ^ Writer format
108108 , optParseRaw :: Bool -- ^ Parse unconvertable HTML and TeX
109109 , optCSS :: String -- ^ CSS file to link to
110+ , optTableOfContents :: Bool -- ^ Include table of contents
110111 , optIncludeInHeader :: String -- ^ File to include in header
111112 , optIncludeBeforeBody :: String -- ^ File to include at top of body
112113 , optIncludeAfterBody :: String -- ^ File to include at end of body
@@ -133,6 +134,7 @@ defaultOpts = Opt
133134 , optWriter = "" -- null for default writer
134135 , optParseRaw = False
135136 , optCSS = ""
137+ , optTableOfContents = False
136138 , optIncludeInHeader = ""
137139 , optIncludeBeforeBody = ""
138140 , optIncludeAfterBody = ""
@@ -230,6 +232,11 @@ options =
230232 "CSS")
231233 "" -- "Link to CSS style sheet"
232234
235+ , Option "" ["toc", "table-of-contents"]
236+ (NoArg
237+ (\opt -> return opt { optTableOfContents = True }))
238+ "" -- "Include table of contents"
239+
233240 , Option "H" ["include-in-header"]
234241 (ReqArg
235242 (\arg opt -> do
@@ -395,6 +402,7 @@ main = do
395402 , optWriter = writerName
396403 , optParseRaw = parseRaw
397404 , optCSS = css
405+ , optTableOfContents = toc
398406 , optIncludeInHeader = includeHeader
399407 , optIncludeBeforeBody = includeBefore
400408 , optIncludeAfterBody = includeAfter
@@ -471,6 +479,8 @@ main = do
471479 writerHeader = header,
472480 writerTitlePrefix = titlePrefix,
473481 writerTabStop = tabStop,
482+ writerTableOfContents = toc &&
483+ (not strict),
474484 writerS5 = (writerName=="s5"),
475485 writerIncremental = incremental,
476486 writerNumberSections = numberSections,