Page tree

You can create named patterns as back references when you create an APA file in a text file or in the Raw APA File view of the APA Editor.

You can name a pattern and use the pattern as a back reference to another parameter, including a:

  • Page set name
  • Page set prefix
  • Position number
  • Layer number

To name a pattern, include a name after the wild card and within the square brackets, for example [#PagePosition] or [%Prefix]. You can use any name you want, but it can be helpful to those reading the APA file if the name identifies or relates to the information contained in the pattern (that is page position, page set name, page set prefix, or layer number) .
For example, "Book.p[#].pdf" could be used in the APA file to refer to the page names Book.p1.pdf, Book.p2.pdf, Book.p3.pdf, and so on. The numbers 1, 2, 3, and so on in the page names may correspond to the page position numbers to which the pages will be assigned in the page set (that is, Book.p1.pdf is assigned to page position number 1, Book.p2.pdf is assigned to page position number 2, and so on). The pattern can be named, for example [#PagePosition], and the named pattern can be used as a back reference to the position number in the ASSIGN statement.
Note: The APA Editor always uses [#PagePosition] to name a pattern used as a back reference to the position number.

To use a named pattern as a back reference, use the pattern in place of the relevant parameter in the ASSIGN statement. Remove any character-count specifiers. For example, if the named pattern is [%Prefix:2], the back reference is [%Prefix].

For example, this ASSIGN statement assigns all pages that match the pattern to the corresponding page position in the page set named Book-8up, that is, Book.p1.pdf to position 1, Book.p2.pdf to position 2, and so on.
ASSIGN= "Book.p[#PgPosition].pdf" "Book-8up" [#PgPosition] 1

For example, this ASSIGN statement assigns all pages that match the pattern to the corresponding page position in the corresponding page set, for example, Inside.p1.pdf to position 1 in the Inside page set, Inside.p2.pdf to position 2 in the Inside page set, Cover.p1.pdf to position 1 in the Cover page set, Cover.p2.pdf to position 2 in the Cover page set, and so on.
ASSIGN= "[$PageSet]-P[#PgPosition].p" "[$PageSet].p[#PgPosition].pdf" "[$PageSet]" [#PgPosition] 1


Adding and subtracting with named patterns and back references

In many cases it is convenient to be able to specify a page number offset in an APA file. Both addition + and subtraction - are supported.
The following are all valid ASSIGN statements:
ASSIGN= "Page.p[#PgPosition].pdf" "*" [#PgPosition] 1
ASSIGN= "Page.p[#PgPosition].pdf" "*" [#PgPosition] - 50 1
ASSIGN= "Page.p[#PgPosition].pdf" "*" [#PgPosition] + 50 + 30 1
ASSIGN= "Page[#Num].p[#PgPosition].pdf" "*" [#Num] + [#PgPosition] + 50 1

The rules are:

  • Pattern-matching must use the # character.
  • Math expressions are valid with or without spaces.

  For example the following two expressions are treated the same:
  [#Num]-24
  [#Num] - 24

  • Math operations are not supported for the GEOM statement.

This example include all page assignments for a book consisting of seven files. The page position is calculated using the page number from the page name ([#PgPosition]) plus the number of pages in each of the preceding files.

ASSIGN= "1_frontcovers.p[#PgPosition].pdf" "*" [#PgPosition] 1
ASSIGN= "2_intro.p[#PgPosition].pdf" "*" [#PgPosition]+10 1
ASSIGN= "3_chpt_1.p[#PgPosition].pdf" "*" [#PgPosition]+10+38 1
ASSIGN= "4_chpt_2.p[#PgPosition].pdf" "*" [#PgPosition]+10+38+516 1
ASSIGN= "5_chpt_3.p[#PgPosition].pdf" "*" [#PgPosition]+10+38+516+8 1
ASSIGN= "6_chpt_4.p[#PgPosition].pdf" "*" [#PgPosition]+10+38+516+8+30 1
ASSIGN= "7_appendix.p[#PgPosition].pdf" "*" [#PgPosition]+10+38+516+8+30+8 1

The 10 pages from the 1_frontcovers file are assigned to page positions one to 10.
The 38 pages from the 2_intro file are assigned to page positions 11 to 49.
The 516 pages from the 3_chpt_1 file are assigned to page positions 50 to 566.
The 8 pages from the 4_chpt_2 file are assigned to page positions 567 to 575.
The 30 pages from the 5_chpt_3 file are assigned to page positions 576 to 606.
The 8 pages from the 6_chpt_4 file are assigned to page positions 607 to 615.
The pages from the 7_appendix file are assigned to page positions 616 on.

This example includes page assignments for a book that includes the starting page number in its page names. The page position is calculated by adding the starting page number [#Start] and the page number from the page name [#PgPosition] and then subtracting 1.
Page names are as follows:
Page_01_27.p1.pdf ... Page_01_27.p27.pdf
Page_28_56.p1.pdf ... Page_28_56.p56.pdf
ASSIGN= [$]_[#Start]_[$].p[#PgPosition].pdf "*" [#Start]+[#PgPosition] -1 1
Page_01_27.p1.pdf assigned to page position 1.
Page_01_27.p2.pdf assigned to page position 2...
...Page_01_27.p27.pdf assigned to page position 27.
Page_28_56.p1.pdf assigned to page position 28 + 1 - 1 = 28.
Page_28_56.p1.pdf assigned to page position 28 + 2 - 1 = 29.
Page_28_56.p1.pdf assigned to page position 28 + 3 - 1 = 30...
...Page_28_56.p56.pdf assigned to page position 28 + 56 -1 = 83.

  • No labels