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
Pandoc's docx writer currently forces the alignment of every table cell with a w:jc tag, even when the column alignment is AlignDefault, in which case Pandoc emits <w:jc w:val="left" />. Left alignment is not necessarily correct, especially because the w:jc tag overrides the other user-controllable means to control alignment, i.e. table styles and paragraph styles. This produces a round-trip (Docx->Pandoc->Docx) failure for at least some tables. Worse, it is impossible to produce a column in which different cells have different alignments. (This is not as stupid as it sounds: center-aligned headers look good over a column that contains left-aligned paragraph text.)
Word itself generally does not emit any w:jc tag when a cell's alignment is controlled by either the table style or paragraph style. (Well, the one file I examined had no w:jc tags; I haven't thoroughly investigated Word's behavior.)
Proposal: Alter blockToOpenXML' to emit no w:jc tag when the corresponding column alignment is AlignDefault.
I haven't extensively considered how this might produce unexpected results or break existing workflows. I'm not aware of any workaround for this limitation.
@conklech This sounds reasonable to me. We just need to test extensively to make sure it doesn't have any unexpected effects. Do you want to prepare a PR?
Pandoc's docx writer currently forces the alignment of every table cell with a
w:jc
tag, even when the column alignment isAlignDefault
, in which case Pandoc emits<w:jc w:val="left" />
. Left alignment is not necessarily correct, especially because thew:jc
tag overrides the other user-controllable means to control alignment, i.e. table styles and paragraph styles. This produces a round-trip (Docx->Pandoc->Docx) failure for at least some tables. Worse, it is impossible to produce a column in which different cells have different alignments. (This is not as stupid as it sounds: center-aligned headers look good over a column that contains left-aligned paragraph text.)Word itself generally does not emit any
w:jc
tag when a cell's alignment is controlled by either the table style or paragraph style. (Well, the one file I examined had now:jc
tags; I haven't thoroughly investigated Word's behavior.)Proposal: Alter
blockToOpenXML'
to emit now:jc
tag when the corresponding column alignment is AlignDefault.I haven't extensively considered how this might produce unexpected results or break existing workflows. I'm not aware of any workaround for this limitation.
See:
pandoc/src/Text/Pandoc/Writers/Docx.hs
Line 962 in 99e24cf
pandoc/src/Text/Pandoc/Writers/Docx.hs
Line 1048 in 99e24cf
The text was updated successfully, but these errors were encountered: