diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,9 @@
+## 0.3.6.3
+
+-   Fixed format option order in pipe mode
+-   Bump to GHC 8.8.3
+-   CI tweaks
+
 ## 0.3.6.2
 
 -   Force WS state evaluation to resolve duplicate id error inconsistency
diff --git a/docs/index.md b/docs/index.md
--- a/docs/index.md
+++ b/docs/index.md
@@ -17,6 +17,16 @@
 `--include-in-header`, add pandoc-crossref-specific definitions as well.
 See [LaTeX customization](#latex-customization) for more information.
 
+## Note on non-standard LaTeX templates
+
+If you're using non-standard pandoc LaTeX template (this includes the cases where document class is not `article` or `book` close enough to that), pandoc-crossref might not be able to configure that properly. You might to configure LaTeX in the template manually.
+
+## Note on LaTeX and `chapters` option
+
+Because pandoc-crossref offloads all numbering to LaTeX if it can, `chapters: true` has no direct effect on LaTeX output. You have to specify Pandoc's `--top-level-division=chapter` option, which should hopefully configure LaTeX appropriately.
+
+It's a good idea to specify `--top-level-division=chapter` for any output format actually, because pandoc-crossref can't signal pandoc you want to use chapters, and vice versa.
+
 ## pandoc-citeproc and pandoc-crossref
 
 Since pandoc-crossref uses the same citation syntax as pandoc-citeproc,
@@ -452,8 +462,7 @@
     package. Only relevant for LaTeX output. `\usepackage{cleveref}`
     will be automatically added to `header-includes`.
 -   `chapters`: if True, number elements as `chapter.item`, and restart
-    `item` on each first-level heading (as `--chapters` for latex/pdf
-    output)
+    `item` on each first-level heading. You might also need to run pandoc with `--top-level-division=chapter` argument to signal it you want to use chapters; whether it's actually required or not depends on the output format, but it's always safe to include. Notice `chapters` and related options are ignored in LaTeX output. See [Note on LaTeX and `chapters` option](#note-on-latex-and-chapters-option)
 -   `chaptersDepth`, default `1`: header level to treat as "chapter". If
     `chaptersDepth>1`, then items will be prefixed with several numbers,
     corresponding to header numbers, e.g. `fig. 1.4.3`.
diff --git a/lib/Text/Pandoc/CrossRef.hs b/lib/Text/Pandoc/CrossRef.hs
--- a/lib/Text/Pandoc/CrossRef.hs
+++ b/lib/Text/Pandoc/CrossRef.hs
@@ -113,8 +113,8 @@
       >>= replaceAll opts
       >>= bottomUpM (replaceRefs opts)
       >>= bottomUpM (listOf opts)
-    (result, state) = runState doWalk def
-  state `seq` return result
+    (result, st) = runState doWalk def
+  st `seq` return result
 
 {- | Modifies metadata for LaTeX output, adding header-includes instructions
 to setup custom and builtin environments.
diff --git a/pandoc-crossref.cabal b/pandoc-crossref.cabal
--- a/pandoc-crossref.cabal
+++ b/pandoc-crossref.cabal
@@ -4,10 +4,10 @@
 --
 -- see: https://github.com/sol/hpack
 --
--- hash: 476e5c1a727c4d24c20d593fc172c93c2e8a164455696b3521d5aa398f193ccb
+-- hash: f27b970767177282fd2813688f31677f401ea50e80da4d57474b99fdc67a92c0
 
 name:           pandoc-crossref
-version:        0.3.6.2
+version:        0.3.6.3
 synopsis:       Pandoc filter for cross-references
 description:    pandoc-crossref is a pandoc filter for numbering figures, equations, tables and cross-references to them.
 category:       Text
diff --git a/src/pandoc-crossref.hs b/src/pandoc-crossref.hs
--- a/src/pandoc-crossref.hs
+++ b/src/pandoc-crossref.hs
@@ -72,14 +72,14 @@
       void $ openBrowser $ "file:///" <> fp
       threadDelay 5000000
       return ()
-    go (Just Pipe) _ = toJSONFilter f
+    go (Just Pipe) fmt = toJSONFilter (f fmt)
     go Nothing Nothing = hPutStr stderr $ unlines
       [ "Running pandoc-crossref without arguments is not supported. Try"
       , "\tpandoc-crossref --help"
       , "If you want to run in \"pipe mode\", run with"
       , "\tpandoc-crossref --pipe [FORMAT]"
       ]
-    go Nothing _ = do
+    go Nothing fmt = do
       Env.lookupEnv "PANDOC_VERSION" >>= \case
         Just runv ->
           when (VERSION_pandoc /= runv) $ hPutStrLn stderr $
@@ -91,8 +91,8 @@
           , "\tpandoc-crossref --pipe [FORMAT]"
           , "instead."
           ]
-      toJSONFilter f
-    f fmt p@(Pandoc meta _) = runCrossRefIO meta fmt defaultCrossRefAction p
+      toJSONFilter (f fmt)
+    f fmt p@(Pandoc meta _) = runCrossRefIO meta (Format . T.pack <$> fmt) defaultCrossRefAction p
 
 main :: IO ()
 main = join $ execParser opts
