Macro Language Reference > PIs > Text > <?smaprety>
  
<?smaprety>
Description
The <?smaprety> command is implemented to accompany the <?smapret> command. The <?smapret> command instructs PTC ALD to map all the hard returns in a document to a space. The <?smaprety> command is used to map these spaces. Used without any parameters the <?smaprety> command removes the spaces. If the same command is used again without any parameters, spaces will be reinserted.
Syntax
<?smaprety on_off:n? level:n?>
<?smaprety>
[no parameter]
Remove or reinsert spaces depending on whether a previous <?smaprety> command is present.
on_off
0
Off
1
On
2
Use default setting for the stream.
level
0
Root level - text stream
1
Current level
2
Sub level
Additional Information
As an example, the document to be formatted contains a text stream called strm0 as the stream being formatted. This stream calls the tag body which in turn calls textstyle. This gives the following hierarchy:
textstyle (level 2)
body (level 1)
strm0 (root - level 0)
If the PI <?smaprety 1,1> is placed in strm0, so there is no level 1 tag, then it will apply to the current tag, i.e. strm0. This means that setting a level to a high number (e.g. 99) will ensure that the PI will always apply to the current tag regardless of its position in the hierarchy.
If level is set greater than 0, then the space flag will apply to that level, i.e. if textstyle contains <?smaprety 1,1> then only spaces inside body will be mapped. Spaces inside strm0 and textstyle will still be processed as normal. In other words, the tag to apply the PI to is counted upwards from the main root tag.
If level is less than 0, then the space flag will apply to the tag at the level counting downwards from the current tag, so if you put <?smaprety 1,-1> in textstyle then the PI will act on its parent (body), <?smaprety 1,-2> will act on its grandparent (strm0), etc.
Related Links