Michael Becker <michael-QF1XyMwE1Uwv0rdu9s6TydBPR1lH4CV8@public.gmane.org> schrieb am So., 24. Juli 2022, 20:46:
Hi there, I have found a way to manually do this with BBEDIT. After exporting the file I Open the doxc file with BBEDIT (no zip or unzip required).  I can then do a global replace and replace the table style I want word to use, e.g. replace "Table" with "MyTable". 

Here is my question. Does anyone know of a list to terminal commands that I could write that would automatically go into the docx file and make the changes I want.

Something like this should do the trick (untested):

unzip -x ~/storage/file-sample_100kB.docx word/document.xml    

sed -i -e 's!<w:tblStyle w:val="Table"/>!<w:tblStyle w:val="MyTable"/>!g' word/document.xml

zip -u ~/storage/file-sample_100kB.docx word/document.xml

Best regards, Anton

Tinderbox can trigger runCommands. It is not clear to me what the steps would be to get into the document.xml file, globally replace the style val and save it. 

Manually, this works every time. Now I'd like to automate the process. 

2022-07-24_11-42-52.png
On Sunday, July 24, 2022 at 9:32:07 AM UTC-7 Michael Becker wrote:
I'm really struggling with outputting formatted tables using pandoc in MS Word.  I'm exporting HTML from a tool called Tinderbox. I then convert the clean HTML to a docx file with pandoc. The tables always come through with NO styling, even after I've modified the default table style in the the reference.docx file. 

I read tons of post on this, but for the life of me I can't figure it out. There are some that suggest going into the word XML but I'm not sure how to automate this. I'm on maxOS Silicon Anyone of any idea on how to make this work?

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/56f6388c-72f5-41c0-9d51-2a803644b6dcn%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAMoRF4k0gDFQTzKTYKPCh5Uiyp2zm2BWsKji2rE9DRfJdvAKSw%40mail.gmail.com.