Page Macro

 When [Option] is selected in the print dialog, the macros to control the pages to for Printing are defined by the files par\*.pgm under the directory of dviout. Each file corresponds to each macro. Its contents are as follows.

The line starting with # is a comment line. In the comment lines following from the top line, the first line which is not started by #j# (resp. #e#) is shown in the list box under Non-Japanese (resp. Japanese) Windows system.

The blocks are separated by blanks or lines and the block started by "M" is a macro block, which is of the form

  Minitialize;difference;pages

and the pages in the selected range are output according to this macro.  The macro block M of the length 1 without any parameter means to clear the defined macro.

- The 4 integer variables v, w, x, y, z may be used.

pages are a sequence of "equation"s or "Z+", "Z-", "Z", "." separated by "," and the page whose number equals the value of the "equation" is output if z > 0.

- After the above output, the values of valiables are changed according to difference and then the value of z is subtracted by 1. If z > 0 still holds, then pages are output again according to pages. This procedure will be repeated.

- "equation" may be a variable or a number or their connection by "+" or "-" such as x+5, x+v-3.

- If the value of the "equation" in pages is not in the indicated range, the blank page is output in default.

- If some of "equation"s in pages are put in [ ] and all the pages indicated by the "equation" are out of the indicated range, then the corresponding output of blank pages are ignored. The nesting of [ ] is not allowed.

initialize and difference are the sequence of "substitution"s. "substition" is one of the forms "variable+=equation", "variable-=equation", "variable*=equation", "variable/=equation", "variable&=equation".

- In the beginning the variables are initialized as v = w = 0 and x by the first page of the range, y by the last page of the range and z by the number of the total pages of the region and then the substitution by initialize is performed.

It is something like in the C language

   v = w = 0; x = start_page; y = end_page; z = y - x + 1;
   for(initialize; z > 0; difference, z--)
      { Output(pages);}

For example

 Mv+=y,v&=1,y-=v,z-=v;y-=2,z-=1;y

means to output even pages in the reverced order.  Printing four pages in one sheet with two pages in one side of sheet is done by

 Mz+=3,z/=4;x+=4;x+3,Z+,x,Z,[x+1,Z+,x+2,Z]

with pauses after each print.  If a printer which prints both sides of a sheet is used, then 

 Mz+=4,z/=4,x-=1;x+=4;x+3,x,[x+1,x+2]

means a similar printing with the blank first page.