Creating an extension to add flowing columns to Word & ODT #1541
Replies: 4 comments 6 replies
-
I could be wrong about this, but I also believe that Word's style editor doesn't include the column options, which makes it difficult to bring in a reference document that includes support for extra columns (and also makes sense, since section break info is inlined into the paragraph). I'm less familiar with OpenOffice, but I believe its style editor does allow you to configure section styles that include columns (which also makes sense since column info is stored as section style info in |
Beta Was this translation helpful? Give feedback.
-
I believe there is no need for an extension:
|
Beta Was this translation helpful? Give feedback.
-
The basics of this are working now! Still gotta shore it up a bit with nested fenced divs and such, but it's looking good. |
Beta Was this translation helpful? Give feedback.
-
Working on a PR to improve the insertion of column specs into the document, but it's not ready yet! Still getting weird results in a lot of cases 🤔 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is maybe more of a Pandoc question/discussion than a Quarto one, but I'll throw it in here anyway!
I've been exploring the potential to create a Quarto extension implementing a Pandoc filter that turns fenced divs with a class on them into flowing column sections.
The
.columns
class for HTML formats in Quarto creates explicit columns (where you explicitly identify the content that goes in each column), but it's common to have columns in many formats where content overflowing the first column flows into the next one.This is easy enough in HTML with a fenced div and
style="columns: 2"
,style="columns: 6rem auto"
, etc. But in OpenOffice ODT and Word documents, it's a real pain in the bum.In Word, sections do not have separate parent elements; instead, you add the style information (eg. column spec) to the final paragraph of a section, unless it's the final section, in which case you add it to the end of the body. (This is still blowing my mind.) So theoretically, you need to walk the document to identify all potential sections, add the "previous section" before your fenced div, then work out whether your fenced one is the final one and place the style info appropriately.
In OpenOffice it at least makes more sense, but it's potentially even less possible for a filter: you tag the section content using a
text:section
parent element, then you add a style with the column spec tostyles.xml
, and you link the two with astyle-name
attribute. I'm pretty sure this is impossible to achieve in a filter without providing an appropriately structured reference document that already has a section style in it.Maybe the filter can load the reference document and modify its contents raw though? Perhaps a Quarto extension could bundle its own reference document in - seems like a shame when most people will want to bring their own though! (I would argue that Pandoc's reliance on reference docs for style information is a weakness of the format generally, but 🤷🏻♂️)
Any ideas or brainstorming here would be appreciated! I've set up a skeleton extension, but so far it's, uhh, very skeletal 😆 https://github.com/jimjam-slam/columnflow
Beta Was this translation helpful? Give feedback.
All reactions