Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201867

How to get formatting of style in officer?

$
0
0

I want to write some documents with officer and I have some predefined styles in my word document that I load with read_docx(). Now I can look at the styles but I especially want to know which font type or which font size each style has and I cannot find that. This is all I can find:

Document <- read_docx(FILEPATH)
head(Document$styles)
  style_type style_id style_name is_custom is_default
1  paragraph   Normal     Normal     FALSE       TRUE
2  paragraph Heading1  heading 1     FALSE      FALSE
3  paragraph Heading2  heading 2     FALSE      FALSE
4  paragraph Heading3  heading 3     FALSE      FALSE
5  paragraph Heading4  heading 4     FALSE      FALSE
6  paragraph Heading5  heading 5     FALSE      FALSE

Unfortunately there is no column with the font size or font type. I really need to have the font size (for example 10) and font type (for example "Times New Roman") of heading 1 in R because the argument style of the function body_add_par is not enough for my purposes. Is there a way to get this?


Viewing all articles
Browse latest Browse all 201867

Trending Articles