pandoc-crossref 0.3.17.0 → 0.3.17.1
raw patch · 20 files changed
+219/−603 lines, 20 filesdep ~pandocPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: pandoc
API changes (from Hackage documentation)
Files
- CHANGELOG.md +12/−1
- lib-internal/Text/Pandoc/CrossRef/References/Blocks/Subfigures.hs +7/−4
- pandoc-crossref.cabal +10/−10
- test/demo-chapters.inc +42/−14
- test/demo.inc +42/−14
- test/m2m/emptyChapterLabels/expect.md +1/−7
- test/m2m/label-precedence/expect.md +3/−21
- test/m2m/listOfTemplates-buillet-list/expect.md +9/−63
- test/m2m/listOfTemplates-ord-list/expect.md +9/−63
- test/m2m/listOfTemplates/expect.md +9/−63
- test/m2m/loxItemTitle/expect.md +9/−63
- test/m2m/numberOverride/expect.md +9/−49
- test/m2m/secLabels/expect.md +1/−7
- test/m2m/setLabelAttribute/expect.md +3/−3
- test/m2m/subfigures-ccsDelim/expect.md +13/−67
- test/m2m/subfigures-grid/expect.md +22/−76
- test/m2m/subfigures-one-row/expect.md +2/−2
- test/m2m/subfigures/expect.md +13/−67
- test/m2m/titlesInRefs/expect.md +1/−7
- test/test-pandoc-crossref.hs +2/−2
CHANGELOG.md view
@@ -1,9 +1,20 @@+## 0.3.17.1++- Fix images roundtripping through Markdown++ Since a few versions ago, Makrdown images were not round-tripped properly.+ This has been addressed. More information at+ <https://github.com/jgm/pandoc/issues/9720>+ ## 0.3.17.0 - Bump minimal pandoc version to 3.1.8 - Pandoc doesn't use hypertarget since 3.1.7, and inserts `label`s for named spans. This was messing with pandoc-crossref logic, hence required some changes. 3.1.7 has an unfortunate bug which prevents figures from working in LaTeX, hence the minimal version is 3.1.8.+ Pandoc doesn't use hypertarget since 3.1.7, and inserts `label`s for named+ spans. This was messing with pandoc-crossref logic, hence required some+ changes. 3.1.7 has an unfortunate bug which prevents figures from working in+ LaTeX, hence the minimal version is 3.1.8. - Bump dependencies for GHC to 9.6.2, bump GHC to 9.6.2 on CI for Linux and macOS
lib-internal/Text/Pandoc/CrossRef/References/Blocks/Subfigures.hs view
@@ -205,9 +205,12 @@ opts <- ask let label' = normalizeLabel label let title = blocksToInlines [btitle]- attrs = case blocksToInlines content of- [Image (_, _, as) _ _] -> fattrs <> as- _ -> fattrs+ (attrs, content') = case blocksToInlines content of+ [Image attr@(_, _, as) _ tgt] ->+ -- the second argument is a fix for+ -- https://github.com/jgm/pandoc/issues/9720+ (fattrs <> as, \capt -> [Plain [Image attr capt tgt]])+ _ -> (fattrs, const content) idxStr <- replaceAttr label' attrs title SPfxImg let title' | isLatexFormat opts = title@@ -216,5 +219,5 @@ replaceNoRecurse $ if subFigure && isLatexFormat opts then Plain $ latexSubFigure (head $ blocksToInlines content) label- else Figure (label,cls,setLabel opts idxStr fattrs) caption' content+ else Figure (label,cls,setLabel opts idxStr fattrs) caption' (content' title') runFigure _ _ _ _ = noReplaceNoRecurse
pandoc-crossref.cabal view
@@ -1,11 +1,11 @@ cabal-version: 2.0 --- This file has been generated from package.yaml by hpack version 0.34.4.+-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack name: pandoc-crossref-version: 0.3.17.0+version: 0.3.17.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@@ -136,7 +136,7 @@ , pandoc >=3.1.8 && <3.2 , pandoc-crossref-internal , pandoc-types ==1.23.*- , text >=1.2.2 && <2.1+ , text >=1.2.2 && <2.2 default-language: Haskell2010 library pandoc-crossref-internal@@ -181,7 +181,7 @@ , pandoc-types ==1.23.* , syb >=0.4 && <0.8 , template-haskell >=2.7.0.0 && <3.0.0.0- , text >=1.2.2 && <2.1+ , text >=1.2.2 && <2.2 , utility-ht >=0.0.11 && <0.1.0 default-language: Haskell2010 @@ -203,7 +203,7 @@ , pandoc-types ==1.23.* , template-haskell >=2.7.0.0 && <3.0.0.0 , temporary >=1.2 && <1.4- , text >=1.2.2 && <2.1+ , text >=1.2.2 && <2.2 default-language: Haskell2010 test-suite test-integrative@@ -222,10 +222,10 @@ , pandoc >=3.1.8 && <3.2 , pandoc-crossref , pandoc-types ==1.23.*- , text >=1.2.2 && <2.1+ , text >=1.2.2 && <2.2+ default-language: Haskell2010 if flag(enable_flaky_tests) cpp-options: -DFLAKY- default-language: Haskell2010 test-suite test-pandoc-crossref type: exitcode-stdio-1.0@@ -249,10 +249,10 @@ , pandoc-crossref , pandoc-crossref-internal , pandoc-types ==1.23.*- , text >=1.2.2 && <2.1+ , text >=1.2.2 && <2.2+ default-language: Haskell2010 if flag(enable_flaky_tests) cpp-options: -DFLAKY- default-language: Haskell2010 benchmark simple type: exitcode-stdio-1.0@@ -268,5 +268,5 @@ , pandoc >=3.1.8 && <3.2 , pandoc-crossref , pandoc-types ==1.23.*- , text >=1.2.2 && <2.1+ , text >=1.2.2 && <2.2 default-language: Haskell2010
test/demo-chapters.inc view
@@ -86,7 +86,16 @@ [ Plain [ Image ( "" , [] , [] )- [ Str "A" , Space , Str "figure" ]+ [ Str "Figure"+ , Space+ , Str "#"+ , Space+ , Str "1:"+ , Space+ , Str "A"+ , Space+ , Str "figure"+ ] ( "img1.jpg" , "" ) ] ]@@ -319,7 +328,16 @@ [ Plain [ Image ( "" , [] , [] )- [ Str "First" , Space , Str "figure" ]+ [ Str "Figure"+ , Space+ , Str "#"+ , Space+ , Str "1.1:"+ , Space+ , Str "First"+ , Space+ , Str "figure"+ ] ( "img1.jpg" , "" ) ] ]@@ -342,7 +360,16 @@ [ Plain [ Image ( "" , [] , [] )- [ Str "Second" , Space , Str "figure" ]+ [ Str "Figure"+ , Space+ , Str "#"+ , Space+ , Str "1.2:"+ , Space+ , Str "Second"+ , Space+ , Str "figure"+ ] ( "img2.jpg" , "" ) ] ]@@ -365,7 +392,16 @@ [ Plain [ Image ( "" , [] , [] )- [ Str "Third" , Space , Str "figure" ]+ [ Str "Figure"+ , Space+ , Str "#"+ , Space+ , Str "1.3:"+ , Space+ , Str "Third"+ , Space+ , Str "figure"+ ] ( "img3.jpg" , "" ) ] ]@@ -417,21 +453,13 @@ ( "" , [] , [] ) (Caption Nothing [ Plain [ Str "a" ] ]) [ Plain- [ Image- ( "" , [] , [] )- [ Str "Subfigure" , Space , Str "a" ]- ( "img1.jpg" , "" )- ]+ [ Image ( "" , [] , [] ) [ Str "a" ] ( "img1.jpg" , "" ) ] ] , Figure ( "fig:subfigureB" , [] , [] ) (Caption Nothing [ Plain [ Str "b" ] ]) [ Plain- [ Image- ( "" , [] , [] )- [ Str "Subfigure" , Space , Str "b" ]- ( "img1.jpg" , "" )- ]+ [ Image ( "" , [] , [] ) [ Str "b" ] ( "img1.jpg" , "" ) ] ] ] , Header
test/demo.inc view
@@ -86,7 +86,16 @@ [ Plain [ Image ( "" , [] , [] )- [ Str "A" , Space , Str "figure" ]+ [ Str "Figure"+ , Space+ , Str "#"+ , Space+ , Str "1:"+ , Space+ , Str "A"+ , Space+ , Str "figure"+ ] ( "img1.jpg" , "" ) ] ]@@ -319,7 +328,16 @@ [ Plain [ Image ( "" , [] , [] )- [ Str "First" , Space , Str "figure" ]+ [ Str "Figure"+ , Space+ , Str "#"+ , Space+ , Str "2:"+ , Space+ , Str "First"+ , Space+ , Str "figure"+ ] ( "img1.jpg" , "" ) ] ]@@ -342,7 +360,16 @@ [ Plain [ Image ( "" , [] , [] )- [ Str "Second" , Space , Str "figure" ]+ [ Str "Figure"+ , Space+ , Str "#"+ , Space+ , Str "3:"+ , Space+ , Str "Second"+ , Space+ , Str "figure"+ ] ( "img2.jpg" , "" ) ] ]@@ -365,7 +392,16 @@ [ Plain [ Image ( "" , [] , [] )- [ Str "Third" , Space , Str "figure" ]+ [ Str "Figure"+ , Space+ , Str "#"+ , Space+ , Str "4:"+ , Space+ , Str "Third"+ , Space+ , Str "figure"+ ] ( "img3.jpg" , "" ) ] ]@@ -417,21 +453,13 @@ ( "" , [] , [] ) (Caption Nothing [ Plain [ Str "a" ] ]) [ Plain- [ Image- ( "" , [] , [] )- [ Str "Subfigure" , Space , Str "a" ]- ( "img1.jpg" , "" )- ]+ [ Image ( "" , [] , [] ) [ Str "a" ] ( "img1.jpg" , "" ) ] ] , Figure ( "fig:subfigureB" , [] , [] ) (Caption Nothing [ Plain [ Str "b" ] ]) [ Plain- [ Image- ( "" , [] , [] )- [ Str "Subfigure" , Space , Str "b" ]- ( "img1.jpg" , "" )- ]+ [ Image ( "" , [] , [] ) [ Str "b" ] ( "img1.jpg" , "" ) ] ] ] , Header
test/m2m/emptyChapterLabels/expect.md view
@@ -2,13 +2,7 @@ ## 1 Subsection {#sec:subsection label=""} -::: {#fig:figure1 .figure}---::: caption-Figure 1: Figure1-:::-:::+{#fig:figure1} ### 1.1 Subsubsection {#sec:subsubsection}
test/m2m/label-precedence/expect.md view
@@ -2,25 +2,13 @@ text -::: {#fig:fig1 .figure}---::: caption-Figure α: A figure-:::-:::+{#fig:fig1} ## \*.A Subsection {#subsection} other text -::: {#fig:fig2 .figure}-{label="+"}--::: caption-Figure +: A figure with custom label-:::-:::+{#fig:fig2 label="+"} ### \*.A.A Subsubsection {#subsubsection} @@ -28,13 +16,7 @@ # B Custom on other elements {#custom-on-other-elements} -::: {#fig:fig3 .figure}-{label="F"}--::: caption-Figure F: Figure-:::-:::+{#fig:fig3 label="F"} ::: {#tbl:table label="T"} a b c
test/m2m/listOfTemplates-buillet-list/expect.md view
@@ -1,74 +1,20 @@-::: {#fig:1 .figure}---::: caption-Figure 1: 1-:::-:::--::: {#fig:2 .figure}---::: caption-Figure 2: 2-:::-:::--::: {#fig:3 .figure}---::: caption-Figure 3: 3-:::-:::--::: {#fig:4 .figure}---::: caption-Figure 4: 4-:::-:::--::: {#fig:5 .figure}---::: caption-Figure 5: 5-:::-:::+{#fig:1} -::: {#fig:6 .figure}-+{#fig:2} -::: caption-Figure 6: 6-:::-:::+{#fig:3} -::: {#fig:7 .figure}-+{#fig:4} -::: caption-Figure 7: 7-:::-:::+{#fig:5} -::: {#fig:8 .figure}-+{#fig:6} -::: caption-Figure 8: 8-:::-:::+{#fig:7} -::: {#fig:9 .figure}-+{#fig:8} -::: caption-Figure 9: 9-:::-:::+{#fig:9} # List of Figures
test/m2m/listOfTemplates-ord-list/expect.md view
@@ -1,74 +1,20 @@-::: {#fig:1 .figure}---::: caption-Figure 1: 1-:::-:::--::: {#fig:2 .figure}---::: caption-Figure 2: 2-:::-:::--::: {#fig:3 .figure}---::: caption-Figure 3: 3-:::-:::--::: {#fig:4 .figure}---::: caption-Figure 4: 4-:::-:::--::: {#fig:5 .figure}---::: caption-Figure 5: 5-:::-:::+{#fig:1} -::: {#fig:6 .figure}-+{#fig:2} -::: caption-Figure 6: 6-:::-:::+{#fig:3} -::: {#fig:7 .figure}-+{#fig:4} -::: caption-Figure 7: 7-:::-:::+{#fig:5} -::: {#fig:8 .figure}-+{#fig:6} -::: caption-Figure 8: 8-:::-:::+{#fig:7} -::: {#fig:9 .figure}-+{#fig:8} -::: caption-Figure 9: 9-:::-:::+{#fig:9} # List of Figures
test/m2m/listOfTemplates/expect.md view
@@ -1,74 +1,20 @@-::: {#fig:1 .figure}---::: caption-Figure 1: 1-:::-:::--::: {#fig:2 .figure}---::: caption-Figure 2: 2-:::-:::--::: {#fig:3 .figure}---::: caption-Figure 3: 3-:::-:::--::: {#fig:4 .figure}---::: caption-Figure 4: 4-:::-:::--::: {#fig:5 .figure}---::: caption-Figure 5: 5-:::-:::+{#fig:1} -::: {#fig:6 .figure}-+{#fig:2} -::: caption-Figure 6: 6-:::-:::+{#fig:3} -::: {#fig:7 .figure}-+{#fig:4} -::: caption-Figure 7: 7-:::-:::+{#fig:5} -::: {#fig:8 .figure}-+{#fig:6} -::: caption-Figure 8: 8-:::-:::+{#fig:7} -::: {#fig:9 .figure}-+{#fig:8} -::: caption-Figure 9: 9-:::-:::+{#fig:9} ::: {#lst:code1 .listing .haskell} Listing 1: Listing caption 1
test/m2m/loxItemTitle/expect.md view
@@ -1,74 +1,20 @@-::: {#fig:1 .figure}---::: caption-Figure 1: 1-:::-:::--::: {#fig:2 .figure}---::: caption-Figure 2: 2-:::-:::--::: {#fig:3 .figure}---::: caption-Figure 3: 3-:::-:::--::: {#fig:4 .figure}---::: caption-Figure 4: 4-:::-:::--::: {#fig:5 .figure}---::: caption-Figure 5: 5-:::-:::+{#fig:1} -::: {#fig:6 .figure}-+{#fig:2} -::: caption-Figure 6: 6-:::-:::+{#fig:3} -::: {#fig:7 .figure}-+{#fig:4} -::: caption-Figure 7: 7-:::-:::+{#fig:5} -::: {#fig:8 .figure}-+{#fig:6} -::: caption-Figure 8: 8-:::-:::+{#fig:7} -::: {#fig:9 .figure}-+{#fig:8} -::: caption-Figure 9: 9-:::-:::+{#fig:9} ::: {#lst:code1 .listing .haskell} Listing 1: Listing caption 1
test/m2m/numberOverride/expect.md view
@@ -2,62 +2,22 @@ ## 1.1 Earlier Subsection -::: {#fig:img1 .figure}---::: caption-Figure 1.1.1: Image 1-:::-:::+{#fig:img1} ## 1.6 Title of Subsection {#title-of-subsection number="6"} -::: {#fig:img2 .figure}---::: caption-Figure 1.6.1: Image 1.6.2-:::-:::--::: {#fig:img3 .figure}-{number="100500"}--::: caption-Figure 1.6.100500: Image 1.6.100500-:::-:::+{#fig:img2} -::: {#fig:img4 .figure}-+{#fig:img3+number="100500"} -::: caption-Figure 1.6.100501: Image 1.6.100501-:::-:::+{#fig:img4} ## 1.7 Title of Subsection -::: {#fig:img21 .figure}---::: caption-Figure 1.7.1: Image 1.7.1-:::-:::--::: {#fig:img31 .figure}-{number="100500"}--::: caption-Figure 1.7.100500: Image 1.7.100500-:::-:::+{#fig:img21} -::: {#fig:img41 .figure}-+{#fig:img31+number="100500"} -::: caption-Figure 1.7.100501: Image 1.7.100501-:::-:::+{#fig:img41}
test/m2m/secLabels/expect.md view
@@ -2,13 +2,7 @@ ## a.a Second Level Section {#second-level-section} -::: {#fig:myfig .figure}---::: caption-Figure a: my figure-:::-:::+{#fig:myfig} ## a.b Other Second Level Section {#other-second-level-section}
test/m2m/setLabelAttribute/expect.md view
@@ -1,12 +1,12 @@ # Section {#section label="1"} -::: {#fig:1 .figure label="1.1"}-+:::: {#fig:1 .figure label="1.1"}+ ::: caption Figure 1.1: Figure :::-:::+:::: [$$equation\qquad{(1.1)}$$]{#eq:1 label="(1.1)"}
test/m2m/subfigures-ccsDelim/expect.md view
@@ -1,6 +1,6 @@ You can define subfigures: -::: {#fig:subfigures .figure .subfigures}+:::: {#fig:subfigures .figure .subfigures} {#fig:subfig1} {#fig:subfig2}  {#fig:subfig4}  {#fig:subfig6}@@ -11,86 +11,32 @@ Figure 1: Caption. a --- 1; b --- 2; c --- 3; d --- 4; e --- 5; f --- 6; g --- 7; h --- 8; i --- 9 :::-:::--::: {#fig:subfigures2 .figure .subfigures}-::: {#fig:subfig21 .figure}---::: caption-a-:::-:::--::: {#fig:subfig22 .figure}---::: caption-b-:::-:::--::: figure---::: caption-c-:::-:::--::: {#fig:subfig24 .figure}---::: caption-d-:::-:::--::: figure-+:::: -::: caption-e-:::-:::+:::: {#fig:subfigures2 .figure .subfigures}+{#fig:subfig21} -::: {#fig:subfig26 .figure}-+{#fig:subfig22} -::: caption-f-:::-:::+ -::: {#fig:subfig27 .figure}-+{#fig:subfig24} -::: caption-g-:::-:::+ -::: figure-+{#fig:subfig26} -::: caption-h-:::-:::+{#fig:subfig27} -::: {#fig:subfig29 .figure}-+ -::: caption-i-:::-:::+{#fig:subfig29} ::: caption Figure 2: Caption. a --- 1; b --- 2; c --- 3; d --- 4; e --- 5; f --- 6; g --- 7; h --- 8; i --- 9 :::-:::+:::: Figures themselves can be referenced fig. 2, as well as individual subfigures: figs. 1 (a), 1 (b), 2 (i)
test/m2m/subfigures-grid/expect.md view
@@ -1,124 +1,70 @@ You can define subfigures: -::: {#fig:subfigures .figure .subfigures}+:::: {#fig:subfigures .figure .subfigures} +:------------------:+:------------------:+:------------------:+-| ::: {#fi | ::: {#fi | ::: figure |+| :::: {#fi | :::: {#fi | :::: figure | | g:subfig1 .figure} | g:subfig2 .figure} | {width="100%"} | | png){width="100%"} | png){width="100%"} | | | | | ::: caption | | ::: caption | ::: caption | c | | a | b | ::: |-| ::: | ::: | ::: |-| ::: | ::: | |+| ::: | ::: | :::: |+| :::: | :::: | | +--------------------+--------------------+--------------------+-| ::: {#fi | ::: figure | ::: {#fi |+| :::: {#fi | :::: figure | :::: {#fi | | g:subfig4 .figure} | {width="100%"} | {width="100%"} | | png){width="100%"} | | | ::: caption | | | ::: caption | e | ::: caption | | d | ::: | f |-| ::: | ::: | ::: |-| ::: | | ::: |+| ::: | :::: | ::: |+| :::: | | :::: | +--------------------+--------------------+--------------------+-| ::: {#fi | ::: figure | ::: {#fi |+| :::: {#fi | :::: figure | :::: {#fi | | g:subfig7 .figure} | {width="100%"} | {width="100%"} | | png){width="100%"} | | | ::: caption | | | ::: caption | h | ::: caption | | g | ::: | i |-| ::: | ::: | ::: |-| ::: | | ::: |+| ::: | :::: | ::: |+| :::: | | :::: | +--------------------+--------------------+--------------------+ ::: caption Figure 1: Caption. a --- 1, b --- 2, c --- 3, d --- 4, e --- 5, f --- 6, g --- 7, h --- 8, i --- 9 :::-:::+:::: -::: {#fig:subfigures2 .figure .subfigures}+:::: {#fig:subfigures2 .figure .subfigures} +:--------------------------------------------------------------------:+-| ::: {#fig:subfig21 .figure} |-|  |-| |-| ::: caption |-| a |-| ::: |-| ::: |+| {#fig:subfig21} | +----------------------------------------------------------------------+-| ::: {#fig:subfig22 .figure} |-|  |-| |-| ::: caption |-| b |-| ::: |-| ::: |+| {#fig:subfig22} | +----------------------------------------------------------------------+-| ::: figure |-|  |-| |-| ::: caption |-| c |-| ::: |-| ::: |+|  | +----------------------------------------------------------------------+-| ::: {#fig:subfig24 .figure} |-|  |-| |-| ::: caption |-| d |-| ::: |-| ::: |+| {#fig:subfig24} | +----------------------------------------------------------------------+-| ::: figure |-|  |-| |-| ::: caption |-| e |-| ::: |-| ::: |+|  | +----------------------------------------------------------------------+-| ::: {#fig:subfig26 .figure} |-|  |-| |-| ::: caption |-| f |-| ::: |-| ::: |+| {#fig:subfig26} | +----------------------------------------------------------------------+-| ::: {#fig:subfig27 .figure} |-|  |-| |-| ::: caption |-| g |-| ::: |-| ::: |+| {#fig:subfig27} | +----------------------------------------------------------------------+-| ::: figure |-|  |-| |-| ::: caption |-| h |-| ::: |-| ::: |+|  | +----------------------------------------------------------------------+-| ::: {#fig:subfig29 .figure} |-|  |-| |-| ::: caption |-| i |-| ::: |-| ::: |+| {#fig:subfig29} | +----------------------------------------------------------------------+ ::: caption Figure 2: Caption. a --- 1, b --- 2, c --- 3, d --- 4, e --- 5, f --- 6, g --- 7, h --- 8, i --- 9 :::-:::+:::: Figures themselves can be referenced fig. 2, as well as individual subfigures: figs. 1 (a), 1 (b), 2 (i)
test/m2m/subfigures-one-row/expect.md view
@@ -3,7 +3,7 @@ Regression test for [#381](https://github.com/lierdakil/pandoc-crossref/issues/381) -::: {#fig:latex .figure .subfigures}+:::: {#fig:latex .figure .subfigures} {#fig:logo1 width="40%"} {#fig:logo2 width="40%"} @@ -11,6 +11,6 @@ Figure 1: Copies of the LaTeX logo. a --- cool caption, b --- cooler caption :::-:::+:::: Those logos are different I swear. Especially fig. 1 (a) and fig. 1 (b).
test/m2m/subfigures/expect.md view
@@ -1,6 +1,6 @@ You can define subfigures: -::: {#fig:subfigures .figure .subfigures}+:::: {#fig:subfigures .figure .subfigures} {#fig:subfig1} {#fig:subfig2}  {#fig:subfig4}  {#fig:subfig6}@@ -11,86 +11,32 @@ Figure 1: Caption. a --- 1, b --- 2, c --- 3, d --- 4, e --- 5, f --- 6, g --- 7, h --- 8, i --- 9 :::-:::--::: {#fig:subfigures2 .figure .subfigures}-::: {#fig:subfig21 .figure}---::: caption-a-:::-:::--::: {#fig:subfig22 .figure}---::: caption-b-:::-:::--::: figure---::: caption-c-:::-:::--::: {#fig:subfig24 .figure}---::: caption-d-:::-:::--::: figure-+:::: -::: caption-e-:::-:::+:::: {#fig:subfigures2 .figure .subfigures}+{#fig:subfig21} -::: {#fig:subfig26 .figure}-+{#fig:subfig22} -::: caption-f-:::-:::+ -::: {#fig:subfig27 .figure}-+{#fig:subfig24} -::: caption-g-:::-:::+ -::: figure-+{#fig:subfig26} -::: caption-h-:::-:::+{#fig:subfig27} -::: {#fig:subfig29 .figure}-+ -::: caption-i-:::-:::+{#fig:subfig29} ::: caption Figure 2: Caption. a --- 1, b --- 2, c --- 3, d --- 4, e --- 5, f --- 6, g --- 7, h --- 8, i --- 9 :::-:::+:::: Figures themselves can be referenced fig. 2, as well as individual subfigures: figs. 1 (a), 1 (b), 2 (i)
test/m2m/titlesInRefs/expect.md view
@@ -1,12 +1,6 @@ # Section {#sec:section} -::: {#fig:figure .figure}---::: caption-Figure 1: A Figure-:::-:::+{#fig:figure} sec. 1 (Section)
test/test-pandoc-crossref.hs view
@@ -90,7 +90,7 @@ describe "References.Blocks.replaceBlocks" $ do it "Labels images" $ testAll (figure "test.jpg" "" "Test figure" Nothing "figure")- (figure "test.jpg" "" "Figure 1: Test figure" (Just "Test figure") "figure",+ (figure "test.jpg" "" "Figure 1: Test figure" (Just "Figure 1: Test figure") "figure", PfxImg =: M.fromList $ refRec' "fig:figure" 1 "Test figure") it "Labels subfigures" $ testAll (@@ -319,7 +319,7 @@ table' "A table" "some_table1" <> para (citeGen "tbl:some_table" [1]) `test` concat (- [ "\\begin{longtable}[]{@{}@{}}\n"+ [ "\\begin{longtable}[]{@{}l@{}}\n" , "\\caption{\\label{tbl:some_table1}A table}\\tabularnewline\n" , "\\toprule\\noalign{}\n" , "\\endfirsthead\n"