packages feed

pandoc-crossref 0.3.6.3 → 0.3.6.4

raw patch · 13 files changed

+73/−56 lines, 13 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Text.Pandoc.CrossRef: autoEqnLabels :: forall a_aAGs. ToMetaValue a_aAGs => a_aAGs -> Meta
+ Text.Pandoc.CrossRef: autoEqnLabels :: forall a_aAIE. ToMetaValue a_aAIE => a_aAIE -> Meta
- Text.Pandoc.CrossRef: autoSectionLabels :: forall a_aAFT. ToMetaValue a_aAFT => a_aAFT -> Meta
+ Text.Pandoc.CrossRef: autoSectionLabels :: forall a_aAI5. ToMetaValue a_aAI5 => a_aAI5 -> Meta
- Text.Pandoc.CrossRef: ccsDelim :: forall a_aAGp. ToMetaValue a_aAGp => a_aAGp -> Meta
+ Text.Pandoc.CrossRef: ccsDelim :: forall a_aAIB. ToMetaValue a_aAIB => a_aAIB -> Meta
- Text.Pandoc.CrossRef: ccsLabelSep :: forall a_aAGq. ToMetaValue a_aAGq => a_aAGq -> Meta
+ Text.Pandoc.CrossRef: ccsLabelSep :: forall a_aAIC. ToMetaValue a_aAIC => a_aAIC -> Meta
- Text.Pandoc.CrossRef: ccsTemplate :: forall a_aAGl. ToMetaValue a_aAGl => a_aAGl -> Meta
+ Text.Pandoc.CrossRef: ccsTemplate :: forall a_aAIx. ToMetaValue a_aAIx => a_aAIx -> Meta
- Text.Pandoc.CrossRef: chapDelim :: forall a_aAG9. ToMetaValue a_aAG9 => a_aAG9 -> Meta
+ Text.Pandoc.CrossRef: chapDelim :: forall a_aAIl. ToMetaValue a_aAIl => a_aAIl -> Meta
- Text.Pandoc.CrossRef: chapters :: forall a_aB6Y. ToMetaValue a_aB6Y => a_aB6Y -> Meta
+ Text.Pandoc.CrossRef: chapters :: forall a_aB97. ToMetaValue a_aB97 => a_aB97 -> Meta
- Text.Pandoc.CrossRef: chaptersDepth :: forall a_aAFQ. ToMetaValue a_aAFQ => a_aAFQ -> Meta
+ Text.Pandoc.CrossRef: chaptersDepth :: forall a_aAI2. ToMetaValue a_aAI2 => a_aAI2 -> Meta
- Text.Pandoc.CrossRef: codeBlockCaptions :: forall a_aAFS. ToMetaValue a_aAFS => a_aAFS -> Meta
+ Text.Pandoc.CrossRef: codeBlockCaptions :: forall a_aAI4. ToMetaValue a_aAI4 => a_aAI4 -> Meta
- Text.Pandoc.CrossRef: cref :: forall a_aAFP. ToMetaValue a_aAFP => a_aAFP -> Meta
+ Text.Pandoc.CrossRef: cref :: forall a_aAI1. ToMetaValue a_aAI1 => a_aAI1 -> Meta
- Text.Pandoc.CrossRef: crossrefYaml :: forall a_aB6W. ToMetaValue a_aB6W => a_aB6W -> Meta
+ Text.Pandoc.CrossRef: crossrefYaml :: forall a_aB95. ToMetaValue a_aB95 => a_aB95 -> Meta
- Text.Pandoc.CrossRef: customLabel :: forall a_aAGo. ToMetaValue a_aAGo => a_aAGo -> Meta
+ Text.Pandoc.CrossRef: customLabel :: forall a_aAIA. ToMetaValue a_aAIA => a_aAIA -> Meta
- Text.Pandoc.CrossRef: eqLabels :: forall a_aB70. ToMetaValue a_aB70 => a_aB70 -> Meta
+ Text.Pandoc.CrossRef: eqLabels :: forall a_aB99. ToMetaValue a_aB99 => a_aB99 -> Meta
- Text.Pandoc.CrossRef: eqnPrefix :: forall a_aAFX. ToMetaValue a_aAFX => a_aAFX -> Meta
+ Text.Pandoc.CrossRef: eqnPrefix :: forall a_aAI9. ToMetaValue a_aAI9 => a_aAI9 -> Meta
- Text.Pandoc.CrossRef: eqnPrefixTemplate :: forall a_aAG2. ToMetaValue a_aAG2 => a_aAG2 -> Meta
+ Text.Pandoc.CrossRef: eqnPrefixTemplate :: forall a_aAIe. ToMetaValue a_aAIe => a_aAIe -> Meta
- Text.Pandoc.CrossRef: figLabels :: forall a_aB6Z. ToMetaValue a_aB6Z => a_aB6Z -> Meta
+ Text.Pandoc.CrossRef: figLabels :: forall a_aB98. ToMetaValue a_aB98 => a_aB98 -> Meta
- Text.Pandoc.CrossRef: figPrefix :: forall a_aAFW. ToMetaValue a_aAFW => a_aAFW -> Meta
+ Text.Pandoc.CrossRef: figPrefix :: forall a_aAI8. ToMetaValue a_aAI8 => a_aAI8 -> Meta
- Text.Pandoc.CrossRef: figPrefixTemplate :: forall a_aAG1. ToMetaValue a_aAG1 => a_aAG1 -> Meta
+ Text.Pandoc.CrossRef: figPrefixTemplate :: forall a_aAId. ToMetaValue a_aAId => a_aAId -> Meta
- Text.Pandoc.CrossRef: figureTemplate :: forall a_aAGi. ToMetaValue a_aAGi => a_aAGi -> Meta
+ Text.Pandoc.CrossRef: figureTemplate :: forall a_aAIu. ToMetaValue a_aAIu => a_aAIu -> Meta
- Text.Pandoc.CrossRef: figureTitle :: forall a_aB6S. ToMetaValue a_aB6S => a_aB6S -> Meta
+ Text.Pandoc.CrossRef: figureTitle :: forall a_aB91. ToMetaValue a_aB91 => a_aB91 -> Meta
- Text.Pandoc.CrossRef: lastDelim :: forall a_aAGc. ToMetaValue a_aAGc => a_aAGc -> Meta
+ Text.Pandoc.CrossRef: lastDelim :: forall a_aAIo. ToMetaValue a_aAIo => a_aAIo -> Meta
- Text.Pandoc.CrossRef: linkReferences :: forall a_aAGu. ToMetaValue a_aAGu => a_aAGu -> Meta
+ Text.Pandoc.CrossRef: linkReferences :: forall a_aAIG. ToMetaValue a_aAIG => a_aAIG -> Meta
- Text.Pandoc.CrossRef: listingTemplate :: forall a_aAGn. ToMetaValue a_aAGn => a_aAGn -> Meta
+ Text.Pandoc.CrossRef: listingTemplate :: forall a_aAIz. ToMetaValue a_aAIz => a_aAIz -> Meta
- Text.Pandoc.CrossRef: listingTitle :: forall a_aB6U. ToMetaValue a_aB6U => a_aB6U -> Meta
+ Text.Pandoc.CrossRef: listingTitle :: forall a_aB93. ToMetaValue a_aB93 => a_aB93 -> Meta
- Text.Pandoc.CrossRef: listings :: forall a_aAFR. ToMetaValue a_aAFR => a_aAFR -> Meta
+ Text.Pandoc.CrossRef: listings :: forall a_aAI3. ToMetaValue a_aAI3 => a_aAI3 -> Meta
- Text.Pandoc.CrossRef: lofTitle :: forall a_aAGe. ToMetaValue a_aAGe => a_aAGe -> Meta
+ Text.Pandoc.CrossRef: lofTitle :: forall a_aAIq. ToMetaValue a_aAIq => a_aAIq -> Meta
- Text.Pandoc.CrossRef: lolTitle :: forall a_aAGg. ToMetaValue a_aAGg => a_aAGg -> Meta
+ Text.Pandoc.CrossRef: lolTitle :: forall a_aAIs. ToMetaValue a_aAIs => a_aAIs -> Meta
- Text.Pandoc.CrossRef: lotTitle :: forall a_aAGf. ToMetaValue a_aAGf => a_aAGf -> Meta
+ Text.Pandoc.CrossRef: lotTitle :: forall a_aAIr. ToMetaValue a_aAIr => a_aAIr -> Meta
- Text.Pandoc.CrossRef: lstLabels :: forall a_aB72. ToMetaValue a_aB72 => a_aB72 -> Meta
+ Text.Pandoc.CrossRef: lstLabels :: forall a_aB9b. ToMetaValue a_aB9b => a_aB9b -> Meta
- Text.Pandoc.CrossRef: lstPrefix :: forall a_aAFZ. ToMetaValue a_aAFZ => a_aAFZ -> Meta
+ Text.Pandoc.CrossRef: lstPrefix :: forall a_aAIb. ToMetaValue a_aAIb => a_aAIb -> Meta
- Text.Pandoc.CrossRef: lstPrefixTemplate :: forall a_aAG4. ToMetaValue a_aAG4 => a_aAG4 -> Meta
+ Text.Pandoc.CrossRef: lstPrefixTemplate :: forall a_aAIg. ToMetaValue a_aAIg => a_aAIg -> Meta
- Text.Pandoc.CrossRef: nameInLink :: forall a_aAGv. ToMetaValue a_aAGv => a_aAGv -> Meta
+ Text.Pandoc.CrossRef: nameInLink :: forall a_aAIH. ToMetaValue a_aAIH => a_aAIH -> Meta
- Text.Pandoc.CrossRef: numberSections :: forall a_aAFU. ToMetaValue a_aAFU => a_aAFU -> Meta
+ Text.Pandoc.CrossRef: numberSections :: forall a_aAI6. ToMetaValue a_aAI6 => a_aAI6 -> Meta
- Text.Pandoc.CrossRef: outFormat :: forall a_aAGh. ToMetaValue a_aAGh => a_aAGh -> Meta
+ Text.Pandoc.CrossRef: outFormat :: forall a_aAIt. ToMetaValue a_aAIt => a_aAIt -> Meta
- Text.Pandoc.CrossRef: pairDelim :: forall a_aAGb. ToMetaValue a_aAGb => a_aAGb -> Meta
+ Text.Pandoc.CrossRef: pairDelim :: forall a_aAIn. ToMetaValue a_aAIn => a_aAIn -> Meta
- Text.Pandoc.CrossRef: rangeDelim :: forall a_aAGa. ToMetaValue a_aAGa => a_aAGa -> Meta
+ Text.Pandoc.CrossRef: rangeDelim :: forall a_aAIm. ToMetaValue a_aAIm => a_aAIm -> Meta
- Text.Pandoc.CrossRef: refDelim :: forall a_aAGd. ToMetaValue a_aAGd => a_aAGd -> Meta
+ Text.Pandoc.CrossRef: refDelim :: forall a_aAIp. ToMetaValue a_aAIp => a_aAIp -> Meta
- Text.Pandoc.CrossRef: refIndexTemplate :: forall a_aAG6. ToMetaValue a_aAG6 => a_aAG6 -> Meta
+ Text.Pandoc.CrossRef: refIndexTemplate :: forall a_aAIi. ToMetaValue a_aAIi => a_aAIi -> Meta
- Text.Pandoc.CrossRef: secHeaderDelim :: forall a_aB74. ToMetaValue a_aB74 => a_aB74 -> Meta
+ Text.Pandoc.CrossRef: secHeaderDelim :: forall a_aB9d. ToMetaValue a_aB9d => a_aB9d -> Meta
- Text.Pandoc.CrossRef: secHeaderTemplate :: forall a_aAG8. ToMetaValue a_aAG8 => a_aAG8 -> Meta
+ Text.Pandoc.CrossRef: secHeaderTemplate :: forall a_aAIk. ToMetaValue a_aAIk => a_aAIk -> Meta
- Text.Pandoc.CrossRef: secLabels :: forall a_aB73. ToMetaValue a_aB73 => a_aB73 -> Meta
+ Text.Pandoc.CrossRef: secLabels :: forall a_aB9c. ToMetaValue a_aB9c => a_aB9c -> Meta
- Text.Pandoc.CrossRef: secPrefix :: forall a_aAG0. ToMetaValue a_aAG0 => a_aAG0 -> Meta
+ Text.Pandoc.CrossRef: secPrefix :: forall a_aAIc. ToMetaValue a_aAIc => a_aAIc -> Meta
- Text.Pandoc.CrossRef: secPrefixTemplate :: forall a_aAG5. ToMetaValue a_aAG5 => a_aAG5 -> Meta
+ Text.Pandoc.CrossRef: secPrefixTemplate :: forall a_aAIh. ToMetaValue a_aAIh => a_aAIh -> Meta
- Text.Pandoc.CrossRef: sectionsDepth :: forall a_aAFV. ToMetaValue a_aAFV => a_aAFV -> Meta
+ Text.Pandoc.CrossRef: sectionsDepth :: forall a_aAI7. ToMetaValue a_aAI7 => a_aAI7 -> Meta
- Text.Pandoc.CrossRef: subfigGrid :: forall a_aAGt. ToMetaValue a_aAGt => a_aAGt -> Meta
+ Text.Pandoc.CrossRef: subfigGrid :: forall a_aAIF. ToMetaValue a_aAIF => a_aAIF -> Meta
- Text.Pandoc.CrossRef: subfigLabels :: forall a_aB6X. ToMetaValue a_aB6X => a_aB6X -> Meta
+ Text.Pandoc.CrossRef: subfigLabels :: forall a_aB96. ToMetaValue a_aB96 => a_aB96 -> Meta
- Text.Pandoc.CrossRef: subfigureChildTemplate :: forall a_aAGk. ToMetaValue a_aAGk => a_aAGk -> Meta
+ Text.Pandoc.CrossRef: subfigureChildTemplate :: forall a_aAIw. ToMetaValue a_aAIw => a_aAIw -> Meta
- Text.Pandoc.CrossRef: subfigureRefIndexTemplate :: forall a_aAG7. ToMetaValue a_aAG7 => a_aAG7 -> Meta
+ Text.Pandoc.CrossRef: subfigureRefIndexTemplate :: forall a_aAIj. ToMetaValue a_aAIj => a_aAIj -> Meta
- Text.Pandoc.CrossRef: subfigureTemplate :: forall a_aAGj. ToMetaValue a_aAGj => a_aAGj -> Meta
+ Text.Pandoc.CrossRef: subfigureTemplate :: forall a_aAIv. ToMetaValue a_aAIv => a_aAIv -> Meta
- Text.Pandoc.CrossRef: tableEqns :: forall a_aAGr. ToMetaValue a_aAGr => a_aAGr -> Meta
+ Text.Pandoc.CrossRef: tableEqns :: forall a_aAID. ToMetaValue a_aAID => a_aAID -> Meta
- Text.Pandoc.CrossRef: tableTemplate :: forall a_aAGm. ToMetaValue a_aAGm => a_aAGm -> Meta
+ Text.Pandoc.CrossRef: tableTemplate :: forall a_aAIy. ToMetaValue a_aAIy => a_aAIy -> Meta
- Text.Pandoc.CrossRef: tableTitle :: forall a_aB6T. ToMetaValue a_aB6T => a_aB6T -> Meta
+ Text.Pandoc.CrossRef: tableTitle :: forall a_aB92. ToMetaValue a_aB92 => a_aB92 -> Meta
- Text.Pandoc.CrossRef: tblLabels :: forall a_aB71. ToMetaValue a_aB71 => a_aB71 -> Meta
+ Text.Pandoc.CrossRef: tblLabels :: forall a_aB9a. ToMetaValue a_aB9a => a_aB9a -> Meta
- Text.Pandoc.CrossRef: tblPrefix :: forall a_aAFY. ToMetaValue a_aAFY => a_aAFY -> Meta
+ Text.Pandoc.CrossRef: tblPrefix :: forall a_aAIa. ToMetaValue a_aAIa => a_aAIa -> Meta
- Text.Pandoc.CrossRef: tblPrefixTemplate :: forall a_aAG3. ToMetaValue a_aAG3 => a_aAG3 -> Meta
+ Text.Pandoc.CrossRef: tblPrefixTemplate :: forall a_aAIf. ToMetaValue a_aAIf => a_aAIf -> Meta
- Text.Pandoc.CrossRef: titleDelim :: forall a_aB6V. ToMetaValue a_aB6V => a_aB6V -> Meta
+ Text.Pandoc.CrossRef: titleDelim :: forall a_aB94. ToMetaValue a_aB94 => a_aB94 -> Meta

Files

CHANGELOG.md view
@@ -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
lib/Text/Pandoc/CrossRef/References/Blocks.hs view
@@ -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))
lib/Text/Pandoc/CrossRef/References/Refs.hs view
@@ -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
lib/Text/Pandoc/CrossRef/Util/Settings/Gen.hs view
@@ -30,7 +30,7 @@  nameDeriveSetters ''Options -fmap concat $ mapM (makeAcc . mkName)+concat <$> mapM (makeAcc . mkName)   [ "figureTitle"   , "tableTitle"   , "listingTitle"
pandoc-crossref.cabal view
@@ -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
test/m2m/delim/expect.tex view
@@ -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: 
test/m2m/equations-auto/expect.tex view
@@ -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: 
test/m2m/equations-tables-auto/expect.tex view
@@ -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: 
test/m2m/equations-tables/expect.tex view
@@ -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: 
test/m2m/equations/expect.tex view
@@ -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: 
@@ -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: 
test/m2m/links/expect.tex view
@@ -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: 
test/test-pandoc-crossref.hs view
@@ -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" $