lierdakil / pandoc-crossref

Pandoc filter for cross-references
https://lierdakil.github.io/pandoc-crossref/
GNU General Public License v2.0
909 stars 73 forks source link

pandoc could not pick up the figure which pandoc-crossref specifies using "<figure" #434

Closed jiucenglou closed 2 months ago

jiucenglou commented 2 months ago

Explain the problem.

I have a folder tree of

user@localhost:/mnt/d/mwe3$ tree .
.
├── Ch3
│   ├── Ch3.md
│   ├── Ch3_tmp.docx
│   ├── Ch3_tmp.md
│   └── img
│       └── mech.jpg
├── pandoc
└── pandoc-crossref

Ch3.md is

# title

## results

![mech scheme.](Ch3/./img/mech.jpg){#fig:mech height=12.09cm }

and I am using the following two runs to get docx

./pandoc  -F pandoc-crossref Ch3/Ch3.md --resource-path=Ch3 -o Ch3/Ch3_tmp.md
./pandoc  Ch3/Ch3_tmp.md -o Ch3/Ch3_tmp.docx

As shown below for the intermediate Ch3_tmp.md, the latest pandoc & pandoc-crossref starts to specify the figure using <figure. However, now the second run above generates a docx file without the figure in it... With pandoc 2.19 and the compatible pandoc-crossref, <figure is not yet used and docx file resulted contains the figure. Could you suggest what I could do to use the latest pandoc to generate a docx file with the figure in it ? Many thanks !

# title

## results

<figure id="fig:mech">
<img src="Ch3/./img/mech.jpg" style="height:12.09cm"
alt="mech scheme." />
<figcaption>Figure 1: mech scheme.</figcaption>
</figure>

Pandoc version? latest 3.13

Pandoc-crossref version? latest 0.3.17

jiucenglou commented 2 months ago

Closed as suggested by jgm in https://github.com/jgm/pandoc/issues/9720