diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,14 @@
+## 0.3.18.1
+
+-   Minor refactor to avoid new warnings introduced in GHC 9.8.
+
+-   Switch CI compiler to GHC 9.8.4.
+
+-   Add some potentially useful references to the documentation.
+
+-   Fix image scaling in docx for `subfigGrid`. See
+    [#394](https://github.com/lierdakil/pandoc-crossref/issues/394) for details.
+
 ## 0.3.18.0
 
 -   Add `eqnInlineTableTemplate` and `eqnDisplayTemplate` options.
diff --git a/docs/index.md b/docs/index.md
--- a/docs/index.md
+++ b/docs/index.md
@@ -1,16 +1,40 @@
 ---
 author: Nikolay Yakimov
-date: November 2017
+date: December 2024
 title: 'pandoc-crossref(1)'
 ---
 
 pandoc-crossref is a pandoc filter for numbering figures, equations,
 tables and cross-references to them.
 
+Bug tracker: <https://github.com/lierdakil/pandoc-crossref/issues>
+
 * TOC
 {:toc}
 
 # Caveats
+
+## LaTeX input (a.k.a. converting LaTeX to docx/epub/etc)
+
+The principal aim of pandoc-crossref is to add references to Markdown.
+
+Other input formats may happen to work also (basically if you can make Pandoc
+citation syntax to work), but that's more of a happy coincidence than a
+deliberate design decision.
+
+In particular, LaTeX syntax is generally not recognized, although under some
+specific conditions it may seem to kinda-sorta work.
+
+Converting TeX to anything editable in general is nigh impossible, with TeX
+being a Turing-complete layout language rather than a markup language. That was
+one of the motivations for pandoc-crossref in the first place.
+
+All that said, if you really need to use LaTeX as an input format, see the
+discussions in <https://github.com/lierdakil/pandoc-crossref/issues/250>.
+
+For best results, consider using a purpose-built filter instead of
+pandoc-crossref. For example,
+[pandoc-text-numbering](https://github.com/fncokg/pandoc-tex-numbering).
 
 ## LaTeX output and `--include-in-header`
 
diff --git a/lib-internal/Text/Pandoc/CrossRef/References/Blocks/Subfigures.hs b/lib-internal/Text/Pandoc/CrossRef/References/Blocks/Subfigures.hs
--- a/lib-internal/Text/Pandoc/CrossRef/References/Blocks/Subfigures.hs
+++ b/lib-internal/Text/Pandoc/CrossRef/References/Blocks/Subfigures.hs
@@ -127,13 +127,19 @@
           = perc/100.0
           | otherwise = error "Only percent allowed in subfigure width!"
         blkToRow :: Block -> [Block]
-        blkToRow (Para inls) = mapMaybe inlToCell inls
+        blkToRow (Para inls) = zipWith inlToCell widths $ mapMaybe getImg inls
         blkToRow x = [x]
-        inlToCell :: Inline -> Maybe Block
-        inlToCell (Image (id', cs, as) txt tgt) = Just $
-          Figure (id', cs, []) (Caption Nothing [Para txt]) [Plain [Image ("", cs, setW as) txt tgt]]
-        inlToCell _ = Nothing
-        setW as = ("width", "100%"):filter ((/="width") . fst) as
+        getImg (Image (id', cs, as) txt tgt) = Just (id', cs, as, txt, tgt)
+        getImg _ = Nothing
+        inlToCell w (id', cs, as, txt, tgt) =
+          Figure (id', cs, []) (Caption Nothing [Para txt]) [Plain [Image ("", cs, setW w as) txt tgt]]
+        setW w as = ("width", width):filter ((/="width") . fst) as
+          where
+            -- With docx, since pandoc 3.0, 100% is interpreted as "page width",
+            -- even in table cells. Hence, this hack.
+            width
+              | isDocxFormat opts = T.pack (show $ w * 100) <> "%"
+              | otherwise = "100%"
 
 replaceSubfigs :: [Inline] -> WS (ReplacedResult [Inline])
 replaceSubfigs = (replaceNoRecurse . concat) <=< mapM replaceSubfig
@@ -218,6 +224,8 @@
       caption' = Caption short (walkReplaceInlines title' title btitle:rest)
   replaceNoRecurse $
     if subFigure && isLatexFormat opts
-    then Plain $ latexSubFigure (head $ blocksToInlines content) label
+    then Plain $ case blocksToInlines content of
+      ctHead:_ -> latexSubFigure ctHead label
+      _ -> error "The impossible happened: empty content in subfigures"
     else Figure (label,cls,setLabel opts idxStr fattrs) caption' (content' title')
 runFigure _ _ _ _ = noReplaceNoRecurse
diff --git a/lib-internal/Text/Pandoc/CrossRef/References/Refs.hs b/lib-internal/Text/Pandoc/CrossRef/References/Refs.hs
--- a/lib-internal/Text/Pandoc/CrossRef/References/Refs.hs
+++ b/lib-internal/Text/Pandoc/CrossRef/References/Refs.hs
@@ -33,6 +33,8 @@
 import qualified Data.Sequence as S
 import Data.Sequence (ViewR(..))
 import Control.Monad (liftM2, join)
+import qualified Data.List.NonEmpty as NE
+import Data.List.NonEmpty (NonEmpty)
 
 import Debug.Trace
 import Lens.Micro.Mtl
@@ -45,25 +47,25 @@
 replaceRefs :: [Inline] -> WS [Inline]
 replaceRefs (Cite cits _:xs) = do
   opts <- ask :: WS Options
-  toList . (<> fromList xs) . intercalate' (text ", ") . map fromList <$> mapM (replaceRefs' opts) (groupBy eqPrefix cits)
+  toList . (<> fromList xs) . intercalate' (text ", ") . map fromList <$> mapM (replaceRefs' opts) (NE.groupBy eqPrefix cits)
   where
     eqPrefix a b = uncurry (==) $
       (fmap uncapitalizeFirst . getLabelPrefix . citationId) <***> (a,b)
     (<***>) = join (***)
-    replaceRefs' :: Options -> [Citation] -> WS [Inline]
+    replaceRefs' :: Options -> NonEmpty Citation -> WS [Inline]
     replaceRefs' opts cits'
       | Just prefix <- allCitsPrefix cits'
       = replaceRefs'' opts prefix cits'
-      | otherwise = return [Cite cits' il']
+      | otherwise = return [Cite (NE.toList cits') il']
         where
           il' = toList $
               str "["
-            <> intercalate' (text "; ") (map citationToInlines cits')
+            <> intercalate' (text "; ") (map citationToInlines $ NE.toList cits')
             <> str "]"
           citationToInlines c =
             fromList (citationPrefix c) <> text ("@" <> citationId c)
               <> fromList (citationSuffix c)
-    replaceRefs'' :: Options -> Prefix -> [Citation] -> WS [Inline]
+    replaceRefs'' :: Options -> Prefix -> NonEmpty Citation -> WS [Inline]
     replaceRefs'' opts = ($ opts) . flip $
       if isLatexFormat opts
       then replaceRefsLatex
@@ -106,21 +108,21 @@
   where (refprefixf, reftempl) = prefMap prefix
         refprefix = refprefixf opts capitalize num
 
-allCitsPrefix :: [Citation] -> Maybe Prefix
+allCitsPrefix :: NonEmpty Citation -> Maybe Prefix
 allCitsPrefix cits = find isCitationPrefix prefixes
   where
   isCitationPrefix p =
     all ((pfxMapR p `T.isPrefixOf`) . uncapitalizeFirst . citationId) cits
 
-replaceRefsLatex :: Prefix -> Options -> [Citation] -> WS [Inline]
+replaceRefsLatex :: Prefix -> Options -> NonEmpty Citation -> WS [Inline]
 replaceRefsLatex prefix opts cits
   | cref opts
   = replaceRefsLatex' prefix opts cits
   | otherwise
   = toList . intercalate' (text ", ") . map fromList <$>
-      mapM (replaceRefsLatex' prefix opts) (groupBy citationGroupPred cits)
+      mapM (replaceRefsLatex' prefix opts) (NE.groupBy citationGroupPred cits)
 
-replaceRefsLatex' :: Prefix -> Options -> [Citation] -> WS [Inline]
+replaceRefsLatex' :: Prefix -> Options -> NonEmpty Citation -> WS [Inline]
 replaceRefsLatex' prefix opts cits =
   return $ p [texcit]
   where
@@ -137,16 +139,19 @@
       = id
       | noPrefix
       = getRefPrefix opts prefix cap (length cits - 1)
-      | otherwise = ((citationPrefix (head cits) <> [Space]) <>)
-    cap = maybe False isFirstUpper $ getLabelPrefix . citationId . head $ cits
+      | otherwise = ((citationPrefix (NE.head cits) <> [Space]) <>)
+    cap = maybe False isFirstUpper $ getLabelPrefix . citationId . NE.head $ cits
     cref' | suppressAuthor = "\\labelcref"
           | cap = "\\Cref"
           | otherwise = "\\cref"
 
-listLabels :: Prefix -> T.Text -> T.Text -> T.Text -> [Citation] -> T.Text
-listLabels prefix p sep s =
-  T.intercalate sep . map ((p <>) . (<> s) . mkLaTeXLabel' . (pfxMapR prefix <>) . getLabelWithoutPrefix . citationId)
+listLabels :: Prefix -> T.Text -> T.Text -> T.Text -> NonEmpty Citation -> T.Text
+listLabels prefix p sep s
+  = T.intercalate sep
+  . map ((p <>) . (<> s) . mkLaTeXLabel' . (pfxMapR prefix <>) . getLabelWithoutPrefix . citationId)
+  . NE.toList
 
+
 getLabelWithoutPrefix :: T.Text -> T.Text
 getLabelWithoutPrefix = T.drop 1 . T.dropWhile (/=':')
 
@@ -157,24 +162,24 @@
   | otherwise = Nothing
   where p = flip T.snoc ':' . T.takeWhile (/=':') $ lab
 
-replaceRefsOther :: Prefix -> Options -> [Citation] -> WS [Inline]
+replaceRefsOther :: Prefix -> Options -> NonEmpty Citation -> WS [Inline]
 replaceRefsOther prefix opts cits = toList . intercalate' (text ", ") . map fromList <$>
-    mapM (replaceRefsOther' prefix opts) (groupBy citationGroupPred cits)
+    traverse (replaceRefsOther' prefix opts) (NE.groupBy citationGroupPred cits)
 
 citationGroupPred :: Citation -> Citation -> Bool
 citationGroupPred = (==) `on` liftM2 (,) citationPrefix citationMode
 
-replaceRefsOther' :: Prefix -> Options -> [Citation] -> WS [Inline]
+replaceRefsOther' :: Prefix -> Options -> NonEmpty Citation -> WS [Inline]
 replaceRefsOther' prefix opts cits = do
-  indices <- mapM (getRefIndex prefix opts) cits
+  indices <- mapM (getRefIndex prefix opts) $ NE.toList cits
   let
-    cap = maybe False isFirstUpper $ getLabelPrefix . citationId . head $ cits
+    cap = maybe False isFirstUpper $ getLabelPrefix . citationId . NE.head $ cits
     writePrefix | all ((==SuppressAuthor) . citationMode) cits
                 = id
                 | all (null . citationPrefix) cits
                 = cmap $ getRefPrefix opts prefix cap (length cits - 1)
                 | otherwise
-                = cmap $ toList . ((fromList (citationPrefix (head cits)) <> space) <>) . fromList
+                = cmap $ toList . ((fromList (citationPrefix (NE.head cits)) <> space) <>) . fromList
     cmap f [Link attr t w]
       | nameInLink opts = [Link attr (f t) w]
     cmap f x = f x
diff --git a/lib-internal/Text/Pandoc/CrossRef/Util/Options.hs b/lib-internal/Text/Pandoc/CrossRef/Util/Options.hs
--- a/lib-internal/Text/Pandoc/CrossRef/Util/Options.hs
+++ b/lib-internal/Text/Pandoc/CrossRef/Util/Options.hs
@@ -20,7 +20,7 @@
 
 {-# LANGUAGE OverloadedStrings#-}
 
-module Text.Pandoc.CrossRef.Util.Options (Options(..), isLatexFormat) where
+module Text.Pandoc.CrossRef.Util.Options (Options(..), isLatexFormat, isDocxFormat) where
 import Data.Text (Text)
 import Text.Pandoc.CrossRef.Util.Template
 import Text.Pandoc.CrossRef.Util.Util (isFormat)
@@ -85,3 +85,6 @@
 
 isLatexFormat :: Options -> Bool
 isLatexFormat = ((||) <$> (isFormat "latex") <*> (isFormat "beamer")) . outFormat
+
+isDocxFormat :: Options -> Bool
+isDocxFormat = isFormat "docx" . outFormat
diff --git a/pandoc-crossref.cabal b/pandoc-crossref.cabal
--- a/pandoc-crossref.cabal
+++ b/pandoc-crossref.cabal
@@ -5,7 +5,7 @@
 -- see: https://github.com/sol/hpack
 
 name:           pandoc-crossref
-version:        0.3.18.0
+version:        0.3.18.1
 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
@@ -139,7 +139,7 @@
   build-depends:
       base >=4.11 && <5
     , mtl >=1.1 && <2.4
-    , pandoc >=3.1.8 && <3.5
+    , pandoc >=3.1.8 && <3.7
     , pandoc-crossref-internal
     , pandoc-types ==1.23.*
     , text >=1.2.2 && <2.2
@@ -183,7 +183,7 @@
     , microlens-mtl >=0.2.0.1 && <0.3.0.0
     , microlens-th >=0.4.3.10 && <0.5.0.0
     , mtl >=1.1 && <2.4
-    , pandoc >=3.1.8 && <3.5
+    , pandoc >=3.1.8 && <3.7
     , pandoc-types ==1.23.*
     , syb >=0.4 && <0.8
     , template-haskell >=2.7.0.0 && <3.0.0.0
@@ -204,7 +204,7 @@
     , gitrev >=1.3.1 && <1.4
     , open-browser ==0.2.*
     , optparse-applicative >=0.13 && <0.19
-    , pandoc >=3.1.8 && <3.5
+    , pandoc >=3.1.8 && <3.7
     , pandoc-crossref
     , pandoc-types ==1.23.*
     , template-haskell >=2.7.0.0 && <3.0.0.0
@@ -225,7 +225,7 @@
     , directory >=1 && <1.4
     , filepath >=1.1 && <1.6
     , hspec >=2.4.4 && <3
-    , pandoc >=3.1.8 && <3.5
+    , pandoc >=3.1.8 && <3.7
     , pandoc-crossref
     , pandoc-types ==1.23.*
     , text >=1.2.2 && <2.2
@@ -251,7 +251,7 @@
     , hspec >=2.4.4 && <3
     , microlens >=0.4.12.0 && <0.5.0.0
     , mtl >=1.1 && <2.4
-    , pandoc >=3.1.8 && <3.5
+    , pandoc >=3.1.8 && <3.7
     , pandoc-crossref
     , pandoc-crossref-internal
     , pandoc-types ==1.23.*
@@ -271,7 +271,7 @@
   build-depends:
       base >=4.11 && <5
     , criterion >=1.5.9.0 && <1.7
-    , pandoc >=3.1.8 && <3.5
+    , pandoc >=3.1.8 && <3.7
     , pandoc-crossref
     , pandoc-types ==1.23.*
     , text >=1.2.2 && <2.2
