diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,11 @@
+## 0.3.26
+
+-   Update for pandoc 3.12. No functional changes.
+
+## 0.3.25
+
+-   Update for pandoc 3.10. No functional changes.
+
 ## 0.3.24
 
 -   Fix for #506
diff --git a/pandoc-crossref.cabal b/pandoc-crossref.cabal
--- a/pandoc-crossref.cabal
+++ b/pandoc-crossref.cabal
@@ -1,11 +1,11 @@
 cabal-version: 2.0
 
--- This file has been generated from package.yaml by hpack version 0.38.1.
+-- This file has been generated from package.yaml by hpack version 0.38.3.
 --
 -- see: https://github.com/sol/hpack
 
 name:           pandoc-crossref
-version:        0.3.25
+version:        0.3.26
 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
@@ -178,10 +178,10 @@
   ghc-options: -Wall
   build-depends:
       base >=4.19 && <5
-    , microlens >=0.4.12.0 && <0.5.0.0
-    , microlens-mtl >=0.2.0.1 && <0.3.0.0
+    , microlens >=0.4.12 && <0.6
+    , microlens-mtl >=0.2.0.1 && <0.3
     , mtl >=1.1 && <2.4
-    , pandoc ==3.10.*
+    , pandoc ==3.12.*
     , pandoc-crossref-internal
     , pandoc-types ==1.23.*
     , text >=1.2.2 && <2.2
@@ -230,17 +230,17 @@
     , data-default >=0.4 && <0.9
     , directory >=1 && <1.4
     , filepath >=1.1 && <1.6
-    , microlens >=0.4.12.0 && <0.5.0.0
-    , microlens-ghc >=0.4.3.10 && <0.5.0.0
-    , microlens-mtl >=0.2.0.1 && <0.3.0.0
-    , microlens-th >=0.4.3.10 && <0.5.0.0
+    , microlens >=0.4.12 && <0.6
+    , microlens-ghc >=0.4.3.10 && <0.5
+    , microlens-mtl >=0.2.0.1 && <0.3
+    , microlens-th >=0.4.3.10 && <0.5
     , mtl >=1.1 && <2.4
-    , pandoc ==3.10.*
+    , pandoc ==3.12.*
     , pandoc-types ==1.23.*
     , syb >=0.4 && <0.8
-    , template-haskell >=2.7.0.0 && <3.0.0.0
+    , template-haskell >=2.7 && <3
     , text >=1.2.2 && <2.2
-    , utility-ht >=0.0.11 && <0.1.0
+    , utility-ht >=0.0.11 && <0.1
   default-language: GHC2021
 
 executable pandoc-crossref
@@ -263,12 +263,12 @@
       base >=4.19 && <5
     , deepseq >=1.4 && <1.6
     , gitrev >=1.3.1 && <1.4
-    , open-browser >=0.2 && <0.4
+    , open-browser >=0.2 && <0.6
     , optparse-applicative >=0.13 && <0.20
-    , pandoc ==3.10.*
+    , pandoc ==3.12.*
     , pandoc-crossref
     , pandoc-types ==1.23.*
-    , template-haskell >=2.7.0.0 && <3.0.0.0
+    , template-haskell >=2.7 && <3
     , temporary >=1.2 && <1.4
     , text >=1.2.2 && <2.2
   default-language: GHC2021
@@ -295,7 +295,7 @@
     , directory >=1 && <1.4
     , filepath >=1.1 && <1.6
     , hspec >=2.4.4 && <3
-    , pandoc ==3.10.*
+    , pandoc ==3.12.*
     , pandoc-crossref
     , pandoc-types ==1.23.*
     , text >=1.2.2 && <2.2
@@ -328,10 +328,10 @@
     , containers >=0.1 && <0.9
     , data-default >=0.4 && <0.9
     , hspec >=2.4.4 && <3
-    , microlens >=0.4.12.0 && <0.5.0.0
-    , microlens-mtl >=0.2.0.1 && <0.3.0.0
+    , microlens >=0.4.12 && <0.6
+    , microlens-mtl >=0.2.0.1 && <0.3
     , mtl >=1.1 && <2.4
-    , pandoc ==3.10.*
+    , pandoc ==3.12.*
     , pandoc-crossref
     , pandoc-crossref-internal
     , pandoc-types ==1.23.*
@@ -359,8 +359,8 @@
   ghc-options: -Wall -fno-warn-unused-do-bind -threaded
   build-depends:
       base >=4.19 && <5
-    , criterion >=1.5.9.0 && <1.7
-    , pandoc ==3.10.*
+    , criterion >=1.5.9 && <1.7
+    , pandoc ==3.12.*
     , pandoc-crossref
     , pandoc-types ==1.23.*
     , text >=1.2.2 && <2.2
diff --git a/test/demo-chapters.inc b/test/demo-chapters.inc
--- a/test/demo-chapters.inc
+++ b/test/demo-chapters.inc
@@ -563,8 +563,7 @@
   , Para
       [ Span
           ( "eq:eqn1" , [] , [] )
-          [ Math
-              DisplayMath " P_i(x) = \\sum_i a_i x^i \\qquad{(2.1)}"
+          [ Math DisplayMath "P_i(x) = \\sum_i a_i x^i\\qquad{(2.1)}"
           ]
       ]
   , Para
@@ -1074,7 +1073,7 @@
           ( "eq:eqn2" , [] , [] )
           [ Math
               DisplayMath
-              " S(x) = \\int_{x_1}^{x_2} a x+b \\  \\mathrm{d}x \\qquad{(4.1)}"
+              "S(x) = \\int_{x_1}^{x_2} a x+b \\  \\mathrm{d}x\\qquad{(4.1)}"
           ]
       ]
   , Header
