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