1 @node Configuration, Portable File Format, Installation, Top
2 @appendix Configuring PSPP
4 @cindex PSPP, configuring
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{}
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.
26 @node File locations, Configuration techniques, Configuration, Configuration
27 @section Locating configuration files
29 PSPP uses the same method to find most of its configuration files:
33 The @dfn{base name} of the file being sought is determined.
36 The path to search is determined.
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.
44 The first two steps are elaborated below for the sake of our pedantic
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
54 Determining the base name is a two-step process:
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}.
64 Otherwise, the compiled-in default is used. For example, when searching
65 for the output driver initialization file, the default base name is
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.
75 The path is the first of the following that is defined:
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}.
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.)
91 The configuration file path, which is itself determined by the
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.
101 Otherwise, if the environment variable @code{STAT_CONFIG_PATH} is
102 defined, the value of that variable is used.
105 Otherwise, the compiled-in fallback default is used. On UNIX machines,
106 the default fallback path is
113 @file{/usr/local/lib/pspp}
119 On DOS machines, the default fallback path is:
123 All the paths from the DOS search path in the @samp{PATH} environment
124 variable, in left-to-right order.
127 @file{C:\PSPP}, as a last resort.
130 Note that the installer of PSPP can easily change this default
131 fallback path; thus the above should not be taken as gospel.
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
141 @node Configuration techniques, Configuration files, File locations, Configuration
142 @section Configuration techniques
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.
150 Syntax commands that modify settings, such as @cmd{SET}. @xref{SET}.
153 Command-line options. @xref{Invocation}.
156 PSPP-specific environment variable contents. @xref{Environment
160 General environment variable contents. @xref{Environment variables}.
163 Configuration file contents. @xref{Configuration files}.
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.
174 @node Configuration files, Environment variables, Configuration techniques, Configuration
175 @section Configuration files
177 Most configuration files have a common form:
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.
186 Before anything else is done, trailing white space is removed.
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.
194 White space preceding the backslash is retained.
197 This rule continues to be applied until the line read does not end in a
201 It is an error if the last line in the file ends in a backslash.
205 Comments are introduced by an octothorpe (@samp{#}), and continue until the
210 An octothorpe inside balanced pairs of double quotation marks (@samp{"})
211 or single quotation marks (@samp{'}) does not introduce a comment.
214 The backslash character can be used inside balanced quotes of either
215 type to escape the following character as a literal character.
217 (This is distinct from the use of a backslash as a line-splicing
221 Line splicing takes place before comment removal.
225 Blank lines, and lines that contain only white space, are ignored.
228 @node Environment variables, Output devices, Configuration files, Configuration
229 @section Environment variables
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:
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.
242 @node Variable values, Environment substitutions, Environment variables, Environment variables
243 @subsection Values of environment variables
245 Values for environment variables are obtained by the following means,
246 which are arranged in order of decreasing precedence:
250 Command-line options. @xref{Invocation}.
253 The @file{environment} configuration file---more on this below.
256 Actual environment variables (defined in the shell or other parent
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.
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
274 Environment substitutions are performed on each line in the file
275 (@pxref{Environment substitutions}).
277 See @ref{Configuration files}, for more details on formatting of the
278 environment configuration file.
281 @strong{Please note:} Support for @file{environment} is not yet
285 @node Environment substitutions, Predefined variables, Variable values, Environment variables
286 @subsection Environment substitutions
288 Much of the power of environment variables lies in the way that they may
289 be substituted into configuration files. Variable substitutions are
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
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
308 Exactly one nonalphabetic character. This may not be a left brace
313 Same as above, but @var{var} may contain any character (except
317 Replaced by a single dollar sign.
320 Undefined variables expand to a empty value.
322 @node Predefined variables, , Environment substitutions, Environment variables
323 @subsection Predefined environment variables
325 There are two environment variables predefined for use in environment
330 Defined as the version number of PSPP, as a string, in a format
331 something like @samp{0.9.4}.
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.
340 Nothing prevents these values from being overridden, although it's a
341 good idea not to do so.
343 @node Output devices, PostScript driver class, Environment variables, Configuration
344 @section Output devices
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}).
353 Lines in @file{devices} are divided into three categories, described
354 briefly in the table below:
357 @item driver category definitions
358 Define a driver in terms of other drivers.
360 @item macro definitions
361 Define environment variables local to the the output driver
364 @item device definitions
365 Describe the configuration of an output device.
368 The following sections further elaborate the contents of the
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.
381 @node Driver categories, Macro definitions, Output devices, Output devices
382 @subsection Driver categories
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}).
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.
398 Categories may also be specified on the command line
399 (@pxref{Invocation}).
401 This is all you need to know about categories. If you're still curious,
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
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.
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.
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
423 It is an error if the list is not empty when the end of @file{devices}
426 @node Macro definitions, Device definitions, Driver categories, Output devices
427 @subsection Macro definitions
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.
435 Please note the following nuances of macro usage:
439 For the purposes of this section, @dfn{macro} and @dfn{environment
440 variable} are synonyms.
443 Macros may not take arguments.
446 Macros may not recurse.
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.
454 Macros override other all environment variables of the same name (within
455 the scope of @file{devices}).
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}.
463 There are two predefined macros, whose values are determined at runtime:
467 Defined as the width of the console screen, in columns of text.
470 Defined as the length of the console screen, in lines of text.
474 @node Device definitions, Dimensions, Macro definitions, Output devices
475 @subsection Driver definitions
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.
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:
489 A unique identifier, used to determine whether to enable the driver.
492 One of the predefined driver classes supported by PSPP. The
493 currently supported driver classes include `postscript' and `ascii'.
496 Zero or more of the following keywords, delimited by spaces:
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
507 Indicates that the device is a printer.
511 Indicates that the device is a listing file.
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
521 An optional set of options to pass to the driver itself. The exact
522 format for the options varies among drivers.
525 The driver is enabled if:
529 Its driver name is specified on the command line, or
532 It's in a category specified on the command line, or
535 If no categories or driver names are specified on the command line, it
536 is in category @code{default}.
539 For more information on driver names, see @ref{Driver categories}.
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.
546 Options are dependent on the driver. See the driver descriptions for
549 @node Dimensions, papersize, Device definitions, Output devices
550 @subsection Dimensions
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}.
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
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{}:
570 inch (1 @code{in} = 2.54 @code{cm})
573 inch (1 @code{in} = 2.54 @code{cm})
576 printer's point (1 @code{in} = 72.27 @code{pt})
579 pica (12 @code{pt} = 1 @code{pc})
582 PostScript point (1 @code{in} = 72 @code{bp})
588 millimeter (10 @code{mm} = 1 @code{cm})
591 didot point (1157 @code{dd} = 1238 @code{pt})
594 cicero (1 @code{cc} = 12 @code{dd})
597 scaled point (65536 @code{sp} = 1 @code{pt})
601 If no explicit unit is given, PSPP attempts to guess the best unit:
605 Numbers less than 50 are assumed to be in inches.
608 Numbers 50 or greater are assumed to be in millimeters.
612 @node papersize, Distinguishing line types, Dimensions, Output devices
613 @subsection Paper sizes
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}.
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.
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}.
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
642 @node Distinguishing line types, Tokenizing lines, papersize, Output devices
643 @subsection How lines are divided into types
645 The lines in @file{devices} are distinguished in the following manner:
649 Leading white space is removed.
652 If the resulting line begins with the exact string @code{define},
653 followed by one or more white space characters, the line is processed as
657 Otherwise, the line is scanned for the first instance of a colon
658 (@samp{:}) or an equals sign (@samp{=}).
661 If a colon is encountered first, the line is processed as a driver
665 Otherwise, if an equals sign is encountered, the line is processed as a
669 Otherwise, the line is ill-formed.
672 @node Tokenizing lines, , Distinguishing line types, Output devices
673 @subsection How lines are divided into tokens
675 Each driver definition line is run through a simple tokenizer. This
676 tokenizer recognizes two basic types of tokens.
678 The first type is an equals sign (@samp{=}). Equals signs are both
679 delimiters between tokens and tokens in themselves.
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 white space or equals sign.
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:
693 A single-quote (@samp{'}).
696 A double-quote (@samp{"}).
699 A question mark (@samp{?}). Included for hysterical raisins.
702 A backslash (@samp{\}).
705 Audio bell (ASCII 7).
717 Carriage return (ASCII 13).
723 Vertical tab (ASCII 11).
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.
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.
736 Tokens, outside of quoted strings, are delimited by white space or equals
739 @node PostScript driver class, ASCII driver class, Output devices, Configuration
740 @section The PostScript driver class
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
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
754 The PostScript driver is described in further detail below.
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.
766 @node PS output options, PS page options, PostScript driver class, PostScript driver class
767 @subsection PostScript output options
769 These options deal with the form of the output and the output file
773 @item output-file=@var{filename}
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"}.
779 @item color=@var{boolean}
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}.
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.
791 @item data=@var{data-type}
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}.
801 @item line-ends=@var{line-end-type}
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}.
806 @item optimize-line-size=@var{level}
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}.
815 @item optimize-text-size=@var{level}
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}.
824 @node PS page options, PS file options, PS output options, PostScript driver class
825 @subsection PostScript page options
827 These options affect page setup:
830 @item headers=@var{boolean}
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:
836 @item paper-size=@var{paper-size}
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}.
842 @item orientation=@var{orientation}
844 Either @code{portrait} or @code{landscape}. Default: @code{portrait}.
846 @item left-margin=@var{dimension}
847 @itemx right-margin=@var{dimension}
848 @itemx top-margin=@var{dimension}
849 @itemx bottom-margin=@var{dimension}
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}.
857 @node PS file options, PS font options, PS page options, PostScript driver class
858 @subsection PostScript file options
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{}
864 First let's look at the options that are available:
868 @item font-dir=@var{font-directory}
870 Sets the font directory. Default: @code{devps}.
872 @item prologue-file=@var{prologue-file-name}
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}.
878 @item device-file=@var{device-file-name}
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 the groff_font man page,
883 included with Groff. Default: @code{DESC}.
885 @item encoding-file=@var{encoding-file-name}
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:
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.
896 @item auto-encode=@var{boolean}
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}.
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:
913 Constructs a path by taking the first of the following that is defined:
918 Environment variable @code{STAT_GROFF_FONT_PATH}. @xref{Environment
922 Environment variable @code{GROFF_FONT_PATH}.
925 The compiled-in fallback default.
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}.
934 Searches for the base name in the path constructed above. If the file
935 is found, the algorithm terminates.
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.
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.,
948 Searches for the base name in the path constructed in the first step.
949 If the file is found, the algorithm terminates.
952 Searches for the base name in the standard configuration path. If the
953 file is found, the algorithm terminates.
956 The algorithm terminates unsuccessfully.
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.
963 @node PS font options, PS line options, PS file options, PostScript driver class
964 @subsection PostScript font options
966 The list of available font options is short and sweet:
969 @item prop-font=@var{font-name}
971 Sets the default proportional font. The name should be that of a
972 PostScript font. Default: @code{"Helvetica"}.
974 @item fixed-font=@var{font-name}
976 Sets the default fixed-pitch font. The name should be that of a
977 PostScript font. Default: @code{"Courier"}.
979 @item font-size=@var{font-size}
981 Sets the size of the default fonts, in thousandths of a point. Default:
986 @node PS line options, Prologue, PS font options, PostScript driver class
987 @subsection PostScript line options
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:
994 @item line-style=@var{style}
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:
1001 @item line-gutter=@var{dimension}
1003 Sets the line gutter, which is the amount of white space on either side
1004 of lines that border text or graphics objects. @xref{Dimensions}.
1005 Default: @code{0.5pt}.
1007 @item line-spacing=@var{dimension}
1009 Sets the line spacing, which is the amount of white space that separates
1010 lines that are side by side, as in a double line. Default:
1013 @item line-width=@var{dimension}
1015 Sets the width of a typical line used in tables. Default: @code{0.5pt}.
1017 @item line-width-thick=@var{dimension}
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}.
1024 @node Prologue, Encodings, PS line options, PostScript driver class
1025 @subsection The PostScript prologue
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.
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
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.
1043 The following lines are omitted:
1047 All lines that contain three bangs in a row (@code{!!!}).
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.
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
1062 The following are the variables that are substituted. Only the
1063 variables listed are substituted; environment variables are not.
1064 @xref{Environment substitutions}.
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}.
1074 PSPP version as a string: @samp{GNU PSPP 0.1b}, for example.
1078 Date the file was created. Example: @samp{Tue May 21 13:46:22 1991}.
1082 Value of the @code{data} PostScript driver option, as one of the strings
1083 @samp{Clean7Bit}, @samp{Clean8Bit}, or @samp{Binary}.
1087 Page orientation, as one of the strings @code{Portrait} or
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}.
1098 System hostname as reported by @code{gethostname()}. Defaults to
1103 Name of the default proportional font, prefixed by the word
1104 @samp{font} and a space. Example: @samp{font Times-Roman}.
1108 Name of the default fixed-pitch font, prefixed by the word @samp{font}
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
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.
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.
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
1138 PSPP syntax file name. Example: @samp{mary96/first.stat}.
1142 Any other questions about the PostScript prologue can best be answered
1143 by examining the default prologue or the PSPP source.
1145 @node Encodings, , Prologue, PostScript driver class
1146 @subsection PostScript encodings
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.
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
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
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.
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.
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.
1187 @node ASCII driver class, HTML driver class, PostScript driver class, Configuration
1188 @section The ASCII driver class
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}.
1194 The ASCII driver is described in further detail below.
1197 * ASCII output options:: Output file options.
1198 * ASCII page options:: Page size, margins, more.
1199 * ASCII font options:: Box character, bold & italics.
1202 @node ASCII output options, ASCII page options, ASCII driver class, ASCII driver class
1203 @subsection ASCII output options
1206 @item output-file=@var{filename}
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"}.
1212 @item char-set=@var{char-set-type}
1214 One of @samp{ascii} or @samp{latin1}. This has no effect on output at
1215 the present time. Default: @code{ascii}.
1217 @item form-feed-string=@var{form-feed-value}
1219 The string written to the output to cause a formfeed. See also
1220 @code{paginate}, described below, for a related setting. Default:
1223 @item newline-string=@var{new-line-value}
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
1231 However, @code{newline-string} can be set to any string. When this is
1232 done, the output file is opened in binary mode.
1234 @item paginate=@var{boolean}
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}.
1239 @item tab-width=@var{tab-width-value}
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}.
1244 @item init=@var{initialization-string}.
1246 String written to the device before anything else, at the beginning of
1247 the output. Default: @code{""} (the empty string).
1249 @item done=@var{finalization-string}.
1251 String written to the device after everything else, at the end of the
1252 output. Default: @code{""} (the empty string).
1255 @node ASCII page options, ASCII font options, ASCII output options, ASCII driver class
1256 @subsection ASCII page options
1258 These options affect page setup:
1261 @item headers=@var{boolean}
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}.
1268 @item length=@var{line-count}
1270 Physical length of a page, in lines. Headers and margins are subtracted
1271 from this value. Default: @code{66}.
1273 @item width=@var{character-count}
1275 Physical width of a page, in characters. Margins are subtracted from
1276 this value. Default: @code{130}.
1278 @item lpi=@var{lines-per-inch}
1280 Number of lines per vertical inch. Not currently used. Default: @code{6}.
1282 @item cpi=@var{characters-per-inch}
1284 Number of characters per horizontal inch. Not currently used. Default:
1287 @item left-margin=@var{left-margin-width}
1289 Width of the left margin, in characters. PSPP subtracts this value
1290 from the page width. Default: @code{0}.
1292 @item right-margin=@var{right-margin-width}
1294 Width of the right margin, in characters. PSPP subtracts this value
1295 from the page width. Default: @code{0}.
1297 @item top-margin=@var{top-margin-lines}
1299 Length of the top margin, in lines. PSPP subtracts this value from
1300 the page length. Default: @code{2}.
1302 @item bottom-margin=@var{bottom-margin-lines}
1304 Length of the bottom margin, in lines. PSPP subtracts this value from
1305 the page length. Default: @code{2}.
1309 @node ASCII font options, , ASCII page options, ASCII driver class
1310 @subsection ASCII font options
1312 These are the ASCII font options:
1315 @item box[@var{line-type}]=@var{box-chars}
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.
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
1337 Special device-defined line, if one is available; otherwise, a double
1346 Sets @samp{|} as the character to use for a single-width line with
1347 bottom and top components.
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.
1354 @item box[1100]="\xda"
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.
1366 @code{box[0000]=" "}
1369 @code{box[1000]="-"}
1370 @*@code{box[0010]="-"}
1371 @*@code{box[1010]="-"}
1374 @code{box[0100]="|"}
1375 @*@code{box[0001]="|"}
1376 @*@code{box[0101]="|"}
1379 @code{box[2000]="="}
1380 @*@code{box[0020]="="}
1381 @*@code{box[2020]="="}
1384 @code{box[0200]="#"}
1385 @*@code{box[0002]="#"}
1386 @*@code{box[0202]="#"}
1389 @code{box[3000]="="}
1390 @*@code{box[0030]="="}
1391 @*@code{box[3030]="="}
1394 @code{box[0300]="#"}
1395 @*@code{box[0003]="#"}
1396 @*@code{box[0303]="#"}
1399 For all others, @samp{+} is used unless there are double lines or
1400 special lines, in which case @samp{#} is used.
1403 @item italic-on=@var{italic-on-string}
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}.
1411 @item italic-off=@var{italic-off-string}
1413 Character sequence to turn off italics or underline printing. Default:
1414 @code{""} (the empty string).
1416 @item bold-on=@var{bold-on-string}
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:
1424 @item bold-off=@var{bold-off-string}
1426 Character sequence to turn off bold or emphasized printing. Default:
1427 @code{""} (the empty string).
1429 @item bold-italic-on=@var{bold-italic-on-string}
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:
1438 @item bold-italic-off=@var{bold-italic-off-string}
1440 Character sequence to turn off bold-italic printing. Default: @code{""}
1443 @item overstrike-style=@var{overstrike-option}
1445 Either @code{single} or @code{line}:
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.
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.
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!
1465 @code{line} is recommended for use with printer devices. Most programs
1466 that understand overstriking in text files will not properly deal with
1469 Default: @code{single}.
1471 @item carriage-return-style=@var{carriage-return-type}
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}.
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).
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).
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}.
1492 @node HTML driver class, Miscellaneous configuring, ASCII driver class, Configuration
1493 @section The HTML driver class
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.
1500 There are few options for use with the @code{html} driver class:
1503 @item output-file=@var{filename}
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"}.
1509 @item prologue-file=@var{prologue-file-name}
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}.
1517 * HTML Prologue:: Format of the HTML prologue file.
1520 @node HTML Prologue, , HTML driver class, HTML driver class
1521 @subsection The HTML prologue
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.
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.
1533 The following lines are omitted:
1537 All lines that contain three bangs in a row (@code{!!!}).
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
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.
1550 The following are the variables that are substituted. Only the
1551 variables listed are substituted; environment variables are not.
1552 @xref{Environment substitutions}.
1557 PSPP version as a string: @samp{GNU PSPP 0.1b}, for example.
1561 Date the file was created. Example: @samp{Tue May 21 13:46:22 1991}.
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}.
1571 System hostname as reported by @code{gethostname()}. Defaults to
1576 Document title as a string. This is the title specified in the PSPP
1581 Document subtitle as a string.
1585 PSPP syntax file name. Example: @samp{mary96/first.stat}.
1588 @node Miscellaneous configuring, Improving output quality, HTML driver class, Configuration
1589 @section Miscellaneous configuration
1591 The following environment variables can be used to further configure
1597 Used to determine the user's home directory. No default value.
1599 @item STAT_INCLUDE_PATH
1601 Path used to find include files in PSPP syntax files. Defaults vary
1602 across operating systems:
1612 @file{~/.pspp/include}
1615 @file{/usr/local/lib/pspp/include}
1618 @file{/usr/lib/pspp/include}
1621 @file{/usr/local/share/pspp/include}
1624 @file{/usr/share/pspp/include}
1634 @file{C:\PSPP\INCLUDE}
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
1654 The terminal type @code{termcap} or @code{ncurses} will use, if such
1655 support was compiled into PSPP.
1657 @item STAT_OUTPUT_INIT_FILE
1659 The basename used to search for the driver definition file.
1660 @xref{Output devices}. @xref{File locations}. Default: @code{devices}.
1662 @item STAT_OUTPUT_PAPERSIZE_FILE
1664 The basename used to search for the papersize file. @xref{papersize}.
1665 @xref{File locations}. Default: @code{papersize}.
1667 @item STAT_OUTPUT_INIT_PATH
1669 The path used to search for the driver definition file and the papersize
1670 file. @xref{File locations}. Default: the standard configuration path.
1674 The directory in which PSPP stores its temporary files (used when sorting
1675 cases or concatenating large numbers of cases).
1676 Default: (UNIX) @file{/tmp}, (MS-DOS) @file{\}, (other OSes) empty string.
1681 Under MS-DOS only, these variables are consulted after TMPDIR, in this
1685 @node Improving output quality, , Miscellaneous configuring, Configuration
1686 @section Improving output quality
1688 When its drivers are set up properly, PSPP can produce output that
1689 looks very good indeed. The PostScript driver, suitably configured, can
1690 produce presentation-quality output. Here are a few guidelines for
1691 producing better-looking output, regardless of output driver. Your
1692 mileage may vary, of course, and everyone has different esthetic
1697 Width is important in PSPP output. Greater output width leads to more
1698 readable output, to a point. Try the following to increase the output
1703 If you're using the ASCII driver with a dot-matrix printer, figure out
1704 what you need to do to put the printer into compressed mode. Put that
1705 string into the @code{init-string} setting. Try to get 132 columns; 160
1706 might be better, but you might find that print that tiny is difficult to
1710 With the PostScript driver, try these ideas:
1717 Legal-size (8.5" x 14") paper in landscape mode.
1720 Reducing font sizes. If you're using 12-point fonts, try 10 point; if
1721 you're using 10-point fonts, try 8 point. Some fonts are more readable
1722 than others at small sizes.
1726 Try to strike a balance between character size and page width.
1729 Use high-quality fonts. Many public domain fonts are poor in quality.
1730 Recently, URW made some high-quality fonts available under the GPL.
1731 These are probably suitable.
1734 Be sure you're using the proper font metrics. The font metrics provided
1735 with PSPP may not correspond to the fonts actually being printed.
1736 This can cause bizarre-looking output.
1739 Make sure that you're using good ink/ribbon/toner. Darker print is
1743 Use plain fonts with serifs, such as Times-Roman or Palatino. Avoid
1744 choosing italic or bold fonts as document base fonts.
1746 @setfilename ignored