diff --git a/test/demo.inc b/test/demo.inc
--- a/test/demo.inc
+++ b/test/demo.inc
@@ -563,8 +563,7 @@
   , Para
       [ Span
           ( "eq:eqn1" , [] , [] )
-          [ Math DisplayMath " P_i(x) = \\sum_i a_i x^i \\qquad{(1)}"
-          ]
+          [ Math DisplayMath "P_i(x) = \\sum_i a_i x^i\\qquad{(1)}" ]
       ]
   , Para
       [ Str "Since"
@@ -1073,7 +1072,7 @@
           ( "eq:eqn2" , [] , [] )
           [ Math
               DisplayMath
-              " S(x) = \\int_{x_1}^{x_2} a x+b \\  \\mathrm{d}x \\qquad{(3)}"
+              "S(x) = \\int_{x_1}^{x_2} a x+b \\  \\mathrm{d}x\\qquad{(3)}"
           ]
       ]
   , Header
diff --git a/test/m2m/altAttribute/expect.tex b/test/m2m/altAttribute/expect.tex
--- a/test/m2m/altAttribute/expect.tex
+++ b/test/m2m/altAttribute/expect.tex
@@ -1,6 +1,7 @@
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={Problem 1 description of overlapping sets}]{./Slide1.PNG}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={Problem 1
+description of overlapping sets}]{./Slide1.PNG}}
 \caption{A medium length description about sets
 \(\{\oplus ,\Phi ,\kappa \}\). See footnote for long
 description{[}\^{}1{]}}\label{fig:one}
diff --git a/test/m2m/delim/expect.md b/test/m2m/delim/expect.md
--- a/test/m2m/delim/expect.md
+++ b/test/m2m/delim/expect.md
@@ -1,30 +1,30 @@
-This is a test file with some referenced equations, line $$ this $$
+This is a test file with some referenced equations, line $$this$$
 
-Some equations might be inside of text, $$ for example $$ this one.
+Some equations might be inside of text, $$for example$$ this one.
 
 Some equations might be on start of paragraphs:
 
-$$ start $$ of paragraph.
+$$start$$ of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-$$ separate $$
+$$separate$$
 
 Some of those can be labelled:
 
 This is a test file with some referenced equations, line
