View Categories

p.pre

1 min read

Table of Contents

Syntax #

p.pre

Purpose #

The p.pre annotation is used to tag elements where preformatted line breaks, white space, and character spacing must be preserved.

This annotation functions as a stricter version of p.lines, which preserves line breaks but not white space or character spacing. The p.lines annotation can be used if white space and character spacing do not need to be preserved.

Examples #

The following is an example of a time where you might want to use the p.pre annotation:

In the source document, the text is formatted with expanded character spacing and line breaks.

In Migrate, the same text appears as follows:

The following is an example of a rule that will apply p.pre:

The following is the DITA XML output for the rule:

 

<conbody>
<pre>In pale moonlight&#x2028; the wisteria&#x2019;s scent&#x2028;comes from far away&#x2028;- Yosa Buson</pre>
</conbody></conbody></conbody></conbody><title>Table 2. Loud Animals</title></fig></related-links></titlealts></titlealts><title>Figure 2. Happy Face</title></fig>

 

This XML will preserve the line breaks and expanded character spacing.