How ALD Applies Style to Text > Text Properties
  
Text Properties
Processing instructions (PIs) are used extensively within PTC ALD and they have two main uses:
1. Set text properties: PIs placed inline in a text stream change the current property set for the text that follows.
2. Control of other format characteristics:
Perform some action immediately the PI is encountered, for example display the value of a showstring with the <?show> PI
Redirect the formatter to another piece of content in the document.
This section describes the application of text properties. As mentioned above, as standard behavior the placement of an inline PI in a text stream will apply properties to the text that immediately follows it. This property will persist until subsequent commands instruct otherwise, or a new paragraph is started. The change commands can take several forms:
An end command for that PI, for example <?tf="Arial-i">This text will be italic.<?tf>This text will be of the style set before the first PI.
A second PI specifying a different value for the same property, for example <?tf="Arial">This text will be in Arial plain text.<?tf="Arial-i">This text will be Arial italic<?tf>This text will be whatever font was set before the first PI.
The presence of an <?up> or <?down> PI. These are used mainly within references and paragraph styles to delimit sets of text properties, for example <?up><?tf="Arial"><?th=18pt>This text will be in Arial plain text and sized 18pt.<?down>This text will be whatever font was set before the <?up> PI.
The start of a new <style> tag, which will implement the PIs it contains, for example <body><?th="Arial-i">This text will be italic.<inline>This text will take the properties contained in the "inline" style tag.
Paragraph styles also contain PIs and it is here that they are used to provide conditional formatting, the mechanics of which will be described in the next section.
When formatting a text stream, the formatter stores all the properties it extracts from that stream in memory, only applying those collected properties when it encounters an output trigger such as a text character or some showstrings. This method of output saves processing time, whilst still ensuring that properties are applied on an ongoing basis throughout the format process. To exercise more control over the output of properties, introduce a null (end style) PI, <?>. This forces PTC ALD to apply all the collected properties the moment it is encountered and can ensure that tags that contain variable information, such as running headers, will always provide the correct data at the point of insertion.
 
Text properties can also be applied to text during manual document manipulation. Click either the Text > Properties menu option or the Text > Properties Index menu option when in Text Mode to make your selection (see Text Mode). The relevant PI will be placed at the correct place in the stream.
When viewing the contents of a style tag that contains PIs, you will often see a line of code similar to this:
This is known as the paragraph lump attribute and is a way of abbreviating the display of a list of commonly used PIs. Quite often it bears little resemblance to the actual PI content so it is much easier to read if you elect to display it as its constituent PIs. Highlight the whole lump, right click and select Change > Lump to PIs. The lump will be expanded as follows:
Although a full list of PIs is out of scope of this document, some of the more commonly paragraph PIs are detailed below:
Paragraph properties
<?th=1.5h>
Set the text height to 1.5 times that set in the paragraph style
<?tf="Arial-i">
Set the text font to Arial italic
<?tlb=18pt>
Set the leading (inter-line spacing) to 18pt
<?tpfmt=13>
Set the format of the paragraph to overhang the frame to the right
Margin properties
<?tpt=16mm>
Set a margin of 16mm on the top of the paragraph that is not first in the column (left, right and bottom margins are applied similarly via the <?tpl>, <?tpr> and <?tpb> commands respectively)
<?tpct=16mm>
Set a margin of 16mm on the top of the paragraph that is first in the column
A full list of ALD’s PIs can be found in the Macro Language Reference. Please refer to the PTC ALD Help Center, accessed via the Help menu option.