-[$$ this \qquad{(1)}$$]{#eq:0}
+[$$this\qquad{(1)}$$]{#eq:0}
 
 Some equations might be inside of text,
-[$$ for example \qquad{(2)}$$]{#eq:1} this one.
+[$$for example\qquad{(2)}$$]{#eq:1} this one.
 
 Some equations might be on start of paragraphs:
 
-[$$ start \qquad{(3)}$$]{#eq:2} of paragraph.
+[$$start\qquad{(3)}$$]{#eq:2} of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-[$$ separate \qquad{(4)}$$]{#eq:3}
+[$$separate\qquad{(4)}$$]{#eq:3}
 
 Then they can be referenced:
 
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
@@ -1,32 +1,32 @@
-This is a test file with some referenced equations, line \[ this \]
+This is a test file with some referenced equations, line \[this\]
 
-Some equations might be inside of text, \[ for example \] this one.
+Some equations might be inside of text, \[for example\] this one.
 
 Some equations might be on start of paragraphs:
 
-\[ start \] of paragraph.
+\[start\] of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\[ separate \]
+\[separate\]
 
 Some of those can be labelled:
 
 This is a test file with some referenced equations, line
-\begin{equation}\protect\phantomsection\label{eq:0}{ this }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:0}{this}\end{equation}
 
 Some equations might be inside of text,
-\begin{equation}\protect\phantomsection\label{eq:1}{ for example }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:1}{for example}\end{equation}
 this one.
 
 Some equations might be on start of paragraphs:
 
-\begin{equation}\protect\phantomsection\label{eq:2}{ start }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:2}{start}\end{equation}
 of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\begin{equation}\protect\phantomsection\label{eq:3}{ separate }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:3}{separate}\end{equation}
 
 Then they can be referenced:
 
diff --git a/test/m2m/equationNumberLaTeX/expect.md b/test/m2m/equationNumberLaTeX/expect.md
--- a/test/m2m/equationNumberLaTeX/expect.md
+++ b/test/m2m/equationNumberLaTeX/expect.md
@@ -1,30 +1,30 @@
-This is a test file with some referenced equations, line $$ this $$
+This is a test file with some referenced equations, line $$this$$
 
-Some equations might be inside of text, $$ for example $$ this one.
+Some equations might be inside of text, $$for example$$ this one.
 
 Some equations might be on start of paragraphs:
 
-$$ start $$ of paragraph.
+$$start$$ of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-$$ separate $$
+$$separate$$
 
 Some of those can be labelled:
 
 This is a test file with some referenced equations, line
-[$$ this \tag{1}$$]{#eq:0}
+[$$this\tag{1}$$]{#eq:0}
 
-Some equations might be inside of text,
-[$$ for example \tag{2}$$]{#eq:1} this one.
+Some equations might be inside of text, [$$for example\tag{2}$$]{#eq:1}
+this one.
 
 Some equations might be on start of paragraphs:
 
-[$$ start \tag{3}$$]{#eq:2} of paragraph.
+[$$start\tag{3}$$]{#eq:2} of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-[$$ separate \tag{4}$$]{#eq:3}
+[$$separate\tag{4}$$]{#eq:3}
 
 Then they can be referenced:
 
diff --git a/test/m2m/equationNumberLaTeX/expect.tex b/test/m2m/equationNumberLaTeX/expect.tex
--- a/test/m2m/equationNumberLaTeX/expect.tex
+++ b/test/m2m/equationNumberLaTeX/expect.tex
@@ -1,32 +1,32 @@
-This is a test file with some referenced equations, line \[ this \]
+This is a test file with some referenced equations, line \[this\]
 
-Some equations might be inside of text, \[ for example \] this one.
+Some equations might be inside of text, \[for example\] this one.
 
 Some equations might be on start of paragraphs:
 
-\[ start \] of paragraph.
+\[start\] of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\[ separate \]
+\[separate\]
 
 Some of those can be labelled:
 
 This is a test file with some referenced equations, line
-\begin{equation}\protect\phantomsection\label{eq:0}{ this }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:0}{this}\end{equation}
 
 Some equations might be inside of text,
-\begin{equation}\protect\phantomsection\label{eq:1}{ for example }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:1}{for example}\end{equation}
 this one.
 
 Some equations might be on start of paragraphs:
 
-\begin{equation}\protect\phantomsection\label{eq:2}{ start }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:2}{start}\end{equation}
 of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\begin{equation}\protect\phantomsection\label{eq:3}{ separate }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:3}{separate}\end{equation}
 
 Then they can be referenced:
 
diff --git a/test/m2m/equations-auto/expect.md b/test/m2m/equations-auto/expect.md
--- a/test/m2m/equations-auto/expect.md
+++ b/test/m2m/equations-auto/expect.md
@@ -1,32 +1,32 @@
 This is a test file with some referenced equations, line
-$$ this \qquad{(1)}$$
+$$this\qquad{(1)}$$
 
-Some equations might be inside of text, $$ for example \qquad{(2)}$$
-this one.
+Some equations might be inside of text, $$for example\qquad{(2)}$$ this
+one.
 
 Some equations might be on start of paragraphs:
 
-$$ start \qquad{(3)}$$ of paragraph.
+$$start\qquad{(3)}$$ of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-$$ separate \qquad{(4)}$$
+$$separate\qquad{(4)}$$
 
 Some of those can be labelled:
 
 This is a test file with some referenced equations, line
-[$$ this \qquad{(5)}$$]{#eq:0}
+[$$this\qquad{(5)}$$]{#eq:0}
 
 Some equations might be inside of text,
-[$$ for example \qquad{(6)}$$]{#eq:1} this one.
+[$$for example\qquad{(6)}$$]{#eq:1} this one.
 
 Some equations might be on start of paragraphs:
 
-[$$ start \qquad{(7)}$$]{#eq:2} of paragraph.
+[$$start\qquad{(7)}$$]{#eq:2} of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-[$$ separate \qquad{(8)}$$]{#eq:3}
+[$$separate\qquad{(8)}$$]{#eq:3}
 
 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,34 +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}\protect\phantomsection\label{eq:0}{ this }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:0}{this}\end{equation}
 
 Some equations might be inside of text,
-\begin{equation}\protect\phantomsection\label{eq:1}{ for example }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:1}{for example}\end{equation}
 this one.
 
 Some equations might be on start of paragraphs:
 
-\begin{equation}\protect\phantomsection\label{eq:2}{ start }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:2}{start}\end{equation}
 of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\begin{equation}\protect\phantomsection\label{eq:3}{ separate }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:3}{separate}\end{equation}
 
 Then they can be referenced:
 
diff --git a/test/m2m/equations-tables-auto/expect.md b/test/m2m/equations-tables-auto/expect.md
--- a/test/m2m/equations-tables-auto/expect.md
+++ b/test/m2m/equations-tables-auto/expect.md
@@ -2,7 +2,7 @@
 
 ::: {}
 +:-------------------------------------------------------------:+--------:+
-| $$ this $$                                                    | $$(1)$$ |
+| $$this$$                                                      | $$(1)$$ |
 +---------------------------------------------------------------+---------+
 :::
 
@@ -10,7 +10,7 @@
 
 ::: {}
 +:-------------------------------------------------------------:+--------:+
-| $$ for example $$                                             | $$(2)$$ |
+| $$for example$$                                               | $$(2)$$ |
 +---------------------------------------------------------------+---------+
 :::
 
@@ -20,7 +20,7 @@
 
 ::: {}
 +:-------------------------------------------------------------:+--------:+
-| $$ start $$                                                   | $$(3)$$ |
+| $$start$$                                                     | $$(3)$$ |
 +---------------------------------------------------------------+---------+
 :::
 
@@ -30,7 +30,7 @@
 
 ::: {}
 +:-------------------------------------------------------------:+--------:+
-| $$ separate $$                                                | $$(4)$$ |
+| $$separate$$                                                  | $$(4)$$ |
 +---------------------------------------------------------------+---------+
 :::
 
@@ -40,7 +40,7 @@
 
 ::: {#eq:0}
 +:-------------------------------------------------------------:+--------:+
-| $$ this $$                                                    | $$(5)$$ |
+| $$this$$                                                      | $$(5)$$ |
 +---------------------------------------------------------------+---------+
 :::
 
@@ -48,7 +48,7 @@
 
 ::: {#eq:1}
 +:-------------------------------------------------------------:+--------:+
-| $$ for example $$                                             | $$(6)$$ |
+| $$for example$$                                               | $$(6)$$ |
 +---------------------------------------------------------------+---------+
 :::
 
@@ -58,7 +58,7 @@
 
 ::: {#eq:2}
 +:-------------------------------------------------------------:+--------:+
-| $$ start $$                                                   | $$(7)$$ |
+| $$start$$                                                     | $$(7)$$ |
 +---------------------------------------------------------------+---------+
 :::
 
@@ -68,7 +68,7 @@
 
 ::: {#eq:3}
 +:-------------------------------------------------------------:+--------:+
-| $$ separate $$                                                | $$(8)$$ |
+| $$separate$$                                                  | $$(8)$$ |
 +---------------------------------------------------------------+---------+
 :::
 
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,34 +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}\protect\phantomsection\label{eq:0}{ this }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:0}{this}\end{equation}
 
 Some equations might be inside of text,
-\begin{equation}\protect\phantomsection\label{eq:1}{ for example }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:1}{for example}\end{equation}
 this one.
 
 Some equations might be on start of paragraphs:
 
-\begin{equation}\protect\phantomsection\label{eq:2}{ start }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:2}{start}\end{equation}
 of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\begin{equation}\protect\phantomsection\label{eq:3}{ separate }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:3}{separate}\end{equation}
 
 Then they can be referenced:
 
diff --git a/test/m2m/equations-tables/expect.md b/test/m2m/equations-tables/expect.md
--- a/test/m2m/equations-tables/expect.md
+++ b/test/m2m/equations-tables/expect.md
@@ -1,14 +1,14 @@
-This is a test file with some referenced equations, line $$ this $$
+This is a test file with some referenced equations, line $$this$$
 
-Some equations might be inside of text, $$ for example $$ this one.
+Some equations might be inside of text, $$for example$$ this one.
 
 Some equations might be on start of paragraphs:
 
-$$ start $$ of paragraph.
+$$start$$ of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-$$ separate $$
+$$separate$$
 
 Some of those can be labelled:
 
@@ -16,7 +16,7 @@
 
 ::: {#eq:0}
 +:-------------------------------------------------------------:+--------:+
-| $$ this $$                                                    | $$(1)$$ |
+| $$this$$                                                      | $$(1)$$ |
 +---------------------------------------------------------------+---------+
 :::
 
@@ -24,7 +24,7 @@
 
 ::: {#eq:1}
 +:-------------------------------------------------------------:+--------:+
-| $$ for example $$                                             | $$(2)$$ |
+| $$for example$$                                               | $$(2)$$ |
 +---------------------------------------------------------------+---------+
 :::
 
@@ -34,7 +34,7 @@
 
 ::: {#eq:2}
 +:-------------------------------------------------------------:+--------:+
-| $$ start $$                                                   | $$(3)$$ |
+| $$start$$                                                     | $$(3)$$ |
 +---------------------------------------------------------------+---------+
 :::
 
@@ -44,7 +44,7 @@
 
 ::: {#eq:3}
 +:-------------------------------------------------------------:+--------:+
-| $$ separate $$                                                | $$(4)$$ |
+| $$separate$$                                                  | $$(4)$$ |
 +---------------------------------------------------------------+---------+
 :::
 
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
@@ -1,32 +1,32 @@
-This is a test file with some referenced equations, line \[ this \]
+This is a test file with some referenced equations, line \[this\]
 
-Some equations might be inside of text, \[ for example \] this one.
+Some equations might be inside of text, \[for example\] this one.
 
 Some equations might be on start of paragraphs:
 
-\[ start \] of paragraph.
+\[start\] of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\[ separate \]
+\[separate\]
 
 Some of those can be labelled:
 
 This is a test file with some referenced equations, line
-\begin{equation}\protect\phantomsection\label{eq:0}{ this }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:0}{this}\end{equation}
 
 Some equations might be inside of text,
-\begin{equation}\protect\phantomsection\label{eq:1}{ for example }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:1}{for example}\end{equation}
 this one.
 
 Some equations might be on start of paragraphs:
 
-\begin{equation}\protect\phantomsection\label{eq:2}{ start }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:2}{start}\end{equation}
 of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\begin{equation}\protect\phantomsection\label{eq:3}{ separate }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:3}{separate}\end{equation}
 
 Then they can be referenced:
 
diff --git a/test/m2m/equations/expect.md b/test/m2m/equations/expect.md
--- a/test/m2m/equations/expect.md
+++ b/test/m2m/equations/expect.md
@@ -1,30 +1,30 @@
-This is a test file with some referenced equations, line $$ this $$
+This is a test file with some referenced equations, line $$this$$
 
-Some equations might be inside of text, $$ for example $$ this one.
+Some equations might be inside of text, $$for example$$ this one.
 
 Some equations might be on start of paragraphs:
 
-$$ start $$ of paragraph.
+$$start$$ of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-$$ separate $$
+$$separate$$
 
 Some of those can be labelled:
 
 This is a test file with some referenced equations, line
-[$$ this \qquad{(1)}$$]{#eq:0}
+[$$this\qquad{(1)}$$]{#eq:0}
 
 Some equations might be inside of text,
-[$$ for example \qquad{(2)}$$]{#eq:1} this one.
+[$$for example\qquad{(2)}$$]{#eq:1} this one.
 
 Some equations might be on start of paragraphs:
 
-[$$ start \qquad{(3)}$$]{#eq:2} of paragraph.
+[$$start\qquad{(3)}$$]{#eq:2} of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-[$$ separate \qquad{(4)}$$]{#eq:3}
+[$$separate\qquad{(4)}$$]{#eq:3}
 
 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
@@ -1,32 +1,32 @@
-This is a test file with some referenced equations, line \[ this \]
+This is a test file with some referenced equations, line \[this\]
 
-Some equations might be inside of text, \[ for example \] this one.
+Some equations might be inside of text, \[for example\] this one.
 
 Some equations might be on start of paragraphs:
 
-\[ start \] of paragraph.
+\[start\] of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\[ separate \]
+\[separate\]
 
 Some of those can be labelled:
 
 This is a test file with some referenced equations, line
-\begin{equation}\protect\phantomsection\label{eq:0}{ this }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:0}{this}\end{equation}
 
 Some equations might be inside of text,
-\begin{equation}\protect\phantomsection\label{eq:1}{ for example }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:1}{for example}\end{equation}
 this one.
 
 Some equations might be on start of paragraphs:
 
-\begin{equation}\protect\phantomsection\label{eq:2}{ start }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:2}{start}\end{equation}
 of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\begin{equation}\protect\phantomsection\label{eq:3}{ separate }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:3}{separate}\end{equation}
 
 Then they can be referenced:
 
diff --git a/test/m2m/label-precedence/expect.tex b/test/m2m/label-precedence/expect.tex
--- a/test/m2m/label-precedence/expect.tex
+++ b/test/m2m/label-precedence/expect.tex
@@ -4,7 +4,8 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={A figure}]{image.png}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={A
+figure}]{image.png}}
 \caption{A figure}\label{fig:fig1}
 \end{figure}
 
@@ -14,7 +15,8 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={A figure with custom label}]{image.png}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={A figure with
+custom label}]{image.png}}
 \caption{A figure with custom label}\label{fig:fig2}
 \end{figure}
 
diff --git a/test/m2m/links-names/expect.md b/test/m2m/links-names/expect.md
--- a/test/m2m/links-names/expect.md
+++ b/test/m2m/links-names/expect.md
@@ -1,30 +1,30 @@
-This is a test file with some referenced equations, line $$ this $$
+This is a test file with some referenced equations, line $$this$$
 
-Some equations might be inside of text, $$ for example $$ this one.
+Some equations might be inside of text, $$for example$$ this one.
 
 Some equations might be on start of paragraphs:
 
-$$ start $$ of paragraph.
+$$start$$ of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-$$ separate $$
+$$separate$$
 
 Some of those can be labelled:
 
 This is a test file with some referenced equations, line
-[$$ this \qquad{(1)}$$]{#eq:0}
+[$$this\qquad{(1)}$$]{#eq:0}
 
 Some equations might be inside of text,
-[$$ for example \qquad{(2)}$$]{#eq:1} this one.
+[$$for example\qquad{(2)}$$]{#eq:1} this one.
 
 Some equations might be on start of paragraphs:
 
-[$$ start \qquad{(3)}$$]{#eq:2} of paragraph.
+[$$start\qquad{(3)}$$]{#eq:2} of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-[$$ separate \qquad{(4)}$$]{#eq:3}
+[$$separate\qquad{(4)}$$]{#eq:3}
 
 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
@@ -1,32 +1,32 @@
-This is a test file with some referenced equations, line \[ this \]
+This is a test file with some referenced equations, line \[this\]
 
-Some equations might be inside of text, \[ for example \] this one.
+Some equations might be inside of text, \[for example\] this one.
 
 Some equations might be on start of paragraphs:
 
-\[ start \] of paragraph.
+\[start\] of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\[ separate \]
+\[separate\]
 
 Some of those can be labelled:
 
 This is a test file with some referenced equations, line
-\begin{equation}\protect\phantomsection\label{eq:0}{ this }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:0}{this}\end{equation}
 
 Some equations might be inside of text,
-\begin{equation}\protect\phantomsection\label{eq:1}{ for example }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:1}{for example}\end{equation}
 this one.
 
 Some equations might be on start of paragraphs:
 
-\begin{equation}\protect\phantomsection\label{eq:2}{ start }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:2}{start}\end{equation}
 of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\begin{equation}\protect\phantomsection\label{eq:3}{ separate }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:3}{separate}\end{equation}
 
 Then they can be referenced:
 
diff --git a/test/m2m/links/expect.md b/test/m2m/links/expect.md
--- a/test/m2m/links/expect.md
+++ b/test/m2m/links/expect.md
@@ -1,30 +1,30 @@
-This is a test file with some referenced equations, line $$ this $$
+This is a test file with some referenced equations, line $$this$$
 
-Some equations might be inside of text, $$ for example $$ this one.
+Some equations might be inside of text, $$for example$$ this one.
 
 Some equations might be on start of paragraphs:
 
-$$ start $$ of paragraph.
+$$start$$ of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-$$ separate $$
+$$separate$$
 
 Some of those can be labelled:
 
 This is a test file with some referenced equations, line
-[$$ this \qquad{(1)}$$]{#eq:0}
+[$$this\qquad{(1)}$$]{#eq:0}
 
 Some equations might be inside of text,
-[$$ for example \qquad{(2)}$$]{#eq:1} this one.
+[$$for example\qquad{(2)}$$]{#eq:1} this one.
 
 Some equations might be on start of paragraphs:
 
-[$$ start \qquad{(3)}$$]{#eq:2} of paragraph.
+[$$start\qquad{(3)}$$]{#eq:2} of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-[$$ separate \qquad{(4)}$$]{#eq:3}
+[$$separate\qquad{(4)}$$]{#eq:3}
 
 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
@@ -1,32 +1,32 @@
-This is a test file with some referenced equations, line \[ this \]
+This is a test file with some referenced equations, line \[this\]
 
-Some equations might be inside of text, \[ for example \] this one.
+Some equations might be inside of text, \[for example\] this one.
 
 Some equations might be on start of paragraphs:
 
-\[ start \] of paragraph.
+\[start\] of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\[ separate \]
+\[separate\]
 
 Some of those can be labelled:
 
 This is a test file with some referenced equations, line
-\begin{equation}\protect\phantomsection\label{eq:0}{ this }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:0}{this}\end{equation}
 
 Some equations might be inside of text,
-\begin{equation}\protect\phantomsection\label{eq:1}{ for example }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:1}{for example}\end{equation}
 this one.
 
 Some equations might be on start of paragraphs:
 
-\begin{equation}\protect\phantomsection\label{eq:2}{ start }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:2}{start}\end{equation}
 of paragraph.
 
 Other might be on separate paragraphs of their own:
 
-\begin{equation}\protect\phantomsection\label{eq:3}{ separate }\end{equation}
+\begin{equation}\protect\phantomsection\label{eq:3}{separate}\end{equation}
 
 Then they can be referenced:
 
diff --git a/test/m2m/listOfHidden/expect.tex b/test/m2m/listOfHidden/expect.tex
--- a/test/m2m/listOfHidden/expect.tex
+++ b/test/m2m/listOfHidden/expect.tex
@@ -5,7 +5,8 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={first figure}]{figs/fig1.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={first
+figure}]{figs/fig1.jpg}}
 \caption{first figure}\label{fig:fig1}
 \end{figure}
 
@@ -13,7 +14,8 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={second figure}]{figs/fig2.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={second
+figure}]{figs/fig2.jpg}}
 \caption{second figure}\label{fig:fig2}
 \end{figure}
 
@@ -21,7 +23,8 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={third figure}]{figs/fig3.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={third
+figure}]{figs/fig3.jpg}}
 \caption{third figure}\label{fig:fig3}
 \end{figure}
 
@@ -30,13 +33,15 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={hidden! first supp figure}]{figs/fig_s1.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={hidden! first supp
+figure}]{figs/fig_s1.jpg}}
 \caption[]{hidden! first supp figure}\label{fig:fig_s1}
 \end{figure}
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={hidden! second supp figure}]{figs/fig_s2.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={hidden! second supp
+figure}]{figs/fig_s2.jpg}}
 \caption[]{hidden! second supp figure}\label{fig:fig_s2}
 \end{figure}
 
@@ -44,13 +49,15 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={hidden! first hidden figure}]{figs/fig_s1.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={hidden! first
+hidden figure}]{figs/fig_s1.jpg}}
 \caption[]{hidden! first hidden figure}\label{fig:fig_h1}
 \end{figure}
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={hidden! second hidden figure}]{figs/fig_s2.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={hidden! second
+hidden figure}]{figs/fig_s2.jpg}}
 \caption[]{hidden! second hidden figure}\label{fig:fig_h2}
 \end{figure}
 
