diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+## 0.3.6.4
+
+-   Last version to support pandoc 2.9
+-   Create hypertargets on equations in LaTeX output
+
 ## 0.3.6.3
 
 -   Fixed format option order in pipe mode
diff --git a/lib/Text/Pandoc/CrossRef/References/Blocks.hs b/lib/Text/Pandoc/CrossRef/References/Blocks.hs
--- a/lib/Text/Pandoc/CrossRef/References/Blocks.hs
+++ b/lib/Text/Pandoc/CrossRef/References/Blocks.hs
@@ -18,7 +18,7 @@
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 -}
 
-{-# LANGUAGE Rank2Types, MultiWayIf, OverloadedStrings #-}
+{-# LANGUAGE Rank2Types, OverloadedStrings #-}
 module Text.Pandoc.CrossRef.References.Blocks
   ( replaceAll
   ) where
@@ -257,13 +257,11 @@
 replaceInline :: Options -> Inline -> WS (ReplacedResult Inline)
 replaceInline opts (Span attrs@(label,_,_) [Math DisplayMath eq])
   | "eq:" `T.isPrefixOf` label || T.null label && autoEqnLabels opts
-  = case outFormat opts of
+  = replaceNoRecurse . Span attrs . (:[]) =<< case outFormat opts of
       f | isLatexFormat f ->
-        let eqn = "\\begin{equation}"<>eq<>mkLaTeXLabel label<>"\\end{equation}"
-        in replaceNoRecurse $ RawInline (Format "latex") eqn
-      _ -> do
-        (eq', _) <- replaceEqn opts attrs eq
-        replaceNoRecurse $ Span attrs [Math DisplayMath eq']
+        pure . RawInline (Format "latex")
+        $ "\\begin{equation}"<>eq<>mkLaTeXLabel label<>"\\end{equation}"
+      _ -> Math DisplayMath . fst <$> replaceEqn opts attrs eq
 replaceInline opts (Image attr@(label,_,attrs) alt img@(_, tit))
   | "fig:" `T.isPrefixOf` label && "fig:" `T.isPrefixOf` tit
   = do
@@ -275,7 +273,7 @@
 replaceInline _ _ = noReplaceRecurse
 
 replaceSubfigs :: Options -> [Inline] -> WS (ReplacedResult [Inline])
-replaceSubfigs opts = (replaceNoRecurse . concat =<<) . mapM (replaceSubfig opts)
+replaceSubfigs opts = (replaceNoRecurse . concat) <=< mapM (replaceSubfig opts)
 
 replaceSubfig :: Options -> Inline -> WS [Inline]
 replaceSubfig opts x@(Image (label,cls,attrs) alt (src, tit))
diff --git a/lib/Text/Pandoc/CrossRef/References/Refs.hs b/lib/Text/Pandoc/CrossRef/References/Refs.hs
--- a/lib/Text/Pandoc/CrossRef/References/Refs.hs
+++ b/lib/Text/Pandoc/CrossRef/References/Refs.hs
@@ -102,7 +102,7 @@
 allCitsPrefix cits = find isCitationPrefix prefixes
   where
   isCitationPrefix p =
-    all (p `T.isPrefixOf`) $ map (uncapitalizeFirst . citationId) cits
+    all ((p `T.isPrefixOf`) . uncapitalizeFirst . citationId) cits
 
 replaceRefsLatex :: T.Text -> Options -> [Citation] -> WS [Inline]
 replaceRefsLatex prefix opts cits
@@ -122,8 +122,8 @@
         cref'<>"{"<>listLabels prefix "" "," "" cits<>"}"
         else
           listLabels prefix "\\ref{" ", " "}" cits
-    suppressAuthor = all (==SuppressAuthor) $ map citationMode cits
-    noPrefix = all null $ map citationPrefix cits
+    suppressAuthor = all ((==SuppressAuthor) . citationMode) cits
+    noPrefix = all (null . citationPrefix) cits
     p | cref opts = id
       | suppressAuthor
       = id
@@ -160,9 +160,9 @@
   indices <- mapM (getRefIndex prefix opts) cits
   let
     cap = maybe False isFirstUpper $ getLabelPrefix . citationId . head $ cits
-    writePrefix | all (==SuppressAuthor) $ map citationMode cits
+    writePrefix | all ((==SuppressAuthor) . citationMode) cits
                 = id
-                | all null $ map citationPrefix cits
+                | all (null . citationPrefix) cits
                 = cmap $ getRefPrefix opts prefix cap (length cits - 1)
                 | otherwise
                 = cmap $ toList . ((fromList (citationPrefix (head cits)) <> space) <>) . fromList
@@ -204,9 +204,9 @@
   g :: RefData -> RefData -> Bool
   g a b = all (null . rdSuffix) [a, b] && (
             all (isNothing . rdSubfig) [a, b] &&
-            fromMaybe False ((liftM2 follows `on` rdIdx) b a) ||
+            Just True == (liftM2 follows `on` rdIdx) b a ||
             rdIdx a == rdIdx b &&
-            fromMaybe False ((liftM2 follows `on` rdSubfig) b a)
+            Just True == (liftM2 follows `on` rdSubfig) b a
           )
   follows :: Index -> Index -> Bool
   follows a b
diff --git a/lib/Text/Pandoc/CrossRef/Util/Settings/Gen.hs b/lib/Text/Pandoc/CrossRef/Util/Settings/Gen.hs
--- a/lib/Text/Pandoc/CrossRef/Util/Settings/Gen.hs
+++ b/lib/Text/Pandoc/CrossRef/Util/Settings/Gen.hs
@@ -30,7 +30,7 @@
 
 nameDeriveSetters ''Options
 
-fmap concat $ mapM (makeAcc . mkName)
+concat <$> mapM (makeAcc . mkName)
   [ "figureTitle"
   , "tableTitle"
   , "listingTitle"
diff --git a/pandoc-crossref.cabal b/pandoc-crossref.cabal
--- a/pandoc-crossref.cabal
+++ b/pandoc-crossref.cabal
@@ -1,13 +1,13 @@
 cabal-version: 1.12
 
--- This file has been generated from package.yaml by hpack version 0.31.1.
+-- This file has been generated from package.yaml by hpack version 0.33.0.
 --
 -- see: https://github.com/sol/hpack
 --
--- hash: f27b970767177282fd2813688f31677f401ea50e80da4d57474b99fdc67a92c0
+-- hash: f7cb34c672ba0593634354b36827e7739adae2afff9aa42987658d79b49c446a
 
 name:           pandoc-crossref
-version:        0.3.6.3
+version:        0.3.6.4
 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/test/m2m/delim/expect.tex b/test/m2m/delim/expect.tex
--- a/test/m2m/delim/expect.tex
+++ b/test/m2m/delim/expect.tex
@@ -13,18 +13,20 @@
 Some of those can be labelled:
 
 This is a test file with some referenced equations, line
-\begin{equation} this \label{eq:0}\end{equation}
+\protect\hypertarget{eq:0}{}{\begin{equation} this \label{eq:0}\end{equation}}
 
 Some equations might be inside of text,
-\begin{equation} for example \label{eq:1}\end{equation} this one.
+\protect\hypertarget{eq:1}{}{\begin{equation} for example \label{eq:1}\end{equation}}
+this one.
 
 Some equations might be on start of paragraphs:
 
-\begin{equation} start \label{eq:2}\end{equation} of paragraph.
+\protect\hypertarget{eq:2}{}{\begin{equation} start \label{eq:2}\end{equation}}
+of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\begin{equation} separate \label{eq:3}\end{equation}
+\protect\hypertarget{eq:3}{}{\begin{equation} separate \label{eq:3}\end{equation}}
 
 Then they can be referenced:
 
diff --git a/test/m2m/equations-auto/expect.tex b/test/m2m/equations-auto/expect.tex
--- a/test/m2m/equations-auto/expect.tex
+++ b/test/m2m/equations-auto/expect.tex
@@ -1,32 +1,34 @@
 This is a test file with some referenced equations, line
-\begin{equation} this \end{equation}
+{\begin{equation} this \end{equation}}
 
 Some equations might be inside of text,
-\begin{equation} for example \end{equation} this one.
+{\begin{equation} for example \end{equation}} this one.
 
 Some equations might be on start of paragraphs:
 
-\begin{equation} start \end{equation} of paragraph.
+{\begin{equation} start \end{equation}} of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\begin{equation} separate \end{equation}
+{\begin{equation} separate \end{equation}}
 
 Some of those can be labelled:
 
 This is a test file with some referenced equations, line
-\begin{equation} this \label{eq:0}\end{equation}
+\protect\hypertarget{eq:0}{}{\begin{equation} this \label{eq:0}\end{equation}}
 
 Some equations might be inside of text,
-\begin{equation} for example \label{eq:1}\end{equation} this one.
+\protect\hypertarget{eq:1}{}{\begin{equation} for example \label{eq:1}\end{equation}}
+this one.
 
 Some equations might be on start of paragraphs:
 
-\begin{equation} start \label{eq:2}\end{equation} of paragraph.
+\protect\hypertarget{eq:2}{}{\begin{equation} start \label{eq:2}\end{equation}}
+of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\begin{equation} separate \label{eq:3}\end{equation}
+\protect\hypertarget{eq:3}{}{\begin{equation} separate \label{eq:3}\end{equation}}
 
 Then they can be referenced:
 
diff --git a/test/m2m/equations-tables-auto/expect.tex b/test/m2m/equations-tables-auto/expect.tex
--- a/test/m2m/equations-tables-auto/expect.tex
+++ b/test/m2m/equations-tables-auto/expect.tex
@@ -1,32 +1,34 @@
 This is a test file with some referenced equations, line
-\begin{equation} this \end{equation}
+{\begin{equation} this \end{equation}}
 
 Some equations might be inside of text,
-\begin{equation} for example \end{equation} this one.
+{\begin{equation} for example \end{equation}} this one.
 
 Some equations might be on start of paragraphs:
 
-\begin{equation} start \end{equation} of paragraph.
+{\begin{equation} start \end{equation}} of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\begin{equation} separate \end{equation}
+{\begin{equation} separate \end{equation}}
 
 Some of those can be labelled:
 
 This is a test file with some referenced equations, line
-\begin{equation} this \label{eq:0}\end{equation}
+\protect\hypertarget{eq:0}{}{\begin{equation} this \label{eq:0}\end{equation}}
 
 Some equations might be inside of text,
-\begin{equation} for example \label{eq:1}\end{equation} this one.
+\protect\hypertarget{eq:1}{}{\begin{equation} for example \label{eq:1}\end{equation}}
+this one.
 
 Some equations might be on start of paragraphs:
 
-\begin{equation} start \label{eq:2}\end{equation} of paragraph.
+\protect\hypertarget{eq:2}{}{\begin{equation} start \label{eq:2}\end{equation}}
+of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\begin{equation} separate \label{eq:3}\end{equation}
+\protect\hypertarget{eq:3}{}{\begin{equation} separate \label{eq:3}\end{equation}}
 
 Then they can be referenced:
 
diff --git a/test/m2m/equations-tables/expect.tex b/test/m2m/equations-tables/expect.tex
--- a/test/m2m/equations-tables/expect.tex
+++ b/test/m2m/equations-tables/expect.tex
@@ -13,18 +13,20 @@
 Some of those can be labelled:
 
 This is a test file with some referenced equations, line
-\begin{equation} this \label{eq:0}\end{equation}
+\protect\hypertarget{eq:0}{}{\begin{equation} this \label{eq:0}\end{equation}}
 
 Some equations might be inside of text,
-\begin{equation} for example \label{eq:1}\end{equation} this one.
+\protect\hypertarget{eq:1}{}{\begin{equation} for example \label{eq:1}\end{equation}}
+this one.
 
 Some equations might be on start of paragraphs:
 
-\begin{equation} start \label{eq:2}\end{equation} of paragraph.
+\protect\hypertarget{eq:2}{}{\begin{equation} start \label{eq:2}\end{equation}}
+of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\begin{equation} separate \label{eq:3}\end{equation}
+\protect\hypertarget{eq:3}{}{\begin{equation} separate \label{eq:3}\end{equation}}
 
 Then they can be referenced:
 
diff --git a/test/m2m/equations/expect.tex b/test/m2m/equations/expect.tex
--- a/test/m2m/equations/expect.tex
+++ b/test/m2m/equations/expect.tex
@@ -13,18 +13,20 @@
 Some of those can be labelled:
 
 This is a test file with some referenced equations, line
-\begin{equation} this \label{eq:0}\end{equation}
+\protect\hypertarget{eq:0}{}{\begin{equation} this \label{eq:0}\end{equation}}
 
 Some equations might be inside of text,
-\begin{equation} for example \label{eq:1}\end{equation} this one.
+\protect\hypertarget{eq:1}{}{\begin{equation} for example \label{eq:1}\end{equation}}
+this one.
 
 Some equations might be on start of paragraphs:
 
-\begin{equation} start \label{eq:2}\end{equation} of paragraph.
+\protect\hypertarget{eq:2}{}{\begin{equation} start \label{eq:2}\end{equation}}
+of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\begin{equation} separate \label{eq:3}\end{equation}
+\protect\hypertarget{eq:3}{}{\begin{equation} separate \label{eq:3}\end{equation}}
 
 Then they can be referenced:
 
diff --git a/test/m2m/links-names/expect.tex b/test/m2m/links-names/expect.tex
--- a/test/m2m/links-names/expect.tex
+++ b/test/m2m/links-names/expect.tex
@@ -13,18 +13,20 @@
 Some of those can be labelled:
 
 This is a test file with some referenced equations, line
-\begin{equation} this \label{eq:0}\end{equation}
+\protect\hypertarget{eq:0}{}{\begin{equation} this \label{eq:0}\end{equation}}
 
 Some equations might be inside of text,
-\begin{equation} for example \label{eq:1}\end{equation} this one.
+\protect\hypertarget{eq:1}{}{\begin{equation} for example \label{eq:1}\end{equation}}
+this one.
 
 Some equations might be on start of paragraphs:
 
-\begin{equation} start \label{eq:2}\end{equation} of paragraph.
+\protect\hypertarget{eq:2}{}{\begin{equation} start \label{eq:2}\end{equation}}
+of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\begin{equation} separate \label{eq:3}\end{equation}
+\protect\hypertarget{eq:3}{}{\begin{equation} separate \label{eq:3}\end{equation}}
 
 Then they can be referenced:
 
diff --git a/test/m2m/links/expect.tex b/test/m2m/links/expect.tex
--- a/test/m2m/links/expect.tex
+++ b/test/m2m/links/expect.tex
@@ -13,18 +13,20 @@
 Some of those can be labelled:
 
 This is a test file with some referenced equations, line
-\begin{equation} this \label{eq:0}\end{equation}
+\protect\hypertarget{eq:0}{}{\begin{equation} this \label{eq:0}\end{equation}}
 
 Some equations might be inside of text,
-\begin{equation} for example \label{eq:1}\end{equation} this one.
+\protect\hypertarget{eq:1}{}{\begin{equation} for example \label{eq:1}\end{equation}}
+this one.
 
 Some equations might be on start of paragraphs:
 
-\begin{equation} start \label{eq:2}\end{equation} of paragraph.
+\protect\hypertarget{eq:2}{}{\begin{equation} start \label{eq:2}\end{equation}}
+of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\begin{equation} separate \label{eq:3}\end{equation}
+\protect\hypertarget{eq:3}{}{\begin{equation} separate \label{eq:3}\end{equation}}
 
 Then they can be referenced:
 
diff --git a/test/test-pandoc-crossref.hs b/test/test-pandoc-crossref.hs
--- a/test/test-pandoc-crossref.hs
+++ b/test/test-pandoc-crossref.hs
@@ -307,7 +307,7 @@
         it "Eqn labels" $
           equation "x^2" "some_equation1"
             <> para (citeGen "eq:some_equation" [1])
-            `test` "\\begin{equation}x^2\\label{eq:some_equation1}\\end{equation}\n\neq.~\\ref{eq:some_equation1}"
+            `test` "\\protect\\hypertarget{eq:some_equation1}{}{\\begin{equation}x^2\\label{eq:some_equation1}\\end{equation}}\n\neq.~\\ref{eq:some_equation1}"
 
 #ifdef FLAKY
         it "Tbl labels" $
