91d585cbc06784869910e96a8ea6e5bf7a097974
[pspp-builds.git] / doc / configuring.texi
1 @node Configuration, Portable File Format, Installation, Top
2 @appendix Configuring PSPP
3 @cindex configuration
4 @cindex PSPP, configuring
5
6 PSPP has dozens of configuration possibilities and hundreds of
7 settings.  This is both a bane and a blessing.  On one hand, it's
8 possible to easily accommodate diverse ranges of setups.  But, on the
9 other, the multitude of possibilities can overwhelm the casual user.
10 Fortunately, the configuration mechanisms are profusely described in the
11 sections below@enddots{}
12
13 @menu
14 * File locations::              How PSPP finds config files.
15 * Configuration techniques::    Many different methods of configuration@enddots{}
16 * Configuration files::         How configuration files are read.
17 * Environment variables::       All about environment variables.
18 * Output devices::              Describing your terminal(s) and printer(s).
19 * PostScript driver class::     Configuration of PostScript devices.
20 * ASCII driver class::          Configuration of character-code devices.
21 * HTML driver class::           Configuration for HTML output.
22 * Miscellaneous configuring::   Even more configuration variables.
23 * Improving output quality::    Hints for producing ever-more-lovely output.
24 @end menu
25
26 @node File locations, Configuration techniques, Configuration, Configuration
27 @section Locating configuration files
28
29 PSPP uses the same method to find most of its configuration files:
30
31 @enumerate
32 @item
33 The @dfn{base name} of the file being sought is determined.
34
35 @item
36 The path to search is determined.  
37
38 @item
39 Each directory in the search path, from left to right, is searched for a
40 file with the name of the base name.  The first occurrence is read
41 as the configuration file.
42 @end enumerate
43
44 The first two steps are elaborated below for the sake of our pedantic
45 friends.
46
47 @enumerate
48 @item
49 A @dfn{base name} is a file name lacking an absolute directory
50 reference.  Some examples of base names are: @file{ps-encodings},
51 @file{devices}, @file{devps/DESC} (under UNIX), @file{devps\DESC} (under
52 M$ environments).
53
54 Determining the base name is a two-step process:
55
56 @enumerate a
57 @item
58 If the appropriate environment variable is defined, the value of that
59 variable is used (@pxref{Environment variables}).  For instance, when
60 searching for the output driver initialization file, the variable
61 examined is @code{STAT_OUTPUT_INIT_FILE}.
62
63 @item
64 Otherwise, the compiled-in default is used.  For example, when searching
65 for the output driver initialization file, the default base name is
66 @file{devices}.
67 @end enumerate
68
69 @strong{Please note:} If a user-specified base name does contain an
70 absolute directory reference, as in a file name like
71 @file{/home/pfaff/fonts/TR}, no path is searched---the file name is used
72 exactly as given---and the algorithm terminates.
73
74 @item
75 The path is the first of the following that is defined:
76
77 @itemize @bullet
78 @item
79 A variable definition for the path given in the user environment.  This
80 is a PSPP-specific environment variable name; for instance,
81 @code{STAT_OUTPUT_INIT_PATH}.
82
83 @item 
84 In some cases, another, less-specific environment variable is checked.
85 For instance, when searching for font files, the PostScript driver first
86 checks for a variable with name @code{STAT_GROFF_FONT_PATH}, then for
87 one with name @code{GROFF_FONT_PATH}.  (However, font searching has its
88 own list of esoteric search rules.)
89
90 @item
91 The configuration file path, which is itself determined by the
92 following rules:
93
94 @enumerate a
95 @item
96 If the command line contains an option of the form @samp{-B @var{path}}
97 or @samp{--config-dir=@var{path}}, then the value given on the
98 rightmost occurrence of such an option is used.
99
100 @item
101 Otherwise, if the environment variable @code{STAT_CONFIG_PATH} is
102 defined, the value of that variable is used.
103
104 @item
105 Otherwise, the compiled-in fallback default is used.  On UNIX machines,
106 the default fallback path is
107
108 @enumerate 1
109 @item
110 @file{~/.pspp}
111
112 @item
113 @file{/usr/local/lib/pspp}
114
115 @item
116 @file{/usr/lib/pspp}
117 @end enumerate
118
119 On DOS machines, the default fallback path is:
120
121 @enumerate 1
122 @item
123 All the paths from the DOS search path in the @samp{PATH} environment
124 variable, in left-to-right order.
125
126 @item
127 @file{C:\PSPP}, as a last resort.
128 @end enumerate
129
130 Note that the installer of PSPP can easily change this default
131 fallback path; thus the above should not be taken as gospel.
132 @end enumerate
133 @end itemize
134 @end enumerate
135
136 As a final note: Under DOS, directories given in paths are delimited by
137 semicolons (@samp{;}); under UNIX, directories are delimited by colons
138 (@samp{:}).  This corresponds with the standard path delimiter under
139 these OSes.
140
141 @node Configuration techniques, Configuration files, File locations, Configuration
142 @section Configuration techniques
143
144 There are many ways that PSPP can be configured.  These are
145 described in the list below.  Values given by earlier items take
146 precedence over those given by later items.
147
148 @enumerate
149 @item
150 Syntax commands that modify settings, such as @cmd{SET}.  @xref{SET}.
151
152 @item
153 Command-line options.  @xref{Invocation}.
154
155 @item
156 PSPP-specific environment variable contents.  @xref{Environment
157 variables}.
158
159 @item
160 General environment variable contents.  @xref{Environment variables}.
161
162 @item
163 Configuration file contents.  @xref{Configuration files}.
164
165 @item
166 Fallback defaults.
167 @end enumerate
168
169 Some of the above may not apply to a particular setting.  For instance,
170 the current pager (such as @samp{more}, @samp{most}, or @samp{less})
171 cannot be determined by configuration file contents because there is no
172 appropriate configuration file.
173
174 @node Configuration files, Environment variables, Configuration techniques, Configuration
175 @section Configuration files
176
177 Most configuration files have a common form:
178
179 @itemize @bullet
180 @item
181 Each line forms a separate command or directive.  This means that lines
182 cannot be broken up, unless they are spliced together with a trailing
183 backslash, as described below.
184
185 @item
186 Before anything else is done, trailing whitespace is removed.
187
188 @item
189 When a line ends in a backslash (@samp{\}), the backslash is removed,
190 and the next line is read and appended to the current line.
191
192 @itemize @minus
193 @item
194 Whitespace preceding the backslash is retained.
195
196 @item
197 This rule continues to be applied until the line read does not end in a
198 backslash.
199
200 @item
201 It is an error if the last line in the file ends in a backslash.
202 @end itemize
203
204 @item
205 Comments are introduced by an octothorpe (@samp{#}), and continue until the
206 end of the line.
207
208 @itemize @minus
209 @item
210 An octothorpe inside balanced pairs of double quotation marks (@samp{"})
211 or single quotation marks (@samp{'}) does not introduce a comment.
212
213 @item
214 The backslash character can be used inside balanced quotes of either
215 type to escape the following character as a literal character.  
216
217 (This is distinct from the use of a backslash as a line-splicing
218 character.)
219
220 @item
221 Line splicing takes place before comment removal.
222 @end itemize
223
224 @item
225 Blank lines, and lines that contain only whitespace, are ignored.
226 @end itemize
227
228 @node Environment variables, Output devices, Configuration files, Configuration
229 @section Environment variables
230
231 You may think the concept of environment variables is a fairly simple
232 one.  However, the author of PSPP has found a way to complicate
233 even something so simple.  Environment variables are further described
234 in the sections below:
235
236 @menu
237 * Variable values::             Values of variables are determined this way.
238 * Environment substitutions::   How environment substitutions are made.
239 * Predefined variables::        A few variables are automatically defined.
240 @end menu
241
242 @node Variable values, Environment substitutions, Environment variables, Environment variables
243 @subsection Values of environment variables
244
245 Values for environment variables are obtained by the following means,
246 which are arranged in order of decreasing precedence:
247
248 @enumerate
249 @item
250 Command-line options.  @xref{Invocation}.
251
252 @item
253 The @file{environment} configuration file---more on this below.
254
255 @item
256 Actual environment variables (defined in the shell or other parent
257 process).
258 @end enumerate
259
260 The @file{environment} configuration file is located through application
261 of the usual algorithm for configuration files (@pxref{File locations}),
262 except that its contents do not affect the search path used to find
263 @file{environment} itself.  Use of @file{environment} is discouraged on
264 systems that allow an arbitrarily large environment; it is supported for
265 use on systems like MS-DOS that limit environment size.
266
267 @file{environment} is composed of lines having the form
268 @samp{@var{key}=@var{value}}, where @var{key} and the equals sign
269 (@samp{=}) are required, and @var{value} is optional.  If @var{value} is
270 given, variable @var{key} is given that value; if @var{value} is absent,
271 variable @var{key} is undefined (deleted).  Variables may not be defined
272 with a null value.
273
274 Environment substitutions are performed on each line in the file
275 (@pxref{Environment substitutions}).
276
277 See @ref{Configuration files}, for more details on formatting of the
278 environment configuration file.
279
280 @quotation
281 @strong{Please note:} Support for @file{environment} is not yet
282 implemented.
283 @end quotation
284
285 @node Environment substitutions, Predefined variables, Variable values, Environment variables
286 @subsection Environment substitutions
287
288 Much of the power of environment variables lies in the way that they may
289 be substituted into configuration files.  Variable substitutions are
290 described below.
291
292 The line is scanned from left to right.  In this scan, all characters
293 other than dollar signs (@samp{$}) are retained unmolested.  Dollar
294 signs, however, introduce an environment variable reference.  References
295 take three forms:
296
297 @table @code
298 @item $@var{var}
299 Replaced by the value of environment variable @var{var}, determined as
300 specified in @ref{Variable values}.  @var{var} must be one of the
301 following:
302
303 @itemize @bullet
304 @item
305 One or more letters.
306
307 @item
308 Exactly one nonalphabetic character.  This may not be a left brace
309 (@samp{@{}).
310 @end itemize
311
312 @item $@{@var{var}@}
313 Same as above, but @var{var} may contain any character (except
314 @samp{@}}).
315
316 @item $$
317 Replaced by a single dollar sign.
318 @end table
319
320 Undefined variables expand to a empty value.
321
322 @node Predefined variables,  , Environment substitutions, Environment variables
323 @subsection Predefined environment variables
324
325 There are two environment variables predefined for use in environment
326 substitutions:
327
328 @table @samp
329 @item VER
330 Defined as the version number of PSPP, as a string, in a format
331 something like @samp{0.9.4}.
332
333 @item ARCH
334 Defined as the host architecture of PSPP, as a string, in standard
335 cpu-manufacturer-OS format.  For instance, Debian GNU/Linux 1.1 on an
336 Intel machine defines this as @samp{i586-unknown-linux}.  This is
337 somewhat dependent on the system used to compile PSPP.
338 @end table
339
340 Nothing prevents these values from being overridden, although it's a
341 good idea not to do so.
342
343 @node Output devices, PostScript driver class, Environment variables, Configuration
344 @section Output devices
345
346 Configuring output devices is the most complicated aspect of configuring
347 PSPP.  The output device configuration file is named
348 @file{devices}.  It is searched for using the usual algorithm for
349 finding configuration files (@pxref{File locations}).  Each line in the
350 file is read in the usual manner for configuration files
351 (@pxref{Configuration files}).
352
353 Lines in @file{devices} are divided into three categories, described
354 briefly in the table below:
355
356 @table @i
357 @item driver category definitions
358 Define a driver in terms of other drivers.
359
360 @item macro definitions
361 Define environment variables local to the the output driver
362 configuration file.
363
364 @item device definitions
365 Describe the configuration of an output device.
366 @end table
367
368 The following sections further elaborate the contents of the
369 @file{devices} file.
370
371 @menu
372 * Driver categories::           How to organize the driver namespace.
373 * Macro definitions::           Environment variables local to @file{devices}.
374 * Device definitions::          Output device descriptions.
375 * Dimensions::                  Lengths, widths, sizes, @enddots{}
376 * papersize::                   Letter, legal, A4, envelope, @enddots{}
377 * Distinguishing line types::   Details on @file{devices} parsing.
378 * Tokenizing lines::            Dividing @file{devices} lines into tokens.
379 @end menu
380
381 @node Driver categories, Macro definitions, Output devices, Output devices
382 @subsection Driver categories
383
384 Drivers can be divided into categories.  Drivers are specified by their
385 names, or by the names of the categories that they are contained in.
386 Only certain drivers are enabled each time PSPP is run; by
387 default, these are the drivers in the category `default'.  To enable a
388 different set of drivers, use the @samp{-o @var{device}} command-line
389 option (@pxref{Invocation}).
390
391 Categories are specified with a line of the form
392 @samp{@var{category}=@var{driver1} @var{driver2} @var{driver3} @var{@dots{}}
393 @var{driver@var{n}}}.  This line specifies that the category
394 @var{category} is composed of drivers named @var{driver1},
395 @var{driver2}, and so on.  There may be any number of drivers in the
396 category, from zero on up.
397
398 Categories may also be specified on the command line
399 (@pxref{Invocation}).
400
401 This is all you need to know about categories.  If you're still curious,
402 read on.
403
404 First of all, the term `categories' is a bit of a misnomer.  In fact,
405 the internal representation is nothing like the hierarchy that the term
406 seems to imply: a linear list is used to keep track of the enabled
407 drivers.
408
409 When PSPP first begins reading @file{devices}, this list contains
410 the name of any drivers or categories specified on the command line, or
411 the single item `default' if none were specified.
412
413 Each time a category definition is specified, the list is searched for
414 an item with the value of @var{category}.  If a matching item is found,
415 it is deleted.  If there was a match, the list of drivers (@var{driver1}
416 through @var{driver@var{n}}) is then appended to the list.
417
418 Each time a driver definition line is encountered, the list is searched.
419 If the list contains an item with that driver's name, the driver is
420 enabled and the item is deleted from the list.  Otherwise, the driver
421 is not enabled.
422
423 It is an error if the list is not empty when the end of @file{devices}
424 is reached.
425
426 @node Macro definitions, Device definitions, Driver categories, Output devices
427 @subsection Macro definitions
428
429 Macro definitions take the form @samp{define @var{macroname}
430 @var{definition}}.  In such a macro definition, the environment variable
431 @var{macroname} is defined to expand to the value @var{definition}.
432 Before the definition is made, however, any macros used in
433 @var{definition} are expanded.
434
435 Please note the following nuances of macro usage:
436
437 @itemize @bullet
438 @item
439 For the purposes of this section, @dfn{macro} and @dfn{environment
440 variable} are synonyms.
441
442 @item
443 Macros may not take arguments.
444
445 @item
446 Macros may not recurse.
447
448 @item
449 Macros are just environment variable definitions like other environment
450 variable definitions, with the exception that they are limited in scope
451 to the @file{devices} configuration file.
452
453 @item
454 Macros override other all environment variables of the same name (within
455 the scope of @file{devices}).
456
457 @item
458 Earlier macro definitions for a particular @var{key} override later
459 ones.  In particular, macro definitions on the command line override
460 those in the device definition file.  @xref{Non-option Arguments}.
461
462 @item
463 There are two predefined macros, whose values are determined at runtime:
464
465 @table @samp
466 @item viewwidth
467 Defined as the width of the console screen, in columns of text.
468
469 @item viewlength
470 Defined as the length of the console screen, in lines of text.
471 @end table
472 @end itemize
473
474 @node Device definitions, Dimensions, Macro definitions, Output devices
475 @subsection Driver definitions
476
477 Driver definitions are the ultimate purpose of the @file{devices}
478 configuration file.  These are where the real action is.  Driver
479 definitions tell PSPP where it should send its output.
480
481 Each driver definition line is divided into four fields.  These fields
482 are delimited by colons (@samp{:}).  Each line is subjected to
483 environment variable interpolation before it is processed further
484 (@pxref{Environment substitutions}).  From left to right, the four
485 fields are, in brief:
486
487 @table @i
488 @item driver name
489 A unique identifier, used to determine whether to enable the driver.
490
491 @item class name
492 One of the predefined driver classes supported by PSPP.  The
493 currently supported driver classes include `postscript' and `ascii'.
494
495 @item device type(s)
496 Zero or more of the following keywords, delimited by spaces:
497
498 @table @code
499 @item screen
500
501 Indicates that the device is a screen display.  This may reduce the
502 amount of buffering done by the driver, to make interactive use more
503 convenient.
504
505 @item printer
506
507 Indicates that the device is a printer.
508
509 @item listing
510
511 Indicates that the device is a listing file.
512 @end table
513
514 These options are just hints to PSPP and do not cause the output to be
515 directed to the screen, or to the printer, or to a listing file---those
516 must be set elsewhere in the options.  They are used primarily to decide
517 which devices should be enabled at any given time.  @xref{SET}, for more
518 information.
519
520 @item options
521 An optional set of options to pass to the driver itself.  The exact
522 format for the options varies among drivers.
523 @end table
524
525 The driver is enabled if:
526
527 @enumerate
528 @item
529 Its driver name is specified on the command line, or
530
531 @item
532 It's in a category specified on the command line, or
533
534 @item
535 If no categories or driver names are specified on the command line, it
536 is in category @code{default}.
537 @end enumerate
538
539 For more information on driver names, see @ref{Driver categories}.
540
541 The class name must be one of those supported by PSPP.  The
542 classes supported depend on the options with which PSPP was
543 compiled.  See later sections in this chapter for descriptions of the
544 available driver classes.
545
546 Options are dependent on the driver.  See the driver descriptions for
547 details.
548
549 @node Dimensions, papersize, Device definitions, Output devices
550 @subsection Dimensions
551
552 Quite often in configuration it is necessary to specify a length or a
553 size.  PSPP uses a common syntax for all such, calling them
554 collectively by the name @dfn{dimensions}.
555
556 @itemize @bullet
557 @item
558 You can specify dimensions in decimal form (@samp{12.5}) or as
559 fractions, either as mixed numbers (@samp{12-1/2}) or raw fractions
560 (@samp{25/2}).
561
562 @item 
563 A number of different units are available.  These are suffixed to the
564 numeric part of the dimension.  There must be no spaces between the
565 number and the unit.  The available units are identical to those offered
566 by the popular typesetting system @TeX{}:
567
568 @table @code
569 @item in
570 inch (1 @code{in} = 2.54 @code{cm})
571
572 @item "
573 inch (1 @code{in} = 2.54 @code{cm})
574
575 @item pt
576 printer's point (1 @code{in} = 72.27 @code{pt})
577
578 @item pc
579 pica (12 @code{pt} = 1 @code{pc})
580
581 @item bp
582 PostScript point (1 @code{in} = 72 @code{bp})
583
584 @item cm
585 centimeter
586
587 @item mm
588 millimeter (10 @code{mm} = 1 @code{cm})
589
590 @item dd
591 didot point (1157 @code{dd} = 1238 @code{pt})
592
593 @item cc
594 cicero (1 @code{cc} = 12 @code{dd})
595
596 @item sp
597 scaled point (65536 @code{sp} = 1 @code{pt})
598 @end table
599
600 @item
601 If no explicit unit is given, PSPP attempts to guess the best unit:
602
603 @itemize @minus
604 @item
605 Numbers less than 50 are assumed to be in inches.
606
607 @item
608 Numbers 50 or greater are assumed to be in millimeters.
609 @end itemize
610 @end itemize
611
612 @node papersize, Distinguishing line types, Dimensions, Output devices
613 @subsection Paper sizes
614
615 Output drivers usually deal with some sort of hardcopy media.  This
616 media is called @dfn{paper} by the drivers, though in reality it could
617 be a transparency or film or thinly veiled sarcasm.  To make it easier
618 for you to deal with paper, PSPP allows you to have (of course!) a
619 configuration file that gives symbolic names, like ``letter'' or
620 ``legal'' or ``a4'', to paper sizes, rather than forcing you to use
621 cryptic numbers like ``8-1/2 x 11'' or ``210 by 297''.  Surprisingly
622 enough, this configuration file is named @file{papersize}.
623 @xref{Configuration files}.
624
625 When PSPP tries to connect a symbolic paper name to a paper size, it
626 reads and parses each non-comment line in the file, in order.  The first
627 field on each line must be a symbolic paper name in double quotes.
628 Paper names may not contain double quotes.  Paper names are not
629 case-sensitive: @samp{legal} and @samp{Legal} are equivalent.
630
631 If a match is found for the paper name, the rest of the line is parsed.
632 If it is found to be a pair of dimensions (@pxref{Dimensions}) separated
633 by either @samp{x} or @samp{by}, then those are taken to be the paper
634 size, in order of width followed by length.  There @emph{must} be at
635 least one space on each side of @samp{x} or @samp{by}.
636
637 Otherwise the line must be of the form
638 @samp{"@var{paper-1}"="@var{paper-2}"}.  In this case the target of the
639 search becomes paper name @var{paper-2} and the search through the file
640 continues.
641
642 @node Distinguishing line types, Tokenizing lines, papersize, Output devices
643 @subsection How lines are divided into types
644
645 The lines in @file{devices} are distinguished in the following manner:
646
647 @enumerate
648 @item
649 Leading whitespace is removed.
650
651 @item
652 If the resulting line begins with the exact string @code{define},
653 followed by one or more whitespace characters, the line is processed as
654 a macro definition.
655
656 @item
657 Otherwise, the line is scanned for the first instance of a colon
658 (@samp{:}) or an equals sign (@samp{=}).
659
660 @item
661 If a colon is encountered first, the line is processed as a driver
662 definition.
663
664 @item
665 Otherwise, if an equals sign is encountered, the line is processed as a
666 macro definition.
667
668 @item
669 Otherwise, the line is ill-formed.
670 @end enumerate
671
672 @node Tokenizing lines,  , Distinguishing line types, Output devices
673 @subsection How lines are divided into tokens
674
675 Each driver definition line is run through a simple tokenizer.  This
676 tokenizer recognizes two basic types of tokens.
677
678 The first type is an equals sign (@samp{=}).  Equals signs are both
679 delimiters between tokens and tokens in themselves.
680
681 The second type is an identifier or string token.  Identifiers and
682 strings are equivalent after tokenization, though they are written
683 differently.  An identifier is any string of characters other than
684 whitespace or equals sign.
685
686 A string is introduced by a single- or double-quote character (@samp{'}
687 or @samp{"}) and, in general, continues until the next occurrence of
688 that same character.  The following standard C escapes can also be
689 embedded within strings:
690
691 @table @code
692 @item \'
693 A single-quote (@samp{'}).
694
695 @item \"
696 A double-quote (@samp{"}).
697
698 @item \?
699 A question mark (@samp{?}).  Included for hysterical raisins.
700
701 @item \\
702 A backslash (@samp{\}).
703
704 @item \a
705 Audio bell (ASCII 7).
706
707 @item \b
708 Backspace (ASCII 8).
709
710 @item \f
711 Formfeed (ASCII 12).
712
713 @item \n
714 New-line (ASCII 10)
715
716 @item \r
717 Carriage return (ASCII 13).
718
719 @item \t
720 Tab (ASCII 9).
721
722 @item \v
723 Vertical tab (ASCII 11).
724
725 @item \@var{o}@var{o}@var{o}
726 Each @samp{o} must be an octal digit.  The character is the one having
727 the octal value specified.  Any number of octal digits is read and
728 interpreted; only the lower 8 bits are used.
729
730 @item \x@var{h}@var{h}
731 Each @samp{h} must be a hex digit.  The character is the one having the
732 hexadecimal value specified.  Any number of hex digits is read and
733 interpreted; only the lower 8 bits are used.
734 @end table
735
736 Tokens, outside of quoted strings, are delimited by whitespace or equals
737 signs.
738
739 @node PostScript driver class, ASCII driver class, Output devices, Configuration
740 @section The PostScript driver class
741
742 The @code{postscript} driver class is used to produce output that is
743 acceptable to PostScript printers and to PC-based PostScript
744 interpreters such as Ghostscript.  Continuing a long tradition,
745 PSPP's PostScript driver is configurable to the point of
746 absurdity.
747
748 There are actually two PostScript drivers.  The first one,
749 @samp{postscript}, produces ordinary DSC-compliant PostScript output.
750 The second one @samp{epsf}, produces an Encapsulated PostScript file.
751 The two drivers are otherwise identical in configuration and in
752 operation.
753
754 The PostScript driver is described in further detail below.
755
756 @menu
757 * PS output options::           Output file options.
758 * PS page options::             Paper, margins, scaling & rotation, more!
759 * PS file options::             Configuration files.
760 * PS font options::             Default fonts, font options.
761 * PS line options::             Line widths, options.
762 * Prologue::                    Details on the PostScript prologue.
763 * Encodings::                   Details on PostScript font encodings.
764 @end menu
765
766 @node PS output options, PS page options, PostScript driver class, PostScript driver class
767 @subsection PostScript output options
768
769 These options deal with the form of the output and the output file
770 itself:
771
772 @table @code
773 @item output-file=@var{filename}
774
775 File to which output should be sent.  This can be an ordinary filename
776 (i.e., @code{"pspp.ps"}), a pipe filename (i.e., @code{"|lpr"}), or
777 stdout (@code{"-"}).  Default: @code{"pspp.ps"}.
778
779 @item color=@var{boolean}
780
781 Most of the time black-and-white PostScript devices are smart enough to
782 map colors to shades themselves.  However, you can cause the PSPP
783 output driver to do an ugly simulation of this in its own driver by
784 turning @code{color} off.  Default: @code{on}.
785
786 This is a boolean setting, as are many settings in the PostScript
787 driver.  Valid positive boolean values are @samp{on}, @samp{true},
788 @samp{yes}, and nonzero integers.  Negative boolean values are
789 @samp{off}, @samp{false}, @samp{no}, and zero.
790
791 @item data=@var{data-type}
792
793 One of @code{clean7bit}, @code{clean8bit}, or @code{binary}.  This
794 controls what characters will be written to the output file.  PostScript
795 produced with @code{clean7bit} can be transmitted over 7-bit
796 transmission channels that use ASCII control characters for line
797 control.  @code{clean8bit} is similar but allows characters above 127 to
798 be written to the output file.  @code{binary} allows any character in
799 the output file.  Default: @code{clean7bit}.
800
801 @item line-ends=@var{line-end-type}
802
803 One of @code{cr}, @code{lf}, or @code{crlf}.  This controls what is used
804 for new-line in the output file.  Default: @code{cr}.
805
806 @item optimize-line-size=@var{level}
807
808 Either @code{0} or @code{1}.  If @var{level} is @code{1}, then short
809 line segments will be collected and merged into longer ones.  This
810 reduces output file size but requires more time and memory.  A
811 @var{level} of @code{0} has the advantage of being better for
812 interactive environments.  @code{1} is the default unless the
813 @code{screen} flag is set; in that case, the default is @code{0}.
814
815 @item optimize-text-size=@var{level}
816
817 One of @code{0}, @code{1}, or @code{2}, each higher level representing
818 correspondingly more aggressive space savings for text in the output
819 file and requiring correspondingly more time and memory.  Unfortunately
820 the levels presently are all the same.  @code{1} is the default unless
821 the @code{screen} flag is set; in that case, the default is @code{0}.
822 @end table
823
824 @node PS page options, PS file options, PS output options, PostScript driver class
825 @subsection PostScript page options
826
827 These options affect page setup:
828
829 @table @code
830 @item headers=@var{boolean}
831
832 Controls whether the standard headers showing the time and date and
833 title and subtitle are printed at the top of each page.  Default:
834 @code{on}.
835
836 @item paper-size=@var{paper-size}
837
838 Paper size, either as a symbolic name (i.e., @code{letter} or @code{a4})
839 or specific measurements (i.e., @code{8-1/2x11} or @code{"210 x 297"}.
840 @xref{papersize, , Paper sizes}.  Default: @code{letter}.
841
842 @item orientation=@var{orientation}
843
844 Either @code{portrait} or @code{landscape}.  Default: @code{portrait}.
845
846 @item left-margin=@var{dimension}
847 @itemx right-margin=@var{dimension}
848 @itemx top-margin=@var{dimension}
849 @itemx bottom-margin=@var{dimension}
850
851 Sets the margins around the page.  The headers, if enabled, are not
852 included in the margins; they are in addition to the margins.  For a
853 description of dimensions, see @ref{Dimensions}.  Default: @code{0.5in}.
854
855 @end table
856
857 @node PS file options, PS font options, PS page options, PostScript driver class
858 @subsection PostScript file options
859
860 Oh, my.  You don't really want to know about the way that the PostScript
861 driver deals with files, do you?  Well I suppose you're entitled, but I
862 warn you right now: it's not pretty.  Here goes@enddots{}
863
864 First let's look at the options that are available:
865
866 @table @code
867
868 @item font-dir=@var{font-directory}
869
870 Sets the font directory.  Default: @code{devps}.
871
872 @item prologue-file=@var{prologue-file-name}
873
874 Sets the name of the PostScript prologue file.  You can write your own
875 prologue, though I have no idea why you'd want to: see @ref{Prologue}.
876 Default: @code{ps-prologue}.
877
878 @item device-file=@var{device-file-name}
879
880 Sets the name of the Groff-format device description file.  The
881 PostScript driver reads this to know about the scaling of fonts
882 and so on.  The format of such files is described in groff_font(5),
883 included with Groff.  Default: @code{DESC}.
884
885 @item encoding-file=@var{encoding-file-name}
886
887 Sets the name of the encoding file.  This file contains a list of all
888 font encodings that will be needed so that the driver can put all of
889 them at the top of the prologue.  @xref{Encodings}.  Default:
890 @code{ps-encodings}.
891
892 If the specified encoding file cannot be found, this error will be
893 silently ignored, since most people do not need any encodings besides
894 the ones that can be found using @code{auto-encodings}, described below.
895
896 @item auto-encode=@var{boolean}
897
898 When enabled, the font encodings needed by the default proportional- and
899 fixed-pitch fonts will automatically be dumped to the PostScript
900 output.  Otherwise, it is assumed that the user has an encoding file
901 and knows how to use it (@pxref{Encodings}).  There is probably no good
902 reason to turn off this convenient feature.  Default: @code{on}.
903
904 @end table
905
906 Next I suppose it's time to describe the search algorithm.  When the
907 PostScript driver needs a file, whether that file be a font, a
908 PostScript prologue, or what you will, it searches in this manner:
909
910 @enumerate
911
912 @item
913 Constructs a path by taking the first of the following that is defined:
914
915 @enumerate a
916
917 @item
918 Environment variable @code{STAT_GROFF_FONT_PATH}.  @xref{Environment
919 variables}.
920
921 @item
922 Environment variable @code{GROFF_FONT_PATH}.
923
924 @item
925 The compiled-in fallback default.
926 @end enumerate
927
928 @item
929 Constructs a base name from concatenating, in order, the font directory,
930 a path separator (@samp{/} or @samp{\}), and the file to be found.  A
931 typical base name would be something like @code{devps/ps-encodings}.
932
933 @item
934 Searches for the base name in the path constructed above.  If the file
935 is found, the algorithm terminates.
936
937 @item
938 Searches for the base name in the standard configuration path.  See
939 @ref{File locations}, for more details.  If the file is found, the
940 algorithm terminates.
941
942 @item
943 At this point we remove the font directory and path separator from the
944 base name.  Now the base name is simply the file to be found, i.e.,
945 @code{ps-encodings}.
946
947 @item
948 Searches for the base name in the path constructed in the first step.
949 If the file is found, the algorithm terminates.
950
951 @item
952 Searches for the base name in the standard configuration path.  If the
953 file is found, the algorithm terminates.
954
955 @item
956 The algorithm terminates unsuccessfully.
957 @end enumerate
958
959 So, as you see, there are several ways to configure the PostScript
960 drivers.  Careful selection of techniques can make the configuration
961 very flexible indeed.
962
963 @node PS font options, PS line options, PS file options, PostScript driver class
964 @subsection PostScript font options
965
966 The list of available font options is short and sweet:
967
968 @table @code
969 @item prop-font=@var{font-name}
970
971 Sets the default proportional font.  The name should be that of a
972 PostScript font.  Default: @code{"Helvetica"}.
973
974 @item fixed-font=@var{font-name}
975
976 Sets the default fixed-pitch font.  The name should be that of a
977 PostScript font.  Default: @code{"Courier"}.
978
979 @item font-size=@var{font-size}
980
981 Sets the size of the default fonts, in thousandths of a point.  Default:
982 @code{10000}.
983
984 @end table
985
986 @node PS line options, Prologue, PS font options, PostScript driver class
987 @subsection PostScript line options
988
989 Most tables contain lines, or rules, between cells.  Some features of
990 the way that lines are drawn in PostScript tables are user-definable:
991
992 @table @code
993
994 @item line-style=@var{style}
995
996 Sets the style used for lines used to divide tables into sections.
997 @var{style} must be either @code{thick}, in which case thick lines are
998 used, or @var{double}, in which case double lines are used.  Default:
999 @code{thick}.
1000
1001 @item line-gutter=@var{dimension}
1002
1003 Sets the line gutter, which is the amount of whitespace on either side
1004 of lines that border text or graphics objects.  @xref{Dimensions}.
1005 Default: @code{0.5pt}.
1006
1007 @item line-spacing=@var{dimension}
1008
1009 Sets the line spacing, which is the amount of whitespace that separates
1010 lines that are side by side, as in a double line.  Default:
1011 @code{0.5pt}.
1012
1013 @item line-width=@var{dimension}
1014
1015 Sets the width of a typical line used in tables.  Default: @code{0.5pt}.
1016
1017 @item line-width-thick=@var{dimension}
1018
1019 Sets the width of a thick line used in tables.  Not used if
1020 @code{line-style} is set to @code{thick}.  Default: @code{1.5pt}.
1021
1022 @end table
1023
1024 @node Prologue, Encodings, PS line options, PostScript driver class
1025 @subsection The PostScript prologue
1026
1027 Most PostScript files that are generated mechanically by programs
1028 consist of two parts: a prologue and a body.  The prologue is generally
1029 a collection of boilerplate.  Only the body differs greatly between
1030 two outputs from the same program.
1031  
1032 This is also the strategy used in the PSPP PostScript driver.  In
1033 general, the prologue supplied with PSPP will be more than sufficient.
1034 In this case, you will not need to read the rest of this section.
1035 However, hackers might want to know more.  Read on, if you fall into
1036 this category.
1037
1038 The prologue is dumped into the output stream essentially unmodified.
1039 However, two actions are performed on its lines.  First, certain lines
1040 may be omitted as specified in the prologue file itself.  Second,
1041 variables are substituted.
1042
1043 The following lines are omitted:
1044
1045 @enumerate
1046 @item
1047 All lines that contain three bangs in a row (@code{!!!}).
1048
1049 @item
1050 Lines that contain @code{!eps}, if the PostScript driver is producing
1051 ordinary PostScript output.  Otherwise an EPS file is being produced,
1052 and the line is included in the output, although everything following
1053 @code{!eps} is deleted.
1054
1055 @item
1056 Lines that contain @code{!ps}, if the PostScript driver is producing EPS
1057 output.  Otherwise, ordinary PostScript is being produced, and the line
1058 is included in the output, although everything following @code{!ps} is
1059 deleted.
1060 @end enumerate
1061
1062 The following are the variables that are substituted.  Only the
1063 variables listed are substituted; environment variables are not.
1064 @xref{Environment substitutions}.
1065
1066 @table @code
1067 @item bounding-box
1068
1069 The page bounding box, in points, as four space-separated numbers.  For
1070 U.S. letter size paper, this is @samp{0 0 612 792}.
1071
1072 @item creator
1073
1074 PSPP version as a string: @samp{GNU PSPP 0.1b}, for example.
1075
1076 @item date
1077
1078 Date the file was created.  Example: @samp{Tue May 21 13:46:22 1991}.
1079
1080 @item data
1081
1082 Value of the @code{data} PostScript driver option, as one of the strings
1083 @samp{Clean7Bit}, @samp{Clean8Bit}, or @samp{Binary}.
1084
1085 @item orientation
1086
1087 Page orientation, as one of the strings @code{Portrait} or
1088 @code{Landscape}.
1089
1090 @item user
1091
1092 Under multiuser OSes, the user's login name, taken either from the
1093 environment variable @code{LOGNAME} or, if that fails, the result of the
1094 C library function @code{getlogin()}.  Defaults to @samp{nobody}.
1095
1096 @item host
1097
1098 System hostname as reported by @code{gethostname()}.  Defaults to
1099 @samp{nowhere}.
1100
1101 @item prop-font
1102
1103 Name of the default proportional font, prefixed by the word
1104 @samp{font} and a space.  Example: @samp{font Times-Roman}.
1105
1106 @item fixed-font
1107
1108 Name of the default fixed-pitch font, prefixed by the word @samp{font}
1109 and a space.
1110
1111 @item scale-factor
1112
1113 The page scaling factor as a floating-point number.  Example:
1114 @code{1.0}.  Note that this is also passed as an argument to the BP
1115 macro.
1116
1117 @item paper-length
1118 @item paper-width
1119
1120 The paper length and paper width, respectively, in thousandths of a
1121 point.  Note that these are also passed as arguments to the BP macro.
1122
1123 @item left-margin
1124 @item top-margin
1125
1126 The left margin and top margin, respectively, in thousandths of a
1127 point.  Note that these are also passed as arguments to the BP macro.
1128
1129 @item title
1130
1131 Document title as a string.  This is not the title specified in the
1132 PSPP syntax file.  A typical title is the word @samp{PSPP} followed
1133 by the syntax file name in parentheses.  Example: @samp{PSPP
1134 (<stdin>)}.
1135
1136 @item source-file
1137
1138 PSPP syntax file name.  Example: @samp{mary96/first.stat}.
1139
1140 @end table
1141
1142 Any other questions about the PostScript prologue can best be answered
1143 by examining the default prologue or the PSPP source.
1144
1145 @node Encodings,  , Prologue, PostScript driver class
1146 @subsection PostScript encodings
1147
1148 PostScript fonts often contain many more than 256 characters, in order
1149 to accommodate foreign language characters and special symbols.
1150 PostScript uses @dfn{encodings} to map these onto single-byte symbol
1151 sets.  Each font can have many different encodings applied to it.
1152
1153 PSPP's PostScript driver needs to know which encoding to apply to each
1154 font.  It can determine this from the information encapsulated in the
1155 Groff font description that it reads.  However, there is an additional
1156 problem---for efficiency, the PostScript driver needs to have a complete
1157 list of all encodings that will be used in the entire session @emph{when
1158 it opens the output file}.  For this reason, it can't use the
1159 information built into the fonts because it doesn't know which fonts
1160 will be used.
1161
1162 As a stopgap solution, there are two mechanisms for specifying which
1163 encodings will be used.  The first mechanism is automatic and it is the
1164 only one that most PSPP users will ever need.  The second mechanism is
1165 manual, but it is more flexible.  Either mechanism or both may be used
1166 at one time.
1167
1168 The first mechanism is activated by the @samp{auto-encode} driver option
1169 (@pxref{PS file options}).  When enabled, @samp{auto-encode} causes the
1170 PostScript driver to include the encodings used by the default
1171 proportional and fixed-pitch fonts (@pxref{PS font options}).  Many
1172 PSPP output files will only need these encodings.
1173
1174 The second mechanism is the file specified by the @samp{encoding-file}
1175 option (@pxref{PS file options}).  If it exists, this file must consist
1176 of lines in PSPP configuration-file format (@pxref{Configuration
1177 files}).  Each line that is not a comment should name a PostScript
1178 encoding to include in the output.
1179
1180 It is not an error if an encoding is included more than once, by either
1181 mechanism.  It will appear only once in the output.  It is also not an
1182 error if an encoding is included in the output but never used.  It
1183 @emph{is} an error if an encoding is used but not included by one of
1184 these mechanisms.  In this case, the built-in PostScript encoding
1185 @samp{ISOLatin1Encoding} is substituted.
1186
1187 @node ASCII driver class, HTML driver class, PostScript driver class, Configuration
1188 @section The ASCII driver class
1189
1190 The ASCII driver class produces output that can be displayed on a
1191 terminal or output to printers.  All of its options are highly
1192 configurable.  The ASCII driver has class name @samp{ascii}.
1193
1194 The ASCII driver is described in further detail below.
1195
1196 @menu
1197 * ASCII output options::        Output file options.
1198 * ASCII page options::          Page size, margins, more.
1199 * ASCII font options::          Box character, bold & italics.
1200 @end menu
1201
1202 @node ASCII output options, ASCII page options, ASCII driver class, ASCII driver class
1203 @subsection ASCII output options
1204
1205 @table @code
1206 @item output-file=@var{filename}
1207
1208 File to which output should be sent.  This can be an ordinary filename
1209 (e.g., @code{"pspp.txt"}), a pipe filename (e.g., @code{"|lpr"}), or
1210 stdout (@code{"-"}).  Default: @code{"pspp.list"}.
1211
1212 @item char-set=@var{char-set-type}
1213
1214 One of @samp{ascii} or @samp{latin1}.  This has no effect on output at
1215 the present time.  Default: @code{ascii}.
1216
1217 @item form-feed-string=@var{form-feed-value}
1218
1219 The string written to the output to cause a formfeed.  See also
1220 @code{paginate}, described below, for a related setting.  Default:
1221 @code{"\f"}.
1222
1223 @item newline-string=@var{new-line-value}
1224
1225 The string written to the output to cause a new-line (carriage return
1226 plus linefeed).  The default, which can be specified explicitly with
1227 @code{newline-string=default}, is to use the system-dependent new-line
1228 sequence by opening the output file in text mode.  This is usually the
1229 right choice.
1230
1231 However, @code{newline-string} can be set to any string.  When this is
1232 done, the output file is opened in binary mode.
1233
1234 @item paginate=@var{boolean}
1235
1236 If set, a formfeed (as set in @code{form-feed-string}, described above)
1237 will be written to the device after every page.  Default: @code{on}.
1238
1239 @item tab-width=@var{tab-width-value}
1240
1241 The distance between tab stops for this device.  If set to 0, tabs will
1242 not be used in the output.  Default: @code{8}.
1243
1244 @item init=@var{initialization-string}.
1245
1246 String written to the device before anything else, at the beginning of
1247 the output.  Default: @code{""} (the empty string).
1248
1249 @item done=@var{finalization-string}.
1250
1251 String written to the device after everything else, at the end of the
1252 output.  Default: @code{""} (the empty string).
1253 @end table
1254
1255 @node ASCII page options, ASCII font options, ASCII output options, ASCII driver class
1256 @subsection ASCII page options
1257
1258 These options affect page setup:
1259
1260 @table @code
1261 @item headers=@var{boolean}
1262
1263 If enabled, two lines of header information giving title and subtitle,
1264 page number, date and time, and PSPP version are printed at the top of
1265 every page.  These two lines are in addition to any top margin
1266 requested.  Default: @code{on}.
1267
1268 @item length=@var{line-count}
1269
1270 Physical length of a page, in lines.  Headers and margins are subtracted
1271 from this value.  Default: @code{66}.
1272
1273 @item width=@var{character-count}
1274
1275 Physical width of a page, in characters.  Margins are subtracted from
1276 this value.  Default: @code{130}.
1277
1278 @item lpi=@var{lines-per-inch}
1279
1280 Number of lines per vertical inch.  Not currently used.  Default: @code{6}.
1281
1282 @item cpi=@var{characters-per-inch}
1283
1284 Number of characters per horizontal inch.  Not currently used.  Default:
1285 @code{10}.
1286
1287 @item left-margin=@var{left-margin-width}
1288
1289 Width of the left margin, in characters.  PSPP subtracts this value
1290 from the page width.  Default: @code{0}.
1291
1292 @item right-margin=@var{right-margin-width}
1293
1294 Width of the right margin, in characters.  PSPP subtracts this value
1295 from the page width.  Default: @code{0}.
1296
1297 @item top-margin=@var{top-margin-lines}
1298
1299 Length of the top margin, in lines.  PSPP subtracts this value from
1300 the page length.  Default: @code{2}.
1301
1302 @item bottom-margin=@var{bottom-margin-lines}
1303
1304 Length of the bottom margin, in lines.  PSPP subtracts this value from
1305 the page length.  Default: @code{2}.
1306
1307 @end table
1308
1309 @node ASCII font options,  , ASCII page options, ASCII driver class
1310 @subsection ASCII font options
1311
1312 These are the ASCII font options:
1313
1314 @table @code
1315 @item box[@var{line-type}]=@var{box-chars}
1316
1317 The characters used for lines in tables produced by the ASCII driver can
1318 be changed using this option.  @var{line-type} is used to indicate which
1319 type of line to change; @var{box-chars} is the character or string of
1320 characters to use for this type of line.
1321
1322 @var{line-type} must be a 4-digit number in base 4.  The digits are in
1323 the order `right', `bottom', `left', `top'.  The four possibilities for
1324 each digit are:
1325
1326 @table @asis
1327 @item 0
1328 No line.
1329
1330 @item 1
1331 Single line.
1332
1333 @item 2
1334 Double line.
1335
1336 @item 3
1337 Special device-defined line, if one is available; otherwise, a double
1338 line.
1339 @end table
1340
1341 Examples:
1342
1343 @table @code
1344 @item box[0101]="|"
1345
1346 Sets @samp{|} as the character to use for a single-width line with
1347 bottom and top components.
1348
1349 @item box[2222]="#"
1350
1351 Sets @samp{#} as the character to use for the intersection of four
1352 double-width lines, one each from the top, bottom, left and right.
1353
1354 @item box[1100]="\xda"
1355
1356 Sets @samp{"\xda"}, which under MS-DOS is a box character suitable for
1357 the top-left corner of a box, as the character for the intersection of
1358 two single-width lines, one each from the right and bottom.
1359
1360 @end table
1361
1362 Defaults:
1363
1364 @itemize @bullet
1365 @item
1366 @code{box[0000]=" "}
1367
1368 @item
1369 @code{box[1000]="-"}
1370 @*@code{box[0010]="-"}
1371 @*@code{box[1010]="-"}
1372
1373 @item
1374 @code{box[0100]="|"}
1375 @*@code{box[0001]="|"}
1376 @*@code{box[0101]="|"}
1377
1378 @item
1379 @code{box[2000]="="}
1380 @*@code{box[0020]="="}
1381 @*@code{box[2020]="="}
1382
1383 @item
1384 @code{box[0200]="#"}
1385 @*@code{box[0002]="#"}
1386 @*@code{box[0202]="#"}
1387
1388 @item
1389 @code{box[3000]="="}
1390 @*@code{box[0030]="="}
1391 @*@code{box[3030]="="}
1392
1393 @item
1394 @code{box[0300]="#"}
1395 @*@code{box[0003]="#"}
1396 @*@code{box[0303]="#"}
1397
1398 @item
1399 For all others, @samp{+} is used unless there are double lines or
1400 special lines, in which case @samp{#} is used.
1401 @end itemize
1402
1403 @item italic-on=@var{italic-on-string}
1404
1405 Character sequence written to turn on italics or underline printing.  If
1406 this is set to @code{overstrike}, then the driver will simulate
1407 underlining by overstriking with underscore characters (@samp{_}) in the
1408 manner described by @code{overstrike-style} and
1409 @code{carriage-return-style}.  Default: @code{overstrike}.
1410
1411 @item italic-off=@var{italic-off-string}
1412
1413 Character sequence to turn off italics or underline printing.  Default:
1414 @code{""} (the empty string).
1415
1416 @item bold-on=@var{bold-on-string}
1417
1418 Character sequence written to turn on bold or emphasized printing.  If
1419 set to @code{overstrike}, then the driver will simulated bold printing
1420 by overstriking characters in the manner described by
1421 @code{overstrike-style} and @code{carriage-return-style}.  Default:
1422 @code{overstrike}.
1423
1424 @item bold-off=@var{bold-off-string}
1425
1426 Character sequence to turn off bold or emphasized printing.  Default:
1427 @code{""} (the empty string).
1428
1429 @item bold-italic-on=@var{bold-italic-on-string}
1430
1431 Character sequence written to turn on bold-italic printing.  If set to
1432 @code{overstrike}, then the driver will simulate bold-italics by
1433 overstriking twice, once with the character, a second time with an
1434 underscore (@samp{_}) character, in the manner described by
1435 @code{overstrike-style} and @code{carriage-return-style}.  Default:
1436 @code{overstrike}.
1437
1438 @item bold-italic-off=@var{bold-italic-off-string}
1439
1440 Character sequence to turn off bold-italic printing.  Default: @code{""}
1441 (the empty string).
1442
1443 @item overstrike-style=@var{overstrike-option}
1444
1445 Either @code{single} or @code{line}:
1446
1447 @itemize @bullet
1448 @item
1449 If @code{single} is selected, then, to overstrike a line of text, the
1450 output driver will output a character, backspace, overstrike, output a
1451 character, backspace, overstrike, and so on along a line.
1452
1453 @item
1454 If @code{line} is selected then the output driver will output an entire
1455 line, then backspace or emit a carriage return (as indicated by
1456 @code{carriage-return-style}), then overstrike the entire line at once.
1457 @end itemize
1458
1459 @code{single} is recommended for use with ttys and programs that
1460 understand overstriking in text files, such as the pager @code{less}.
1461 @code{single} will also work with printer devices but results in rapid
1462 back-and-forth motions of the printhead that can cause the printer to
1463 physically overheat!
1464
1465 @code{line} is recommended for use with printer devices.  Most programs
1466 that understand overstriking in text files will not properly deal with
1467 @code{line} mode.  
1468
1469 Default: @code{single}.
1470
1471 @item carriage-return-style=@var{carriage-return-type}
1472
1473 Either @code{bs} or @code{cr}.  This option applies only when one or
1474 more of the font commands is set to @code{overstrike} and, at the same
1475 time, @code{overstrike-style} is set to @code{line}.
1476
1477 @itemize @bullet
1478 @item
1479 If @code{bs} is selected then the driver will return to the beginning of
1480 a line by emitting a sequence of backspace characters (ASCII 8).
1481
1482 @item
1483 If @code{cr} is selected then the driver will return to the beginning of
1484 a line by emitting a single carriage-return character (ASCII 13).
1485 @end itemize
1486
1487 Although @code{cr} is preferred as being more compact, @code{bs} is more
1488 general since some devices do not interpret carriage returns in the
1489 desired manner.  Default: @code{bs}.
1490 @end table
1491
1492 @node HTML driver class, Miscellaneous configuring, ASCII driver class, Configuration
1493 @section The HTML driver class
1494
1495 The @code{html} driver class is used to produce output for viewing in
1496 tables-capable web browsers such as Emacs' w3-mode.  Its configuration
1497 is very simple.  Currently, the output has a very plain format.  In the
1498 future, further work may be done on improving the output appearance.
1499
1500 There are few options for use with the @code{html} driver class:
1501
1502 @table @code
1503 @item output-file=@var{filename}
1504
1505 File to which output should be sent.  This can be an ordinary filename
1506 (i.e., @code{"pspp.ps"}), a pipe filename (i.e., @code{"|lpr"}), or
1507 stdout (@code{"-"}).  Default: @code{"pspp.html"}.
1508
1509 @item prologue-file=@var{prologue-file-name}
1510
1511 Sets the name of the PostScript prologue file.  You can write your own
1512 prologue if you want to customize colors or other settings: see
1513 @ref{HTML Prologue}.  Default: @code{html-prologue}.
1514 @end table
1515
1516 @menu
1517 * HTML Prologue::               Format of the HTML prologue file.
1518 @end menu
1519
1520 @node HTML Prologue,  , HTML driver class, HTML driver class
1521 @subsection The HTML prologue
1522
1523 HTML files that are generated by PSPP consist of two parts: a prologue
1524 and a body.  The prologue is a collection of boilerplate.  Only the body
1525 differs greatly between two outputs.  You can tune the colors and other
1526 attributes of the output by editing the prologue.
1527  
1528 The prologue is dumped into the output stream essentially unmodified.
1529 However, two actions are performed on its lines.  First, certain lines
1530 may be omitted as specified in the prologue file itself.  Second,
1531 variables are substituted.
1532
1533 The following lines are omitted:
1534
1535 @enumerate
1536 @item
1537 All lines that contain three bangs in a row (@code{!!!}).
1538
1539 @item
1540 Lines that contain @code{!title}, if no title is set for the output.  If
1541 a title is set, then the characters @code{!title} are removed before the
1542 line is output.
1543
1544 @item
1545 Lines that contain @code{!subtitle}, if no subtitle is set for the
1546 output.  If a subtitle is set, then the characters @code{!subtitle} are
1547 removed before the line is output.
1548 @end enumerate
1549
1550 The following are the variables that are substituted.  Only the
1551 variables listed are substituted; environment variables are not.
1552 @xref{Environment substitutions}.
1553
1554 @table @code
1555 @item generator
1556
1557 PSPP version as a string: @samp{GNU PSPP 0.1b}, for example.
1558
1559 @item date
1560
1561 Date the file was created.  Example: @samp{Tue May 21 13:46:22 1991}.
1562
1563 @item user
1564
1565 Under multiuser OSes, the user's login name, taken either from the
1566 environment variable @code{LOGNAME} or, if that fails, the result of the
1567 C library function @code{getlogin()}.  Defaults to @samp{nobody}.
1568
1569 @item host
1570
1571 System hostname as reported by @code{gethostname()}.  Defaults to
1572 @samp{nowhere}.
1573
1574 @item title
1575
1576 Document title as a string.  This is the title specified in the PSPP
1577 syntax file.
1578
1579 @item subtitle
1580
1581 Document subtitle as a string.  
1582
1583 @item source-file
1584
1585 PSPP syntax file name.  Example: @samp{mary96/first.stat}.
1586 @end table
1587
1588 @node Miscellaneous configuring, Improving output quality, HTML driver class, Configuration
1589 @section Miscellaneous configuration
1590
1591 The following environment variables can be used to further configure
1592 PSPP:
1593
1594 @table @code
1595 @item HOME
1596
1597 Used to determine the user's home directory.  No default value.
1598
1599 @item STAT_INCLUDE_PATH
1600
1601 Path used to find include files in PSPP syntax files.  Defaults vary
1602 across operating systems:
1603
1604 @table @asis
1605 @item UNIX
1606
1607 @itemize @bullet
1608 @item
1609 @file{.}
1610
1611 @item
1612 @file{~/.pspp/include}
1613
1614 @item
1615 @file{/usr/local/lib/pspp/include}
1616
1617 @item
1618 @file{/usr/lib/pspp/include}
1619
1620 @item
1621 @file{/usr/local/share/pspp/include}
1622
1623 @item
1624 @file{/usr/share/pspp/include}
1625 @end itemize
1626
1627 @item MS-DOS
1628
1629 @itemize @bullet
1630 @item
1631 @file{.}
1632
1633 @item
1634 @file{C:\PSPP\INCLUDE}
1635
1636 @item
1637 @file{$PATH}
1638 @end itemize
1639
1640 @item Other OSes
1641 No default path.
1642 @end table
1643
1644 @item STAT_PAGER
1645 @itemx PAGER
1646 @cindex pager
1647
1648 When PSPP invokes an external pager, it uses the first of these that
1649 is defined.  There is a default pager only if the person who compiled
1650 PSPP defined one.
1651
1652 @item TERM
1653
1654 The terminal type @code{termcap} or @code{ncurses} will use, if such
1655 support was compiled into PSPP.
1656
1657 @item STAT_OUTPUT_INIT_FILE
1658
1659 The basename used to search for the driver definition file.
1660 @xref{Output devices}.  @xref{File locations}.  Default: @code{devices}.
1661
1662 @item STAT_OUTPUT_PAPERSIZE_FILE
1663
1664 The basename used to search for the papersize file.  @xref{papersize}.
1665 @xref{File locations}.  Default: @code{papersize}.
1666
1667 @item STAT_OUTPUT_INIT_PATH
1668
1669 The path used to search for the driver definition file and the papersize
1670 file.  @xref{File locations}.  Default: the standard configuration path.
1671
1672 @item TMPDIR
1673
1674 The @code{sort} procedure stores its temporary files in this directory.
1675 Default: (UNIX) @file{/tmp}, (MS-DOS) @file{\}, (other OSes) empty string.
1676
1677 @item TEMP
1678 @item TMP
1679
1680 Under MS-DOS only, these variables are consulted after TMPDIR, in this
1681 order.
1682 @end table
1683
1684 @node Improving output quality,  , Miscellaneous configuring, Configuration
1685 @section Improving output quality
1686
1687 When its drivers are set up properly, PSPP can produce output that
1688 looks very good indeed.  The PostScript driver, suitably configured, can
1689 produce presentation-quality output.  Here are a few guidelines for
1690 producing better-looking output, regardless of output driver.  Your
1691 mileage may vary, of course, and everyone has different esthetic
1692 preferences.
1693
1694 @itemize @bullet
1695 @item
1696 Width is important in PSPP output.  Greater output width leads to more
1697 readable output, to a point.  Try the following to increase the output
1698 width:
1699
1700 @itemize @minus
1701 @item
1702 If you're using the ASCII driver with a dot-matrix printer, figure out
1703 what you need to do to put the printer into compressed mode.  Put that
1704 string into the @code{init-string} setting.  Try to get 132 columns; 160
1705 might be better, but you might find that print that tiny is difficult to
1706 read.
1707
1708 @item
1709 With the PostScript driver, try these ideas:
1710
1711 @itemize +
1712 @item
1713 Landscape mode.
1714
1715 @item
1716 Legal-size (8.5" x 14") paper in landscape mode.
1717
1718 @item
1719 Reducing font sizes.  If you're using 12-point fonts, try 10 point; if
1720 you're using 10-point fonts, try 8 point.  Some fonts are more readable
1721 than others at small sizes.
1722 @end itemize
1723 @end itemize
1724
1725 Try to strike a balance between character size and page width.
1726
1727 @item
1728 Use high-quality fonts.  Many public domain fonts are poor in quality.
1729 Recently, URW made some high-quality fonts available under the GPL.
1730 These are probably suitable.
1731
1732 @item
1733 Be sure you're using the proper font metrics.  The font metrics provided
1734 with PSPP may not correspond to the fonts actually being printed.
1735 This can cause bizarre-looking output.
1736
1737 @item
1738 Make sure that you're using good ink/ribbon/toner.  Darker print is
1739 easier to read.
1740
1741 @item
1742 Use plain fonts with serifs, such as Times-Roman or Palatino.  Avoid
1743 choosing italic or bold fonts as document base fonts.
1744 @end itemize
1745 @setfilename ignored