@@ -59,13 +66,15 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={hidden! first hidden subsection figure}]{figs/fig_s1.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={hidden! first
+hidden subsection figure}]{figs/fig_s1.jpg}}
 \caption[]{hidden! first hidden subsection figure}\label{fig:fig_h1_s}
 \end{figure}
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={hidden! second hidden subsection figure}]{figs/fig_s2.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={hidden! second
+hidden subsection figure}]{figs/fig_s2.jpg}}
 \caption[]{hidden! second hidden subsection figure}\label{fig:fig_h2_s}
 \end{figure}
 
@@ -73,13 +82,15 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={first regular section figure}]{figs/fig_s1.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={first regular
+section figure}]{figs/fig_s1.jpg}}
 \caption{first regular section figure}\label{fig:fig_r1}
 \end{figure}
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={second regular section figure}]{figs/fig_s2.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={second regular
+section figure}]{figs/fig_s2.jpg}}
 \caption{second regular section figure}\label{fig:fig_r2}
 \end{figure}
 
@@ -87,13 +98,15 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={first normal subsection figure}]{figs/fig_s1.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={first normal
+subsection figure}]{figs/fig_s1.jpg}}
 \caption{first normal subsection figure}\label{fig:fig_nss1}
 \end{figure}
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={second normal subsection figure}]{figs/fig_s2.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={second normal
+subsection figure}]{figs/fig_s2.jpg}}
 \caption{second normal subsection figure}\label{fig:fig_nss2}
 \end{figure}
 
