The Setup
I'm working on a large book in Indesign. I write in Scrivener and process the text with python. After compiling my text with python, I run the whole manuscript through Pandoc to get ICML for indesign. I then cut that ICML up into chapters to prevent Indesign from choking on it.
The original manuscript in markdown contains some tables. What I'm trying to do is make these tables span columns of text. (NOT cells spanning columns inside the table.) When I edit the copy to make a table span columns in Indesign and read the ICML source generated, I see something like this:
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/TableCaption" SpanColumnType="SpanColumns">
<CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Default">
<Table Self="uf2i18802" HeaderRowCount="1" FooterRowCount="0" BodyRowCount="11" ColumnCount="2" AppliedTableStyle="TableStyle/Table" TableDirection="LeftToRightDirection">
<Row Self="uf2i18802Row0" Name="0" SingleRowHeight="11.99688720703125" />
Now, my Pandoc output looks more like this:
<Table AppliedTableStyle="TableStyle/Table" HeaderRowCount="1" BodyRowCount="11" ColumnCount="2">
<Column Name="0" />
So what I do is wrap the entire <Table>
element in that <ParagraphStyleRange>
and <CharacterStyleRange>
elements, with the SpanColumnType="SpanColumns"
on the paragraph, because this is apparently what happens in ICML when you set a table to span columns.
The Problem
The python script I've got runs fine, and even seems to insert the correct elements and indent the <Table>
element properly:
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/TableCaption" SpanColumnType="SpanColumns">
<CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Default">
<Table AppliedTableStyle="TableStyle/Table" HeaderRowCount="1" BodyRowCount="3" ColumnCount="2">
<Column Name="0" SingleColumnWidth="120.0" />
But the change doesn't take in Indesign.
I've even noticed that the relevant attribute is removed when I check out the ICML and check it back in, as though the attribute is not accepted and is removed because it's invalid.
Am I doing this wrong? Is there a better way to do this? Is there documentation for how to do this type of thing somewhere?
I haven't found a lot of ICML resources, so I'm basically forced to do this by trial and error. Apparently Pandoc itself is one of the most relevant links on any search string related to ICML, which doesn't much help. This document has a specification for the defaults of ICML documents, but I can't see anything wrong with the solution I'm attempting here. And to top it off, there's no ICML tag here on StackOverflow, so it's pretty rare apparently.