Comments (1)
Actually this problem was not restricted to tables, I had it even on body text.
Fortunately I found where the problem came from. I did not have the right Styles in my template.docx
.
I figured it out thanks to the reStructuredText documentation.
It turns out that *this*
is actually a disguised version of :emphasis:`this`
.
Looking at docxbuilder's documentation Chapter 6.1.2 User defined styles, I thought that :emphasis:`this`
would look for a "Emphasis" Word Style.
It turns out there is a built-in "Emphasis" Style, that appears in the Word Home>Styles.
But if you actually look at the implemented Styles (Alt+Ctrl+Maj+S) it does not appear in the list (at least not in my case).
The Fixing Operation:
- Open my
template.docx
- Apply "Emphasis" to a chunk of text
- Check that "Emphasis" now appears in the Styles list
- Save
And then would my generated documents implement *this*
as emphasis.
To be clear, you don't even have to define :
docx_style_names = {
'emphasis': 'Emphasis'
}
The same can be done for **this**
. Since it translates to :strong:`this`
, you just have to repeat the Fixing Operation with the "Strong" Style.
Side Note:
Because I am French working with a french Word interface, my built-in Styles are translated, so "Emphasis" is called "Accentuation". But i guess the OpenXML backend treats it the same way. I did the Fixing Operation with "Accentuation" and it solved the problem the same way. So I guess, if you also have a translated version of Word, all you need is to find out what "Emphasis" and "Strong" translate to in your language.
from docxbuilder.
Related Issues (17)
- Change the languages of the paragraphs
- Table caption position
- List of figures and tables HOT 1
- Body text has always zero left indentation
- Support for custom directive defined as extension HOT 1
- First page title doesn't work HOT 1
- The Literal Block style settings are not applied HOT 2
- Images are not shown with matplotlib.sphinxext.plot_directive
- Note, Warning etc directives are not formatted in DOCX HOT 1
- Problem with ToC numeration HOT 1
- Problem ะขะะก generation HOT 1
- Modified cover page results in IndexError HOT 4
- Use first page / section as cover page
- csv-table align option is ignored HOT 3
- Handling images HOT 2
- Image style are not applied HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docxbuilder.