@@ -101,27 +114,32 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={hidden! first hidden subsection figure}]{figs/fig_s1.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={hidden! first
+hidden subsection figure}]{figs/fig_s1.jpg}}
 \caption[]{hidden! first hidden subsection figure}\label{fig:fig_ss1}
 \end{figure}
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={hidden! second hidden subsection figure}]{figs/fig_s2.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={hidden! second
+hidden subsection figure}]{figs/fig_s2.jpg}}
 \caption[]{hidden! second hidden subsection figure}\label{fig:fig_ss2}
 \end{figure}
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={visible! overridden visibility}]{figs/fig_s3.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={visible! overridden
+visibility}]{figs/fig_s3.jpg}}
 \caption{visible! overridden visibility}\label{fig:fig_ss3}
 \end{figure}
 
 \begin{pandoccrossrefsubfigures}
 
-\begin{subfigure}{0.495\linewidth}\centering\pandocbounded{\includegraphics[keepaspectratio,alt={hidden! subfigure1}]{figs/fig_s2.jpg}}\caption{hidden!
+\begin{subfigure}{0.495\linewidth}\centering\pandocbounded{\includegraphics[keepaspectratio,alt={hidden!
+subfigure1}]{figs/fig_s2.jpg}}\caption{hidden!
 subfigure1\label{fig:fig_sss1}}\end{subfigure}%
-\begin{subfigure}{0.495\linewidth}\centering\pandocbounded{\includegraphics[keepaspectratio,alt={hidden! subfigure2}]{figs/fig_s2.jpg}}\caption{hidden!
+\begin{subfigure}{0.495\linewidth}\centering\pandocbounded{\includegraphics[keepaspectratio,alt={hidden!
+subfigure2}]{figs/fig_s2.jpg}}\caption{hidden!
 subfigure2\label{fig:fig_sss2}}\end{subfigure}%
 
 \caption[]{hidden! subfigures}\label{fig:subfigs}
@@ -190,13 +208,15 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={first other regular section figure}]{figs/fig_s1.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={first other regular
+section figure}]{figs/fig_s1.jpg}}
 \caption{first other regular section figure}\label{fig:fig_or1}
 \end{figure}
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={second other regular section figure}]{figs/fig_s2.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={second other
+regular section figure}]{figs/fig_s2.jpg}}
 \caption{second other regular section figure}\label{fig:fig_or2}
 \end{figure}
 
