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.
171 @node Configuration files, Environment variables, Configuration techniques, Configuration
172 @section Configuration files
174 Most configuration files have a common form:
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.
183 Before anything else is done, trailing white space is removed.
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.
191 White space preceding the backslash is retained.
194 This rule continues to be applied until the line read does not end in a
198 It is an error if the last line in the file ends in a backslash.
202 Comments are introduced by an octothorpe (@samp{#}), and continue until the
207 An octothorpe inside balanced pairs of double quotation marks (@samp{"})
208 or single quotation marks (@samp{'}) does not introduce a comment.
211 The backslash character can be used inside balanced quotes of either
212 type to escape the following character as a literal character.
214 (This is distinct from the use of a backslash as a line-splicing
218 Line splicing takes place before comment removal.
222 Blank lines, and lines that contain only white space, are ignored.
225 @node Environment variables, Output devices, Configuration files, Configuration
226 @section Environment variables
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:
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.
239 @node Variable values, Environment substitutions, Environment variables, Environment variables
240 @subsection Values of environment variables
242 Values for environment variables are obtained by the following means,
243 which are arranged in order of decreasing precedence:
247 Command-line options. @xref{Invocation}.
250 The @file{environment} configuration file---more on this below.
253 Actual environment variables (defined in the shell or other parent
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.
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
271 Environment substitutions are performed on each line in the file
272 (@pxref{Environment substitutions}).
274 See @ref{Configuration files}, for more details on formatting of the
275 environment configuration file.
278 @strong{Please note:} Support for @file{environment} is not yet
282 @node Environment substitutions, Predefined variables, Variable values, Environment variables
283 @subsection Environment substitutions
285 Much of the power of environment variables lies in the way that they may
286 be substituted into configuration files. Variable substitutions are
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
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
305 Exactly one nonalphabetic character. This may not be a left brace
310 Same as above, but @var{var} may contain any character (except
314 Replaced by a single dollar sign.
317 Undefined variables expand to a empty value.
319 @node Predefined variables, , Environment substitutions, Environment variables
320 @subsection Predefined environment variables
322 There are two environment variables predefined for use in environment
327 Defined as the version number of PSPP, as a string, in a format
328 something like @samp{0.9.4}.
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.
337 Nothing prevents these values from being overridden, although it's a
338 good idea not to do so.
340 @node Output devices, PostScript driver class, Environment variables, Configuration
341 @section Output devices
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}).
350 Lines in @file{devices} are divided into three categories, described
351 briefly in the table below:
354 @item driver category definitions
355 Define a driver in terms of other drivers.
357 @item macro definitions
358 Define environment variables local to the the output driver
361 @item device definitions
362 Describe the configuration of an output device.
365 The following sections further elaborate the contents of the
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.
378 @node Driver categories, Macro definitions, Output devices, Output devices
379 @subsection Driver categories
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}).
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.
395 Categories may also be specified on the command line
396 (@pxref{Invocation}).
398 This is all you need to know about categories. If you're still curious,
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
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.
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.
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
420 It is an error if the list is not empty when the end of @file{devices}
423 @node Macro definitions, Device definitions, Driver categories, Output devices
424 @subsection Macro definitions
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.
432 Please note the following nuances of macro usage:
436 For the purposes of this section, @dfn{macro} and @dfn{environment
437 variable} are synonyms.
440 Macros may not take arguments.
443 Macros may not recurse.
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.
451 Macros override other all environment variables of the same name (within
452 the scope of @file{devices}).
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}.
460 There are two predefined macros, whose values are determined at runtime:
464 Defined as the width of the console screen, in columns of text.
467 Defined as the length of the console screen, in lines of text.
471 @node Device definitions, Dimensions, Macro definitions, Output devices
472 @subsection Driver definitions
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.
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:
486 A unique identifier, used to determine whether to enable the driver.
489 One of the predefined driver classes supported by PSPP. The
490 currently supported driver classes include `postscript' and `ascii'.
493 Zero or more of the following keywords, delimited by spaces:
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
504 Indicates that the device is a printer.
508 Indicates that the device is a listing file.
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
518 An optional set of options to pass to the driver itself. The exact
519 format for the options varies among drivers.
522 The driver is enabled if:
526 Its driver name is specified on the command line, or
529 It's in a category specified on the command line, or
532 If no categories or driver names are specified on the command line, it
533 is in category @code{default}.
536 For more information on driver names, see @ref{Driver categories}.
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.
543 Options are dependent on the driver. See the driver descriptions for
546 @node Dimensions, papersize, Device definitions, Output devices
547 @subsection Dimensions
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}.
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
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{}:
567 inch (1 @code{in} = 2.54 @code{cm})
570 inch (1 @code{in} = 2.54 @code{cm})
573 printer's point (1 @code{in} = 72.27 @code{pt})
576 pica (12 @code{pt} = 1 @code{pc})
579 PostScript point (1 @code{in} = 72 @code{bp})
585 millimeter (10 @code{mm} = 1 @code{cm})
588 didot point (1157 @code{dd} = 1238 @code{pt})
591 cicero (1 @code{cc} = 12 @code{dd})
594 scaled point (65536 @code{sp} = 1 @code{pt})
598 If no explicit unit is given, PSPP attempts to guess the best unit:
602 Numbers less than 50 are assumed to be in inches.
605 Numbers 50 or greater are assumed to be in millimeters.
609 @node papersize, Distinguishing line types, Dimensions, Output devices
610 @subsection Paper sizes
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}.
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.
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}.
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
639 @node Distinguishing line types, Tokenizing lines, papersize, Output devices
640 @subsection How lines are divided into types
642 The lines in @file{devices} are distinguished in the following manner:
646 Leading white space is removed.
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
654 Otherwise, the line is scanned for the first instance of a colon
655 (@samp{:}) or an equals sign (@samp{=}).
658 If a colon is encountered first, the line is processed as a driver
662 Otherwise, if an equals sign is encountered, the line is processed as a
666 Otherwise, the line is ill-formed.
669 @node Tokenizing lines, , Distinguishing line types, Output devices
670 @subsection How lines are divided into tokens
672 Each driver definition line is run through a simple tokenizer. This
673 tokenizer recognizes two basic types of tokens.
675 The first type is an equals sign (@samp{=}). Equals signs are both
676 delimiters between tokens and tokens in themselves.
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.
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:
690 A single-quote (@samp{'}).
693 A double-quote (@samp{"}).
696 A question mark (@samp{?}). Included for hysterical raisins.
699 A backslash (@samp{\}).
702 Audio bell (ASCII 7).
714 Carriage return (ASCII 13).
720 Vertical tab (ASCII 11).
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.
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.
733 Tokens, outside of quoted strings, are delimited by white space or equals
736 @node PostScript driver class, ASCII driver class, Output devices, Configuration
737 @section The PostScript driver class
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
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
751 The PostScript driver is described in further detail below.
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.
763 @node PS output options, PS page options, PostScript driver class, PostScript driver class
764 @subsection PostScript output options
766 These options deal with the form of the output and the output file
770 @item output-file=@var{filename}
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"}.
776 @item color=@var{boolean}
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}.
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.
788 @item data=@var{data-type}
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}.
798 @item line-ends=@var{line-end-type}
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}.
803 @item optimize-line-size=@var{level}
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}.
812 @item optimize-text-size=@var{level}
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}.
821 @node PS page options, PS file options, PS output options, PostScript driver class
822 @subsection PostScript page options
824 These options affect page setup:
827 @item headers=@var{boolean}
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:
833 @item paper-size=@var{paper-size}
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}.
839 @item orientation=@var{orientation}
841 Either @code{portrait} or @code{landscape}. Default: @code{portrait}.
843 @item left-margin=@var{dimension}
844 @itemx right-margin=@var{dimension}
845 @itemx top-margin=@var{dimension}
846 @itemx bottom-margin=@var{dimension}
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}.
854 @node PS file options, PS font options, PS page options, PostScript driver class
855 @subsection PostScript file options
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{}
861 First let's look at the options that are available:
865 @item font-dir=@var{font-directory}
867 Sets the font directory. Default: @code{devps}.
869 @item prologue-file=@var{prologue-file-name}
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}.
875 @item device-file=@var{device-file-name}
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}.
882 @item encoding-file=@var{encoding-file-name}
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:
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.
893 @item auto-encode=@var{boolean}
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}.
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:
910 Constructs a path by taking the first of the following that is defined:
915 Environment variable @code{STAT_GROFF_FONT_PATH}. @xref{Environment
919 Environment variable @code{GROFF_FONT_PATH}.
922 The compiled-in fallback default.
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}.
931 Searches for the base name in the path constructed above. If the file
932 is found, the algorithm terminates.
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.
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.,
945 Searches for the base name in the path constructed in the first step.
946 If the file is found, the algorithm terminates.
949 Searches for the base name in the standard configuration path. If the
950 file is found, the algorithm terminates.
953 The algorithm terminates unsuccessfully.
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.
960 @node PS font options, PS line options, PS file options, PostScript driver class
961 @subsection PostScript font options
963 The list of available font options is short and sweet:
966 @item prop-font=@var{font-name}
968 Sets the default proportional font. The name should be that of a
969 PostScript font. Default: @code{"Helvetica"}.
971 @item fixed-font=@var{font-name}
973 Sets the default fixed-pitch font. The name should be that of a
974 PostScript font. Default: @code{"Courier"}.
976 @item font-size=@var{font-size}
978 Sets the size of the default fonts, in thousandths of a point. Default:
983 @node PS line options, Prologue, PS font options, PostScript driver class
984 @subsection PostScript line options
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:
991 @item line-style=@var{style}
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:
998 @item line-gutter=@var{dimension}
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}.
1004 @item line-spacing=@var{dimension}
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:
1010 @item line-width=@var{dimension}
1012 Sets the width of a typical line used in tables. Default: @code{0.5pt}.
1014 @item line-width-thick=@var{dimension}
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}.
1021 @node Prologue, Encodings, PS line options, PostScript driver class
1022 @subsection The PostScript prologue
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.
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
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.
1040 The following lines are omitted:
1044 All lines that contain three bangs in a row (@code{!!!}).
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.
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
1059 The following are the variables that are substituted. Only the
1060 variables listed are substituted; environment variables are not.
1061 @xref{Environment substitutions}.
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}.
1071 PSPP version as a string: @samp{GNU PSPP 0.1b}, for example.
1075 Date the file was created. Example: @samp{Tue May 21 13:46:22 1991}.
1079 Value of the @code{data} PostScript driver option, as one of the strings
1080 @samp{Clean7Bit}, @samp{Clean8Bit}, or @samp{Binary}.
1084 Page orientation, as one of the strings @code{Portrait} or
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}.
1095 System hostname as reported by @code{gethostname()}. Defaults to
1100 Name of the default proportional font, prefixed by the word
1101 @samp{font} and a space. Example: @samp{font Times-Roman}.
1105 Name of the default fixed-pitch font, prefixed by the word @samp{font}
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
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.
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.
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
1135 PSPP syntax file name. Example: @samp{mary96/first.stat}.
1139 Any other questions about the PostScript prologue can best be answered
1140 by examining the default prologue or the PSPP source.
1142 @node Encodings, , Prologue, PostScript driver class
1143 @subsection PostScript encodings
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.
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
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
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.
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.
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.
1184 @node ASCII driver class, HTML driver class, PostScript driver class, Configuration
1185 @section The ASCII driver class
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}.
1191 The ASCII driver is described in further detail below.
1194 * ASCII output options:: Output file options.
1195 * ASCII page options:: Page size, margins, more.
1196 * ASCII font options:: Box character, bold & italics.
1199 @node ASCII output options, ASCII page options, ASCII driver class, ASCII driver class
1200 @subsection ASCII output options
1203 @item output-file=@var{filename}
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"}.
1209 @item char-set=@var{char-set-type}
1211 One of @samp{ascii} or @samp{latin1}. This has no effect on output at
1212 the present time. Default: @code{ascii}.
1214 @item form-feed-string=@var{form-feed-value}
1216 The string written to the output to cause a formfeed. See also
1217 @code{paginate}, described below, for a related setting. Default:
1220 @item newline-string=@var{new-line-value}
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
1228 However, @code{newline-string} can be set to any string. When this is
1229 done, the output file is opened in binary mode.
1231 @item paginate=@var{boolean}
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}.
1236 @item tab-width=@var{tab-width-value}
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}.
1241 @item init=@var{initialization-string}.
1243 String written to the device before anything else, at the beginning of
1244 the output. Default: @code{""} (the empty string).
1246 @item done=@var{finalization-string}.
1248 String written to the device after everything else, at the end of the
1249 output. Default: @code{""} (the empty string).
1252 @node ASCII page options, ASCII font options, ASCII output options, ASCII driver class
1253 @subsection ASCII page options
1255 These options affect page setup:
1258 @item headers=@var{boolean}
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}.
1265 @item length=@var{line-count}
1267 Physical length of a page, in lines. Headers and margins are subtracted
1268 from this value. Default: @code{66}.
1270 @item width=@var{character-count}
1272 Physical width of a page, in characters. Margins are subtracted from
1273 this value. Default: @code{130}.
1275 @item lpi=@var{lines-per-inch}
1277 Number of lines per vertical inch. Not currently used. Default: @code{6}.
1279 @item cpi=@var{characters-per-inch}
1281 Number of characters per horizontal inch. Not currently used. Default:
1284 @item left-margin=@var{left-margin-width}
1286 Width of the left margin, in characters. PSPP subtracts this value
1287 from the page width. Default: @code{0}.
1289 @item right-margin=@var{right-margin-width}
1291 Width of the right margin, in characters. PSPP subtracts this value
1292 from the page width. Default: @code{0}.
1294 @item top-margin=@var{top-margin-lines}
1296 Length of the top margin, in lines. PSPP subtracts this value from
1297 the page length. Default: @code{2}.
1299 @item bottom-margin=@var{bottom-margin-lines}
1301 Length of the bottom margin, in lines. PSPP subtracts this value from
1302 the page length. Default: @code{2}.
1306 @node ASCII font options, , ASCII page options, ASCII driver class
1307 @subsection ASCII font options
1309 These are the ASCII font options:
1312 @item box[@var{line-type}]=@var{box-chars}
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.
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
1334 Special device-defined line, if one is available; otherwise, a double
1343 Sets @samp{|} as the character to use for a single-width line with
1344 bottom and top components.
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.
1351 @item box[1100]="\xda"
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.
1363 @code{box[0000]=" "}
1366 @code{box[1000]="-"}
1367 @*@code{box[0010]="-"}
1368 @*@code{box[1010]="-"}
1371 @code{box[0100]="|"}
1372 @*@code{box[0001]="|"}
1373 @*@code{box[0101]="|"}
1376 @code{box[2000]="="}
1377 @*@code{box[0020]="="}
1378 @*@code{box[2020]="="}
1381 @code{box[0200]="#"}
1382 @*@code{box[0002]="#"}
1383 @*@code{box[0202]="#"}
1386 @code{box[3000]="="}
1387 @*@code{box[0030]="="}
1388 @*@code{box[3030]="="}
1391 @code{box[0300]="#"}
1392 @*@code{box[0003]="#"}
1393 @*@code{box[0303]="#"}
1396 For all others, @samp{+} is used unless there are double lines or
1397 special lines, in which case @samp{#} is used.
1400 @item italic-on=@var{italic-on-string}
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}.
1408 @item italic-off=@var{italic-off-string}
1410 Character sequence to turn off italics or underline printing. Default:
1411 @code{""} (the empty string).
1413 @item bold-on=@var{bold-on-string}
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:
1421 @item bold-off=@var{bold-off-string}
1423 Character sequence to turn off bold or emphasized printing. Default:
1424 @code{""} (the empty string).
1426 @item bold-italic-on=@var{bold-italic-on-string}
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:
1435 @item bold-italic-off=@var{bold-italic-off-string}
1437 Character sequence to turn off bold-italic printing. Default: @code{""}
1440 @item overstrike-style=@var{overstrike-option}
1442 Either @code{single} or @code{line}:
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.
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.
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!
1462 @code{line} is recommended for use with printer devices. Most programs
1463 that understand overstriking in text files will not properly deal with
1466 Default: @code{single}.
1468 @item carriage-return-style=@var{carriage-return-type}
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}.
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).
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).
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}.
1489 @node HTML driver class, Miscellaneous configuring, ASCII driver class, Configuration
1490 @section The HTML driver class
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.
1497 There are few options for use with the @code{html} driver class:
1500 @item output-file=@var{filename}
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"}.
1506 @item prologue-file=@var{prologue-file-name}
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}.
1514 * HTML Prologue:: Format of the HTML prologue file.
1517 @node HTML Prologue, , HTML driver class, HTML driver class
1518 @subsection The HTML prologue
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.
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.
1530 The following lines are omitted:
1534 All lines that contain three bangs in a row (@code{!!!}).
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
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.
1547 The following are the variables that are substituted. Only the
1548 variables listed are substituted; environment variables are not.
1549 @xref{Environment substitutions}.
1554 PSPP version as a string: @samp{GNU PSPP 0.1b}, for example.
1558 Date the file was created. Example: @samp{Tue May 21 13:46:22 1991}.
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}.
1568 System hostname as reported by @code{gethostname()}. Defaults to
1573 Document title as a string. This is the title specified in the PSPP
1578 Document subtitle as a string.
1582 PSPP syntax file name. Example: @samp{mary96/first.stat}.
1585 @node Miscellaneous configuring, Improving output quality, HTML driver class, Configuration
1586 @section Miscellaneous configuration
1588 The following environment variables can be used to further configure
1594 Used to determine the user's home directory. No default value.
1596 @item STAT_INCLUDE_PATH
1598 Path used to find include files in PSPP syntax files. Defaults vary
1599 across operating systems:
1609 @file{~/.pspp/include}
1612 @file{/usr/local/lib/pspp/include}
1615 @file{/usr/lib/pspp/include}
1618 @file{/usr/local/share/pspp/include}
1621 @file{/usr/share/pspp/include}
1631 @file{C:\PSPP\INCLUDE}
1643 The terminal type @code{termcap} or @code{ncurses} will use, if such
1644 support was compiled into PSPP.
1646 @item STAT_OUTPUT_INIT_FILE
1648 The basename used to search for the driver definition file.
1649 @xref{Output devices}. @xref{File locations}. Default: @code{devices}.
1651 @item STAT_OUTPUT_PAPERSIZE_FILE
1653 The basename used to search for the papersize file. @xref{papersize}.
1654 @xref{File locations}. Default: @code{papersize}.
1656 @item STAT_OUTPUT_INIT_PATH
1658 The path used to search for the driver definition file and the papersize
1659 file. @xref{File locations}. Default: the standard configuration path.
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.
1670 Under MS-DOS only, these variables are consulted after TMPDIR, in this
1674 @node Improving output quality, , Miscellaneous configuring, Configuration
1675 @section Improving output quality
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
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
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
1699 With the PostScript driver, try these ideas:
1706 Legal-size (8.5" x 14") paper in landscape mode.
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.
1715 Try to strike a balance between character size and page width.
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.
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.
1728 Make sure that you're using good ink/ribbon/toner. Darker print is
1732 Use plain fonts with serifs, such as Times-Roman or Palatino. Avoid
1733 choosing italic or bold fonts as document base fonts.
1735 @setfilename ignored