Timeline for ODT support for implicit_figures? #2401
No timeline. If someone wants to write the code (and adjust tests accordingly) and submit a PR, I'd certainly consider merging it.
OK, wish I could help but I really wouldn't know where to start, plus Haskell looks like Klingon to my poor Biologist-procedural-programmer eyes. I had a look at the Text.Pandoc.Writers.ODT.hs and see there is a blockToOpenDocument function but how to wrangle that to do the conversion...
Thanks John!
Also this is the code in MMD that handles images with optional captions:
https://github.com/fletcher/MultiMarkdown-4/blob/master/odf.c#L463
I guess docs should've been updated, but other than that, I believe Pandoc supports implicit_figures
with OpenDocument/ODT output.
@lierdakil — hm, going from MMD -> ODT with the example above and no image captions are generated. Perhaps this fails for the MMD input case, though the syntax is the same I think. If I use:
![This is the caption](Beast_mmd/eyes.png)
I get no caption even as a subsequent paragraph:
<text:p text:style-name="First_20_paragraph"><draw:frame draw:name="img1" svg:width="397pt" svg:height="400pt"><draw:image xlink:href="Pictures/0.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" /></draw:frame></text:p>
using the following commandline: pandoc test.md --from markdown_mmd -o testPD.odt
— pandoc is pandoc 1.15.0.6 on OS X 10.11.1
Right, if I omit the MMD --from
then I get the caption, so for some reason this is being ignored for MMD, though MMD itself supports it...
Yes, that works @lierdakil thank you. So the question is if there is a reason the extension is not enabled by default for MMD (as both support the same syntax for the same feature), if there is then this can be closed.
MMD also wraps the figure caption in a frame which is slightly cleaner structurally, and appends figure number sequence (auto numbering which a reference-able). The XML seems pretty straight-forward for this. No great issue and I could probably even hack this myself, but wonder if there are reasons against using a frame (1) and adding numbering (2). The argument against (2) is that it wouldn't apply across output formats (does HTML even support auto-numbering etc.). But wrapping the caption in a frame is what LibreOffice does by default I think.
Thanks @lierdakil, using a frame is no big issue. And I understand the issue with auto-numbering, though pandoc does have other features only some formats support but not others. But that is for another issue.
I also notice subscript
and superscript
extensions have to be explicitly enabled, and again these are things MMD supports too...
Here is the documentation FYI for subscript
and superscript
support in MMD:
http://fletcher.github.io/MultiMarkdown-4/MMD_Users_Guide.html#superscriptsandsubscripts
Subscripts and superscripts work differently in MMD.
You can do e^2
and a~1
, where in pandoc you need to do e^2^
or a~1~
.
Still, since the pandoc-style ones WILL work in MMD, enabling these options seems fine.
@iandol I think the numbering is a bit problematic, without some mechanism for localization -- we don't want to bake in the word "Figure" as the XML above does. But putting the whole thing in a frame seems worth doing and shouldn't be too complex. @lierdakil what difficulties did you encounter? I don't think we need to worry about other formats. It would be good to do this in Word too, but I see no reason not to do it in ODT even without doing it in Word.
@jgm, it was a while ago, so details are somewhat fuzzy. What I can remember right off the bat is that frame dimensions were messed up between OO and LO due to different rendering strategy, and only way I was able to make it work in both was setting frame dimensions in pixels. I'm no ODF expert though, so I might have missed an obvious solution.
P.S. And when I was talking about Word, I meant it's ODT renderer, not docx.
Even with images as they currently are (without the nested frames) I often have to do manual resizing in odt (Libreoffice), so I don't think that should be a show stopper. @lierdakil - perhaps whatever code you wrote before is worth trying again in the latest releases of OO.org and LO, if you still have it.
As for hardcoding "Figure", is there anything wrong with a writer-specific option?
Hi, the documentation suggests for implicit_figures "This feature is not yet implemented for RTF, OpenDocument, or ODT". Multimarkdown does support figure captions for block markup figures, with this MMD:
generating the following FODT:
Will implicit_figures for ODT be supported in pandoc at some point in the future, and is there a timeline more or less? Thanks for an excellent tool!