diff --git a/test/m2m/listOfOrdering/expect.tex b/test/m2m/listOfOrdering/expect.tex
--- a/test/m2m/listOfOrdering/expect.tex
+++ b/test/m2m/listOfOrdering/expect.tex
@@ -5,7 +5,8 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={first figure}]{figs/fig1.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={first
+figure}]{figs/fig1.jpg}}
 \caption{first figure}\label{fig:fig1}
 \end{figure}
 
@@ -13,7 +14,8 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={second figure}]{figs/fig2.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={second
+figure}]{figs/fig2.jpg}}
 \caption{second figure}\label{fig:fig2}
 \end{figure}
 
@@ -21,7 +23,8 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={third figure}]{figs/fig3.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={third
+figure}]{figs/fig3.jpg}}
 \caption{third figure}\label{fig:fig3}
 \end{figure}
 
@@ -29,13 +32,15 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={first supp figure}]{figs/fig_s1.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={first supp
+figure}]{figs/fig_s1.jpg}}
 \caption{first supp figure}\label{fig:fig_s1}
 \end{figure}
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={second supp figure}]{figs/fig_s2.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={second supp
+figure}]{figs/fig_s2.jpg}}
 \caption{second supp figure}\label{fig:fig_s2}
 \end{figure}
 
diff --git a/test/m2m/numberOverride/expect.tex b/test/m2m/numberOverride/expect.tex
--- a/test/m2m/numberOverride/expect.tex
+++ b/test/m2m/numberOverride/expect.tex
@@ -4,7 +4,8 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={Image 1}]{img2.png}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={Image
+1}]{img2.png}}
 \caption{Image 1}\label{fig:img1}
 \end{figure}
 
