addStyleToNode: Add a Formatting Style to a WordProcessingML Node

View source: R/style.R

addStyleToNodeR Documentation

Add a Formatting Style to a WordProcessingML Node

Description

This function accepts an XML node which meets the WordProcessingML specifications, as well as a character string indicating the id of a formatting style. The node is then given that style, after any existing style is removed.

Usage

addStyleToNode(node, style.id, inline = FALSE, is.table = FALSE)

Arguments

node

the XML (WordProcessingML) node to which the style should be added.

style.id

a character vector containing the Id (not name) of the style to be added. A style's id is generally it's name with any whitespace removed.

inline

a logical value indicating whether the style is an inline style (as opposed to a paragraph-based style).

is.table

a logical value indicating whether the style is a table style.

Value

Returns the node with the specified style added to it.

Note

As stated above, any existing style specification on the node passed to this function will be removed so that the style identified by style.id can be added.

Note

Currently, no check is performed to assure the style exists before it is added. As such, lookupStyle should be called before this function is used.

Author(s)

Gabriel Becker

References

ISO/Microsoft OOXML Specification

See Also

lookupStyle, paragraph


duncantl/RWordXML documentation built on Nov. 23, 2023, 4:23 p.m.