Some note on setting page size, orientation, and margins:

In the absence of any dot commands in a file, WordStar get its 
page-sizing defaults from WSCHANGE menu D,A,A, the "Page Sizing 
and Margins" menu.

WordStar uses the "paper bin" dot command, .bn#, where # is an 
integer, to specify the paper source for the printer.  The actual 
printer-control selection screens are set (and modifiable) in the 
WordStar .pdf file.

From the PDFEDIT main menu, select "Additional modification," 
then "Sheet Feeder Tray Definitions."  

The order in which the sheet-feeder trays are listed is the order 
of their .bn numbers.  The first tray defined is selected with 
.bn1, the second with .bn2, and so on.  

  Cassette Ltr    .bn1
  Manual Ltr      .bn2
  Cassette Lgl    .bn3
  Manual Lgl      .bn4
  Cassette A4     .bn5
  Manual A4       .bn6
  Cassette Exec   .bn7
  Manual Exec     .bn8
  Manual Com-10   .bn9
  Manual Monarch  .bn10
  Manual DL       .bn11
  Manual C5       .bn12
  
You can get a simple point-and-shoot menu of all your paper bins 
on WordStar's "Page Layout" menu, ^OY -- choosing a bin by its 
name simply inserts the appropriate .bn command.

(The huge problem with this is that if "Manual A4" happens to be 
.bn6, as it is here, in one PDF but .bn5 in another, changing 
PDFs screws things up.)

Within the WordStar editor, on that same ^OY menu you can also 
select either portrait or landscape mode, which inserts 
WordStar's miscellaneous printer .pr command with the appropriate 
argument, either "or=p" for orientation is portrait or "or=l" for 
orientation is landscape:

  .pr or=p
  .pr or=l

But .bn only selects the source of the paper.  WS.EXE is still 
blissfully ignorant of the actual page dimensions.  So, you have 
to set page length within the file (if different from the 
default, which is 11" -- I'll tell you below how to change the 
default) with the page-length .pl command.  A4 paper measures 
8.27x11.69" or 211x297 mm, so you'd set:

  .pl 11.69"

You can also use the letter i (upper or lowercase) instead of the 
double quote to indicates inches; WordStar also recognizes c for 
centimeters, p for points, and r for "ruler units" which are 
1/10th of an inch (a column's width in Courier 10-pitch / 12-
point) when used for a horizontal measures or 1/6th of an inch 
(default six-lines-per-inch line height) when used for a vertical 
measures.

Any of these will do the trick for A4 paper:

  .pl 11.69"
  .pl 11.69i
  .pl 11.69I
  .pl 29.7c
  .pl 116.9r
  .pl 841.68p

(My own preference is to always use lowercase i for the in inches 
indicator; that way, I know when searching for the double 
quotation mark, I'm always finding dialog and not a dot command.)

On that same ^OY "Page Layout" screen, you can adjust all paper 
margins.  However, WordStar's printer technology predates laser 
printers, which have a dead zone at all four margins (areas where 
the printer simply can't print).  WordStar is blissfully ignorant 
of these, so if you want the first character on a laser printed 
sheet to be one inch from the edge, you have to mentally subtract 
the .3" deadzone on the left side, and use this "page offset" .po 
command: .po .7"

You'll also want to set an appropriate right margin; the "Ruler 
Line" menu is accessed with either ^OR or ^OL.

For A4, which is 8.27" wide, rather than the 8.50" of letter-
sized paper, if I wanted one-inch left and right blank space, I'd 
use:

  .rm 6.27"

Actually, WordStar solves all dot commands as equations, so you 
can type the actual page width minus the blank space you want on 
the left minus the blank space you want on the right:

  .rm 8.27-1-1i 

which resolves to 6.27i.

Side note: WordStar assumes all logical statements in dot 
commands are true while editing; it doesn't evaluate logic until 
print time.  So you can use that to have one set of conditions 
while editing and another at print time.  The .if "IF" and .ei 
"END IF" dot commands let you do cool stuff like have a ragged-
right margin while editing but fully justified text when printed 
(.oj is the "output justification" dot command):


 .oj on   <-- condition you want at print time
 .if 1=0  
 .oj off  <-- condition you want onscreen while editing
 .ei


The one place where WordStar can automatically take into account 
the printing deadzone is Advanced Page Preview.  In your Advanced 
Page Preview folder there is a file called FONTID.CTL where you 
can set a TOP_OFFSET and a LEFT_OFFSET value.  For laser 
printers, I leave me TOP_OFFSET blank:

   TOP_OFFSET=

and set 0.3" as 216/720th of an inch thus:

   LEFT_OFFSET=216

LaserJet III and below had smaller offests. Use a LEFT_OFFSET 
value of 144 for LaserJet II or a value of 180 for LaserJet III 
and IIP.

MARGINS

WordStar measures pages from an origin point in the upper left. 
It only needs four figures:

How much white space at top (.mt, margin top)
How much white space at left (.po, page offset)
How far to go across the page before wordwrap (.rm, right margin)
How far from the bottom to stop (.mb, margin bottom)

It's irrelevant to WordStar how wide the page is -- whether 
there's an inch or a yard to the right of the right margin, and 
so it's never had any way to specify that.  Note, though, that 
.po can take an e/o argument (.poe for page offset on even-
numbered pages, .poo for page offset on odd-numbered pages).

I often set .pl0 (zero), actually, because that supresses page 
breaks (giving a continuous-viewing mode), and because line 
number then roughly equal wordcount/10 (line 125 is about 1,250 
words in Courier 10-pitch 12-point).

You can change from portrait to landscape within a document, I 
believe, so long as the appropriate command appears at the top of 
the page:

 .pr or=l (printer orientation = landscape)
 .pr or=p (printer orientation = portrait)

So, .po is the "page offset" from the left edge of the paper; 
Word calls that the left margin. 

And .lm is WordStar's "left margin," which is the column WordStar 
will actually print its first character in. Normally it's not set 
(and defaults to 0).

And .rm is the "right margin," which is the column WordStar will 
do word-wrap at.

So, for a normal piece of 8.5"-wide paper in which you want one-
inch margins on all sides, the WordStar commands specify that 
explicitly:

 .po 1"
 .lm 0" (the default)
 .rm 6.5"

(which leaves 1" at the right).

WordStar has you specifically specify a typing line length (with 
.lm and .rm, so that .lm0 and .rm 6.5" give a 6.5" line).

Word, instead, derives a typing line length as whatever is left 
over after you subtract what it calls the left margin and right 
margin from the page width:

8.5" page - 1" left margin - 1" right margin = 6.5" typing width

The difference is that WordStar leaves as derived the value of 
the white-space margin at the right side of the page (the least-
important measurement), whereas Word leaves as derived the value 
of the actual typing-line length (the most-important 
measurement).  WordStar for the win!

-- Robert J. Sawyer
   sawyer@sfwriter.com
   August 2024