@@ -12,19 +13,22 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={Image 1.6.2}]{img2.png}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={Image
+1.6.2}]{img2.png}}
 \caption{Image 1.6.2}\label{fig:img2}
 \end{figure}
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={Image 1.6.100500}]{img2.png}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={Image
+1.6.100500}]{img2.png}}
 \caption{Image 1.6.100500}\label{fig:img3}
 \end{figure}
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={Image 1.6.100501}]{img2.png}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={Image
+1.6.100501}]{img2.png}}
 \caption{Image 1.6.100501}\label{fig:img4}
 \end{figure}
 
@@ -32,18 +36,21 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={Image 1.7.1}]{img2.png}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={Image
+1.7.1}]{img2.png}}
 \caption{Image 1.7.1}\label{fig:img21}
 \end{figure}
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={Image 1.7.100500}]{img2.png}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={Image
+1.7.100500}]{img2.png}}
 \caption{Image 1.7.100500}\label{fig:img31}
 \end{figure}
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={Image 1.7.100501}]{img2.png}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={Image
+1.7.100501}]{img2.png}}
 \caption{Image 1.7.100501}\label{fig:img41}
 \end{figure}
diff --git a/test/m2m/preserveAltText/expect.tex b/test/m2m/preserveAltText/expect.tex
--- a/test/m2m/preserveAltText/expect.tex
+++ b/test/m2m/preserveAltText/expect.tex
@@ -1,16 +1,19 @@
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={Single figure}]{./fig1.png}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={Single
+figure}]{./fig1.png}}
 \caption{Single figure}\label{fig:one}
 \end{figure}
 
 \begin{pandoccrossrefsubfigures}
 
-\begin{subfigure}{1.0\linewidth}\centering\pandocbounded{\includegraphics[keepaspectratio,alt={subfigure 1 caption}]{image1.png}}\caption{subfigure
-1 caption\label{fig:figureRefA}}\end{subfigure}%
+\begin{subfigure}{1.0\linewidth}\centering\pandocbounded{\includegraphics[keepaspectratio,alt={subfigure
+1 caption}]{image1.png}}\caption{subfigure 1
+caption\label{fig:figureRefA}}\end{subfigure}%
 
-\begin{subfigure}{1.0\linewidth}\centering\pandocbounded{\includegraphics[keepaspectratio,alt={subfigure 2 caption}]{image2.png}}\caption{subfigure
-2 caption\label{fig:figureRefB}}\end{subfigure}%
+\begin{subfigure}{1.0\linewidth}\centering\pandocbounded{\includegraphics[keepaspectratio,alt={subfigure
+2 caption}]{image2.png}}\caption{subfigure 2
+caption\label{fig:figureRefB}}\end{subfigure}%
 
 \caption{Caption of figure}\label{fig:figureRef}
 
