Open StephanMeijer opened 1 year ago
Also tested on:
pandoc 3.1.4
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: /Users/steve/.local/share/pandoc
Copyright (C) 2006-2023 John MacFarlane. Web: https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.
When the Title style is applied in Google docs, the exported odt has this:
<text:p text:style-name="P2">
<text:bookmark text:name="_zcuel4vwl53z" />The title</text:p>
With
<style:style style:name="P2" style:family="paragraph"
style:parent-style-name="Title"
style:master-page-name="Standard">
<style:paragraph-properties style:page-number="1" />
</style:style>
So perhaps the reader could determine that it's a title by looking up the style P2 and then getting parent-style-name attribute.
Is this an easy fix? If so, I might be able to plan with my team to fix this ourselves.
I don't know how easy it would be. I didn't write the ODT reader, and I'm not too familiar with it.
You'd want to look at constructPara in Readers/ODT/ContentReader, I think. And you'd need a function that gets the parent style name, not just the style name as present.
When a title was recognized, you'd need to insert it into metadata instead of the document.
The ODT reader is written in a strange style, with arrows, so it's a bit unusual.
@jgm I improved the description on this ticket with also reproductional information.
@jgm updated description with examples using no filters
Pandoc versions
Pandoc 3.1.2 under macOs (M1)
Examples and reproduction
Previously we created documents using Google Docs. We are using some filters and templating which you can see here.
We are running it with:
Examples
Explanation on examples
As you can see, the title and subtitle are not respected in the output format but rendered as a paragraph instead of in the head. Examples of how it should be rendered can be found here (these examples use a
.docx
-file as source, not a.odt
):Issues:
Subtitle and title metadata is not preserved when exporting a document to
.odt
in Google Docs when using Pandoc in standalone mode and it renders like a regular<p>
. Subtitle and title do not become available as variables$title$
and$subtitle$
in the template and are somehow rendered as paragraph, not asmeta
-tag as defined in thesrc/template.html
.Headings are converted to
<p>
tags with anchors.