@@ -103,6 +103,7 @@ data Opt = Opt
103103 , optXeTeX :: Bool -- ^ Format latex for xetex
104104 , optSmart :: Bool -- ^ Use smart typography
105105 , optHtml5 :: Bool -- ^ Produce HTML5 in HTML
106+ , optChapters :: Bool -- ^ Use chapter for top-level sects
106107 , optHTMLMathMethod :: HTMLMathMethod -- ^ Method to print HTML math
107108 , optReferenceODT :: Maybe FilePath -- ^ Path of reference.odt
108109 , optEPUBStylesheet :: Maybe String -- ^ EPUB stylesheet
@@ -144,6 +145,7 @@ defaultOpts = Opt
144145 , optXeTeX = False
145146 , optSmart = False
146147 , optHtml5 = False
148+ , optChapters = False
147149 , optHTMLMathMethod = PlainMath
148150 , optReferenceODT = Nothing
149151 , optEPUBStylesheet = Nothing
@@ -233,6 +235,11 @@ options =
233235 (\opt -> return opt { optHtml5 = True }))
234236 "" -- "Produce HTML5 in HTML output"
235237
238+ , Option "" ["chapters"]
239+ (NoArg
240+ (\opt -> return opt { optChapters = True }))
241+ "" -- "Use chapter for top-level sections in LaTeX, DocBook"
242+
236243 , Option "m" ["latexmathml", "asciimathml"]
237244 (OptArg
238245 (\arg opt ->
@@ -637,6 +644,7 @@ main = do
637644 , optXeTeX = xetex
638645 , optSmart = smart
639646 , optHtml5 = html5
647+ , optChapters = chapters
640648 , optHTMLMathMethod = mathMethod
641649 , optReferenceODT = referenceODT
642650 , optEPUBStylesheet = epubStylesheet
@@ -781,7 +789,8 @@ main = do
781789 writerSourceDirectory = sourceDir,
782790 writerUserDataDir = datadir,
783791 writerHtml5 = html5 &&
784− "html" `isPrefixOf` writerName' }
792+ "html" `isPrefixOf` writerName',
793+ writerChapters = chapters }
785794
786795 when (isNonTextOutput writerName' && outputFile == "-") $
787796 do UTF8.hPutStrLn stderr ("Error: Cannot write " ++ writerName ++ " output to stdout.\n" ++