diff --git a/test/m2m/refsInListOf/expect.tex b/test/m2m/refsInListOf/expect.tex
--- a/test/m2m/refsInListOf/expect.tex
+++ b/test/m2m/refsInListOf/expect.tex
@@ -2,7 +2,8 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={first figure caption with a citation to fig.~ in it}]{fig1.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={first figure
+caption with a citation to fig.~ in it}]{fig1.jpg}}
 \caption{first figure caption with a citation to fig.~\ref{fig:fig2} in
 it}\label{fig:fig1}
 \end{figure}
@@ -12,7 +13,8 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={second figure caption with a citation to fig.~ in it}]{fig2.jpg}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={second figure
+caption with a citation to fig.~ in it}]{fig2.jpg}}
 \caption{second figure caption with a citation to fig.~\ref{fig:fig1} in
 it}\label{fig:fig2}
 \end{figure}
diff --git a/test/m2m/refsInObjects/expect.tex b/test/m2m/refsInObjects/expect.tex
--- a/test/m2m/refsInObjects/expect.tex
+++ b/test/m2m/refsInObjects/expect.tex
@@ -34,10 +34,12 @@
 
 \begin{pandoccrossrefsubfigures}
 
-\begin{subfigure}{0.33\linewidth}\centering\pandocbounded{\includegraphics[keepaspectratio,alt={tbl.~ fig.~ fig.~ fig.~ lst.~}]{fig1.png}}\caption{tbl.~\ref{tbl:table}
+\begin{subfigure}{0.33\linewidth}\centering\pandocbounded{\includegraphics[keepaspectratio,alt={tbl.~
+fig.~ fig.~ fig.~ lst.~}]{fig1.png}}\caption{tbl.~\ref{tbl:table}
 fig.~\ref{fig:subfigures} fig.~\ref{fig:subfig1} fig.~\ref{fig:subfig2}
 lst.~\ref{lst:lst}\label{fig:subfig1}}\end{subfigure}%
-\begin{subfigure}{0.33\linewidth}\centering\pandocbounded{\includegraphics[keepaspectratio,alt={tbl.~ fig.~ fig.~ fig.~ lst.~}]{fig2.png}}\caption{tbl.~\ref{tbl:table}
+\begin{subfigure}{0.33\linewidth}\centering\pandocbounded{\includegraphics[keepaspectratio,alt={tbl.~
+fig.~ fig.~ fig.~ lst.~}]{fig2.png}}\caption{tbl.~\ref{tbl:table}
 fig.~\ref{fig:subfigures} fig.~\ref{fig:subfig1} fig.~\ref{fig:subfig2}
 lst.~\ref{lst:lst}\label{fig:subfig2}}\end{subfigure}%
 \begin{subfigure}{0.33\linewidth}\centering\pandocbounded{\includegraphics[keepaspectratio,alt={3}]{fig3.png}}\caption{3}\end{subfigure}%
diff --git a/test/m2m/secLabels/expect.tex b/test/m2m/secLabels/expect.tex
--- a/test/m2m/secLabels/expect.tex
+++ b/test/m2m/secLabels/expect.tex
@@ -4,7 +4,8 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={my figure}]{myfig.png}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={my
+figure}]{myfig.png}}
 \caption{my figure}\label{fig:myfig}
 \end{figure}
 
diff --git a/test/m2m/subfigures-one-row/expect.tex b/test/m2m/subfigures-one-row/expect.tex
--- a/test/m2m/subfigures-one-row/expect.tex
+++ b/test/m2m/subfigures-one-row/expect.tex
@@ -5,9 +5,11 @@
 
 \begin{pandoccrossrefsubfigures}
 
-\begin{subfigure}{0.4\linewidth}\centering\pandocbounded{\includegraphics[keepaspectratio,alt={cool caption}]{/tmp/LaTeX_logo.svg.png}}\caption{cool
+\begin{subfigure}{0.4\linewidth}\centering\pandocbounded{\includegraphics[keepaspectratio,alt={cool
+caption}]{/tmp/LaTeX_logo.svg.png}}\caption{cool
 caption\label{fig:logo1}}\end{subfigure}%
-\begin{subfigure}{0.4\linewidth}\centering\pandocbounded{\includegraphics[keepaspectratio,alt={cooler caption}]{/tmp/LaTeX_logo.svg.png}}\caption{cooler
+\begin{subfigure}{0.4\linewidth}\centering\pandocbounded{\includegraphics[keepaspectratio,alt={cooler
+caption}]{/tmp/LaTeX_logo.svg.png}}\caption{cooler
 caption\label{fig:logo2}}\end{subfigure}%
 
 \caption{Copies of the LaTeX logo}\label{fig:latex}
diff --git a/test/m2m/titlesInRefs/expect.tex b/test/m2m/titlesInRefs/expect.tex
--- a/test/m2m/titlesInRefs/expect.tex
+++ b/test/m2m/titlesInRefs/expect.tex
@@ -2,7 +2,8 @@
 
 \begin{figure}
 \centering
-\pandocbounded{\includegraphics[keepaspectratio,alt={A Figure}]{figure.png}}
+\pandocbounded{\includegraphics[keepaspectratio,alt={A
+Figure}]{figure.png}}
 \caption{A Figure}\label{fig:figure}
 \end{figure}
 
