Label and Ref Field

The basis of the cross-referencing system is identifying the paragraphs which can be cross-referenced.
Any paragraph can be referenced by inserting a label field which takes the general form:
{
Label
identifier
}
Note that a label identifier cannot contain any non-alpha-numeric characters.
Examples of identifiers are:
TENANT
Tenant
PARTY_TENANT
Party_Tenant
PARTYTENANT
PartyTenant
Note also that identifiers are not case-sensitive, so 'PARTYTENANT' and 'PartyTenant' refer to the same label.

Cross-reference field

Labeled paragraphs are cross-referenced by inserting a
Ref
field.
This takes the general form:
{Ref <label-identifier-1>, <label-identifier-2>, ..., <label-identifier-K> Format <format-text> Prefix <prefix-text> Punctuation <punctuation-text>}
where K
>
1 and where the
Format
,
Prefix
and
Punctuation
components are all optional.
Note that the
Ref
field and the
Label
field need not necessarily occur in the same template, but they must occur in the same generated document. For example, the
Ref
field may occur in the top-most template and the
Label
field may occur in an included sub-template, but it cannot occur in an attached sub-template.

Format

The optional
Format
component of a
Ref
field is a double-quoted text.
The format text determines how each cross-reference is portrayed in the generated document and directly corresponds to the MS Word options for a cross-reference.
Format
MS Word Equivalent
Effect
"Text"
REF
The text of the paragraph
"Number"
REF \r
Paragraph outline number
"NumberAboveBelow"
REF \r \p
Paragraph outline number above/below
"FullContext"
REF \w
Paragraph outline number (full context)
"FullContextAboveBelow"
REF \w \p
Paragraph outline number above/below (full context)
"NoContext"
REF \n
Paragraph outline number (no context)
"NoContextAboveBelow"
REF \n \p
Paragraph outline number above/below (no context)
"Page"
PAGEREF
Page number
"PageAboveBelow"
PAGEREF \p
Page number above/below
"AboveBelow"
REF \p
Above/below

Prefix

The optional
Prefix
component of a
Ref
field is a double-quoted text.
The prefix text determines what text, if any, is inserted into the document immediately before the cross-reference itself.
The prefix text has 3 text parts separated by 2 vertical bar characters, for example "aaa|bbb|ccc".
Which of the 3 text parts is inserted into the generated document is determined by the number of cross-referenced paragraph labels that also occur in the generated document.
For example, if the prefix text is "None|One|Many":
Paragraph Labels Occur
Prefix Text Inserted
0
None
1
One
2 or more
Many

Punctuation

The optional
Punctuation
component of a
Ref
field is a double-quoted text.
The punctuation text determines what text, if any, separates the formatted cross-references.

Punctuation symbols

There are always 3 punctuation symbols referred to as the leading symbol, the penultimate symbol and the ultimate symbol. If there are fewer than 3 punctuation symbols in the double-quoted punctuation text then the missing symbols are inferred.
Punctuation Text
First and Following Symbol
Penultimate Symbol
Last Symbol
";|; and|."
";"
"; and"
"."
",|, and"
","
", and"
""
","
","
","
""
""
""
""
""
In addition, certain escaped characters (not case sensitive) in the punctuation symbol are interpreted as MS Word controls:
Escaped Character
MS Word Control
^T
tab
^L
paragraph (Return) or manual line-break (Shift-Return)
^M
manual page-break
^N
manual column-break
^|
vertical bar character
^^
hat character

Punctuation algorithm

The punctuation algorithm depends upon the number of cross-referenced paragraph labels that also occur in the generated document.
Paragraph Labels Occur
Punctuation
0
No punctuation
1
The ultimate symbol is inserted after the only cross-reference
2
The penultimate symbol is inserted after the first cross-reference and the ultimate symbol is inserted after the second cross-reference
3+
The ultimate symbol is inserted after the last cross-reference, the penultimate symbol is inserted after the last-but-one cross-reference, and the leading symbol is inserted after every other cross-reference

Example 1 - Individual cross-reference

The following individual clauses have unique labels:
1.1.1
{Label PARTY_TENANT}The Tenant
This clause defines the tenant.
1.1.2
[
TenantHasSurity
{Label PARTY_TENANT_SURITY}The Tenant's Surety
This clause defines the tenant's surety.]
1.1.3
{Label PARTY_LANDLORD}The Landlord
This clause defines the landlord.
The following table shows how
Ref
fields will occur in a generated document:
Template
Generated Document
Condition
{Ref PARTY_TENANT Format "Number"}
1.1.1
{Ref PARTY_TENANT}
1.1.1
{Ref PARTY_TENANT_SURITY}
1.1.2
TenantHasSurity = true
{Ref PARTY_TENANT_SURITY}
TenantHasSurity = false
{Ref PARTY_LANDLORD}
1.1.3
TenantHasSurity = true
{Ref PARTY_LANDLORD}
1.1.2
TenantHasSurity = false

Example2 - Multiple cross-references

The following clauses have similar labels:
1.1.1
[
TCA
{Label TERMINATION_A}Termination A
This agreement is terminated by condition A.]
1.1.2
[
TCB
{Label TERMINATION_B}Termination B
This agreement is terminated by condition B.]
1.1.3
[
TCC
{Label TERMINATION_C}Termination C
This agreement is terminated by condition C.]
1.1.4
[
TCD
{Label TERMINATION_D}Termination D
This agreement is terminated by condition D.]
The following table shows how the
Ref
field:
{Ref TERMINATION_A, TERMINATION_B, TERMINATION_C, TERMINATION_D Prefix "There are no termination clauses|The termination clause is |The termination clauses are " Punctuation ", | and |"}
will occur in a generated document:
Generated Document
TCA
TCB
TCC
TCD
There are no termination clauses
false
false
false
false
The termination clause is 1.1.1
true
false
false
false
The termination clause is 1.1.1
false
true
false
false
The termination clauses are 1.1.1 and 1.1.2
true
false
false
true
The termination clauses are 1.1.1, 1.1.2, 1.1.3 and 1.1.4
true
true
true
true