You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is where(line 554) the "fig:" prefix is added to the title.
I also ran some experiments with the following HTML input:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<h1> Text Float </h1>
<p> Some paragraph </p>
<figure>
<p> Some text </p>
<ul>
<li>This is an item of a list</li>
</ul>
<figcaption>
This is the caption of the first figure.
</figcaption>
</figure>
<h1> Image Float </h1>
<figure>
<p> Also some paragraph here </p>
<ul>
<li>This is an item of a list</li>
</ul>
<img src="../media/rId25.jpg" alt="the moon">
<figcaption>
This is the caption of the second figure.
</figcaption>
</figure>
<h1> Contrived Image Float </h1>
<figure>
<p> Also some paragraph here </p>
<ul>
<li>This is an item of a list</li>
</ul>
<img src="../media/rId25.jpg" alt="the moon">
<img src="../media/rId25.jpg" alt="the moon">
<figcaption>
This is the caption of the second figure.
</figcaption>
<figcaption>
This is the caption too of the second figure.
</figcaption>
</figure>
</body>
</html>
The relationship among the elements in the first figure is lost. Perhaps that
information may be preserved using the Div constructor or the newly proposed Figure.
One image and one caption are also lost in the third heading. Is this the
intended behavior given lines 548-549? @tarleb
The paragraphs in the last two figures are lost
HTML roundtrip
For reference.
$ stack run pandoc -- figure.html -t html
<h1 id="text-float">Text Float</h1>
<p>Some paragraph.</p>
<p>Some text</p>
<ul>
<li>This is an item of a list</li>
</ul>
<p>This is the caption of the first figure.</p>
<h1 id="image-float">Image Float</h1>
<figure>
<img src="../media/rId25.jpg" alt="This is the caption of the second figure." /><figcaption aria-hidden="true">This is the caption of the second figure.</figcaption>
</figure>
<h1 id="contrived-image-float">Contrived Image Float</h1>
<figure>
<img src="../media/rId25.jpg" alt="This is the caption of the second figure." /><figcaption aria-hidden="true">This is the caption of the second figure.</figcaption>
</figure>
Conclusion
Introducing the new constructor would allow pandc to preserve more information
about figures. Although there are, less specific, alternatives to achieve the
same using existing constructors.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I've been studying how does
pandoc
currently handles figures in the HTMLformat.
The relevant function is
pFigure
quoted next:pandoc/src/Text/Pandoc/Readers/HTML.hs
Lines 537 to 555 in f198356
This is where(line 554) the
"fig:"
prefix is added to the title.I also ran some experiments with the following HTML input:
which renders (using Firefox) to:
Current
pandoc
handlingNative representation
The relationship among the elements in the first figure is lost. Perhaps that
information may be preserved using the
Div
constructor or the newly proposedFigure
.One image and one caption are also lost in the third heading. Is this the
intended behavior given lines 548-549? @tarleb
The paragraphs in the last two figures are lost
HTML roundtrip
For reference.
Conclusion
Introducing the new constructor would allow
pandc
to preserve more informationabout figures. Although there are, less specific, alternatives to achieve the
same using existing constructors.
Beta Was this translation helpful? Give feedback.
All reactions