Wordprocessing Text
A run defines a non-block region of text with a common set of properties. It is specified with the <w:r> element. The properties of the run are specified with the <w:rPr> element, which is the first element of the <w:r>. Runs most commonly contain text elements <w:t> (which contain the actual literal text of a pararaph), but they may also contain such special content as symbols, tabs, hyphens, carriage returns, drawings, breaks, and footnote references. See Special Content.
Elements:
The <w:r> element can contain a whole host of elements. The most commonly used are shown below.
Element | Description |
---|---|
br | Specifies a break. See Text - Special Content. Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.3.3.1.
|
cr | Specifies a carriage return. See Text - Special Content. <w:r><w:t>This is another</w:t>
<w:cr/><w:t xml:space="preserve"> simple sentence.</w:t></w:r>
Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.3.3.4.
|
drawing | Specifies that a drawing object (that is, a graphical DrawingML object such as a diagram, chart, or picture) is located in the run. The layout of the DrawingML object within the document (i.e., its positioning on the page) is specified using the WordProcessingL drawing syntax.
Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.3.3.9.
|
noBreakHyphen | Specifies a non-breaking hyphen character. See Text - Special Content. Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.3.3.18.
|
rPr | Specifies properties for the run. See Styles - Character Styles. Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.3.2.28.
|
softHyphen | Specifies a soft hyphen character. See Text - Special Content. Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.3.3.29.
|
sym | Specifies a special character or symbol. See Text - Symbols. Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.3.3.30.
|
t | Specifies literal text which will be displayed in the run. Most all text within a document is contained within t elements, except text within a field code. There is one possible attribute (xml:space) within the XML namespace that can be used to specify how space within the t element is to be handled. Possible values are preserve and default. If whitespace within a run needs to be preserved, it is important that this attribute be set to preserve. See the XML 1.0 specification at § 2.10. <w:r>
<w:t>This is another</w:t>
</w:r>
<w:r><w:br/><w:t xml:space="preserve"> simple sentence.</w:t>
</w:r>
Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.3.3.31.
|
tab | Specifies a tab character. See Text - Special Content. Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.3.3.32.
|
Related Open Document Format (ODF) Property:
The content model for text in ODF is very similar to HTML. Character data is inside of paragraphs without being further nested in runs and text elements as it is in OOXML. When formatting of text within a paragraph is necessary, the <text:span> element is used.