Skip to content

ODT reference.odt does not contain TableCaption style #10053

@iandol

Description

@iandol

Explain the problem.

When Pandoc has a table with a caption:

> pandoc -s -o out.odt

  Right     Left     Center     Default
-------     ------ ----------   -------
     12     12        12            12
    123     123       123          123
      1     1          1             1

Table:  Demonstration of simple table syntax.

Text
image

The ODT does not have a styled caption (it is Default Paragraph Style). The paragraph XML source is styled with TableCaption:

<text:p text:style-name="TableCaption">Demonstration of simple table syntax.</text:p>

…however this style is not present in the reference.odt — I checked in Pandoc V3.3

The fix is simple, add this named style. I attach a custom-reference.odt where this is done and using this reference the table caption is styled. Here is what I added:

image

This is the latest pandoc, generating using: pandoc -o custom-reference.odt --print-default-data-file reference.odt

custom-reference.odt

I edited custom-reference.odt using Libreoffice:

Version: 24.2.5.2 (AARCH64) / LibreOffice Community
Build ID: bffef4ea93e59bebbeaf7f431bb02b1a39ee8a59
CPU threads: 8; OS: macOS 14.6; UI render: Skia/Metal; VCL: osx
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded

I can make this a pull request once I find where reference.odt is on github.

Pandoc version?
ε ➪ pandoc -v
pandoc 3.3
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: /Users/ian/.local/share/pandoc
Copyright (C) 2006-2024 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions