DocBook figure
elements should be converted to Figure
in the AST
#8668
Labels
figure
elements should be converted to Figure
in the AST
#8668
Explain the problem.
Consider the following DocBook document (example.xml):
When converting the above DocBook with pandoc, the AST obtained with
pandoc -f docbook -t native example.xml
is:Then, for example, when I convert the DocBook document to LaTeX, the figure is considered to be an inline element and thus a figure environment is not created, i.e., this is the output of
pandoc -f docbook -t latex example.xml
:The figure has no caption and no label so it cannot be cross-referenced.
Note that the previous examples were obtained with the development version of pandoc. I also tried with pandoc version 2.14.0.3 (the one that is available in the Fedora 37 repositories, the OS that I am currently using) and in that version the result was as expected: the command
pandoc -f docbook -t latex example.xml
produced the following resultThis seems to be related to the
Figure
block element discussed in #3177. I think that the core problem is that the DocBookfigure
element needs to be converted to aFigure
element in the pandoc AST, instead of anImage
inside aPara
element as it is done now.Note that DocBook also has an
informalfigure
element (https://tdg.docbook.org/tdg/5.1/informalfigure.html), this is a figure without title, currently it is processed in the same way as thefigure
element, but theinformalfigure
element is also a block element, thus I guess it should be also converted to aFigure
element in the pandoc AST.Pandoc version?
Pandoc development version
The text was updated successfully, but these errors were encountered: