Skip to content

opendocument writer prevents complicated templates #2520

Closed
blindmelon opened this Issue · 1 comment

1 participant

@blindmelon

(The title of this issue isn't great, sorry.)

The basic problem

The office:automatic-styles tag can only be used once (that is, subsequent uses override rather than append) in LibreOffice, and because the opendocument writer already uses it, a template can't separately set it.

Suggested solution

My suggestion would be to change the opendocument default template to change to look like <office:automatic-styles>$automatic-styles$</office:automatic-styles> and the writer to write styles between the tags instead of actually writing the tags. This would allow templates which set automatic styles.

Further explanation and thoughts for the future

Setting automatic styles might sound a bit crazy, but it is necessary to trigger a different page style for the title page, etc. This might also be possible by directly editing the reference odt's xml, that is yet another layer of complication.

The ideal situation for the future, in my opinion, would be a template.odt incorporating what is currently split between the reference.odt and the opendocument template and making use of built in features such as author field using the author from the metadata, etc. Such a template would be easier to customise for end users, but would probably require a massive rewrite of the writer and would break existing workflows.

@jgm jgm added a commit to jgm/pandoc-templates that referenced this issue
@jgm opendocument template: Add "automatic-styles" tag.
This allows more customization.
See jgm/pandoc#2520.
c318744
@jgm jgm added a commit that closed this issue
@jgm Allow more customization of opendocument styles.
Automatic styles can now be inserted in the template,
since the template, not the writer, now provides the
enclosing `<office:automatic-styles>` tags.

Closes #2520.
420c86b
@jgm jgm closed this in 420c86b
@blindmelon

Thanks - I can get rid of some post processing sed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.