-
Is there a way to create a custom-reference.docx without using Microsoft Word to modify the styles? I need a more efficient method for setting up document styles that doesn't involve navigating Word's complex interface. This would greatly streamline my workflow and avoid the frustration of using a tool that doesn't fit my preferences. Are there perhaps more example reference docx files availble that someone can share with me? Any suggestions or alternatives to using Microsoft Word would be appreciated. EDIT: <w:style w:type="character" w:customStyle="1" w:styleId="VerbatimChar">
<w:name w:val="Verbatim Char" />
<w:basedOn w:val="BodyTextChar" />
<w:rPr>
- <w:rFonts w:ascii="Consolas" w:hAnsi="Consolas" />
+ <w:rFonts w:ascii="Source Code Pro" w:hAnsi="Source Code Pro" />
<w:sz w:val="22" />
</w:rPr>
</w:style> Running the generator created the correct output as expected for inline code in my document. I would like to follow some siliar procedure to modify the body text, but I can't quite seem to hack it. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
Yes, you can just edit the XML files directly (docx is just a zip archive which you can unzip and rezip with standard tools). However, you have to have a good grip on the syntax that is expected. |
Beta Was this translation helpful? Give feedback.
-
@jstnfst You don't need to muck around in the XML just because you don't have MS Word. I modify my reference files in LibreOffice (which is free, AFAIK in both senses) on Linux and it works just dandy. |
Beta Was this translation helpful? Give feedback.
-
Thank you both for your help! I love to code, and turns out I can make a quick minor fix to get everything working that was giving me headaches. As was suggested, unzip custom-reference.docx, hack files, rezip works like a charm!
Here's my updated reference doc, with source code pro and arial fonts, black headings, and bob's your uncle! |
Beta Was this translation helpful? Give feedback.
-
I'm not a Python person, but I know someone who uses this package: https://python-docx.readthedocs.io/en/latest/api/style.html It can read and manipulate docx using a more consistent API... |
Beta Was this translation helpful? Give feedback.
For the nerds: