1 @node Configuration, Portable File Format, Concept Index, Top
2 @appendix Configuring PSPP
4 @cindex PSPP, configuring
6 This chapter describe how to configure PSPP for your system.
9 * File locations:: How PSPP finds config files.
10 * Configuration techniques:: Many different methods of configuration...
11 * Configuration files:: How configuration files are read.
12 * Environment variables:: All about environment variables.
13 * Output devices:: Describing your terminal(s) and printer(s).
14 * PostScript driver class:: Configuration of PostScript devices.
15 * ASCII driver class:: Configuration of character-code devices.
16 * HTML driver class:: Configuration for HTML output.
17 * Miscellaneous configuring:: Even more configuration variables.
20 @node File locations, Configuration techniques, Configuration, Configuration
21 @section Locating configuration files
23 PSPP searches each directory in the configuration file path for most
24 configuration files. The default configuration file path searches first
25 @file{~/.pspp}, then the package system configuration directory (usually
26 @file{/usr/local/etc/pspp} or @file{/etc/pspp}). The value of
27 environment variable @env{PSPP_CONFIG_PATH}, if defined, overrides this
28 default path. Finally, @samp{-B @var{path}} or
29 @samp{--config-dir=@var{path}} specified on the command line has highest
32 @node Configuration techniques, Configuration files, File locations, Configuration
33 @section Configuration techniques
35 There are many ways that PSPP can be configured. These are
36 described in the list below. Values given by earlier items take
37 precedence over those given by later items.
41 Syntax commands that modify settings, such as @cmd{SET}. @xref{SET}.
44 Command-line options. @xref{Invocation}.
47 PSPP-specific environment variable contents. @xref{Environment
51 General environment variable contents. @xref{Environment variables}.
54 Configuration file contents. @xref{Configuration files}.
60 Some of the above may not apply to a particular setting.
62 @node Configuration files, Environment variables, Configuration techniques, Configuration
63 @section Configuration files
65 Most configuration files have a common form:
69 Each line forms a separate command or directive. This means that lines
70 cannot be broken up, unless they are spliced together with a trailing
71 backslash, as described below.
74 Before anything else is done, trailing white space is removed.
77 When a line ends in a backslash (@samp{\}), the backslash is removed,
78 and the next line is read and appended to the current line.
82 White space preceding the backslash is retained.
85 This rule continues to be applied until the line read does not end in a
89 It is an error if the last line in the file ends in a backslash.
93 Comments are introduced by an octothorpe (@samp{#}), and continue until the
98 An octothorpe inside balanced pairs of double quotation marks (@samp{"})
99 or single quotation marks (@samp{'}) does not introduce a comment.
102 The backslash character can be used inside balanced quotes of either
103 type to escape the following character as a literal character.
105 (This is distinct from the use of a backslash as a line-splicing
109 Line splicing takes place before comment removal.
113 Blank lines, and lines that contain only white space, are ignored.
116 @node Environment variables, Output devices, Configuration files, Configuration
117 @section Environment variables
119 You may think the concept of environment variables is a fairly simple
120 one. However, the author of PSPP has found a way to complicate
121 even something so simple. Environment variables are further described
122 in the sections below:
125 * Environment substitutions:: How environment substitutions are made.
126 * Predefined variables:: A few variables are automatically defined.
129 @node Environment substitutions, Predefined variables, Environment variables, Environment variables
130 @subsection Environment substitutions
132 Much of the power of environment variables lies in the way that they may
133 be substituted into configuration files. Variable substitutions are
136 The line is scanned from left to right. In this scan, all characters
137 other than dollar signs (@samp{$}) are retained without change. Dollar
138 signs introduce environment variable references. References
143 Replaced by the value of environment variable @var{var}. @var{var} must
144 consist of either one or more letters, or exactly one non-alphabetic
145 character other than a left brace (@samp{@{}).
148 Same as above, but @var{var} may contain any character (except
152 Replaced by a single dollar sign.
155 Undefined variables expand to a empty value.
157 @node Predefined variables, , Environment substitutions, Environment variables
158 @subsection Predefined environment variables
160 There are two environment variables predefined for use in environment
165 Defined as the version number of PSPP, as a string, in a format
166 something like @samp{0.9.4}.
169 Defined as the host architecture of PSPP, as a string, in standard
170 cpu-manufacturer-OS format. For instance, Debian GNU/Linux 1.1 on an
171 Intel machine defines this as @samp{i586-unknown-linux}. This is
172 somewhat dependent on the system used to compile PSPP.
175 Nothing prevents these values from being overridden, although it's a
176 good idea not to do so.
178 @node Output devices, PostScript driver class, Environment variables, Configuration
179 @section Output devices
181 Configuring output devices is the most complicated aspect of configuring
182 PSPP. The output device configuration file is named
183 @file{devices}. It is searched for using the usual algorithm for
184 finding configuration files (@pxref{File locations}). Each line in the
185 file is read in the usual manner for configuration files
186 (@pxref{Configuration files}).
188 Lines in @file{devices} are divided into three categories, described
189 briefly in the table below:
192 @item driver category definitions
193 Define a driver in terms of other drivers.
195 @item macro definitions
196 Define environment variables local to the the output driver
199 @item device definitions
200 Describe the configuration of an output device.
203 The following sections further elaborate the contents of the
207 * Driver categories:: How to organize the driver namespace.
208 * Macro definitions:: Environment variables local to @file{devices}.
209 * Device definitions:: Output device descriptions.
210 * Dimensions:: Lengths, widths, sizes, @enddots{}
211 * papersize:: Letter, legal, A4, envelope, @enddots{}
212 * Distinguishing line types:: Details on @file{devices} parsing.
213 * Tokenizing lines:: Dividing @file{devices} lines into tokens.
216 @node Driver categories, Macro definitions, Output devices, Output devices
217 @subsection Driver categories
219 Drivers can be divided into categories. Drivers are specified by their
220 names, or by the names of the categories that they are contained in.
221 Only certain drivers are enabled each time PSPP is run; by
222 default, these are the drivers in the category `default'. To enable a
223 different set of drivers, use the @samp{-o @var{device}} command-line
224 option (@pxref{Invocation}).
226 Categories are specified with a line of the form
227 @samp{@var{category}=@var{driver1} @var{driver2} @var{driver3} @var{@dots{}}
228 @var{driver@var{n}}}. This line specifies that the category
229 @var{category} is composed of drivers named @var{driver1},
230 @var{driver2}, and so on. There may be any number of drivers in the
231 category, from zero on up.
233 Categories may also be specified on the command line
234 (@pxref{Invocation}).
236 This is all you need to know about categories. If you're still curious,
239 First of all, the term `categories' is a bit of a misnomer. In fact,
240 the internal representation is nothing like the hierarchy that the term
241 seems to imply: a linear list is used to keep track of the enabled
244 When PSPP first begins reading @file{devices}, this list contains
245 the name of any drivers or categories specified on the command line, or
246 the single item `default' if none were specified.
248 Each time a category definition is specified, the list is searched for
249 an item with the value of @var{category}. If a matching item is found,
250 it is deleted. If there was a match, the list of drivers (@var{driver1}
251 through @var{driver@var{n}}) is then appended to the list.
253 Each time a driver definition line is encountered, the list is searched.
254 If the list contains an item with that driver's name, the driver is
255 enabled and the item is deleted from the list. Otherwise, the driver
258 It is an error if the list is not empty when the end of @file{devices}
261 @node Macro definitions, Device definitions, Driver categories, Output devices
262 @subsection Macro definitions
264 Macro definitions take the form @samp{define @var{macroname}
265 @var{definition}}. In such a macro definition, the environment variable
266 @var{macroname} is defined to expand to the value @var{definition}.
267 Before the definition is made, however, any macros used in
268 @var{definition} are expanded.
270 Please note the following nuances of macro usage:
274 For the purposes of this section, @dfn{macro} and @dfn{environment
275 variable} are synonyms.
278 Macros may not take arguments.
281 Macros may not recurse.
284 Macros are just environment variable definitions like other environment
285 variable definitions, with the exception that they are limited in scope
286 to the @file{devices} configuration file.
289 Macros override other all environment variables of the same name (within
290 the scope of @file{devices}).
293 Earlier macro definitions for a particular @var{key} override later
294 ones. In particular, macro definitions on the command line override
295 those in the device definition file. @xref{Non-option Arguments}.
298 There are two predefined macros, whose values are determined at runtime:
302 Defined as the width of the console screen, in columns of text.
305 Defined as the length of the console screen, in lines of text.
309 @node Device definitions, Dimensions, Macro definitions, Output devices
310 @subsection Driver definitions
312 Driver definitions are the ultimate purpose of the @file{devices}
313 configuration file. These are where the real action is. Driver
314 definitions tell PSPP where it should send its output.
316 Each driver definition line is divided into four fields. These fields
317 are delimited by colons (@samp{:}). Each line is subjected to
318 environment variable interpolation before it is processed further
319 (@pxref{Environment substitutions}). From left to right, the four
320 fields are, in brief:
324 A unique identifier, used to determine whether to enable the driver.
327 One of the predefined driver classes supported by PSPP. The
328 currently supported driver classes include `postscript' and `ascii'.
331 Zero or more of the following keywords, delimited by spaces:
336 Indicates that the device is a screen display. This may reduce the
337 amount of buffering done by the driver, to make interactive use more
342 Indicates that the device is a printer.
346 Indicates that the device is a listing file.
349 These options are just hints to PSPP and do not cause the output to be
350 directed to the screen, or to the printer, or to a listing file---those
351 must be set elsewhere in the options. They are used primarily to decide
352 which devices should be enabled at any given time. @xref{SET}, for more
356 An optional set of options to pass to the driver itself. The exact
357 format for the options varies among drivers.
360 The driver is enabled if:
364 Its driver name is specified on the command line, or
367 It's in a category specified on the command line, or
370 If no categories or driver names are specified on the command line, it
371 is in category @code{default}.
374 For more information on driver names, see @ref{Driver categories}.
376 The class name must be one of those supported by PSPP. The
377 classes supported depend on the options with which PSPP was
378 compiled. See later sections in this chapter for descriptions of the
379 available driver classes.
381 Options are dependent on the driver. See the driver descriptions for
384 @node Dimensions, papersize, Device definitions, Output devices
385 @subsection Dimensions
387 Quite often in configuration it is necessary to specify a length or a
388 size. PSPP uses a common syntax for all such, calling them
389 collectively by the name @dfn{dimensions}.
393 You can specify dimensions in decimal form (@samp{12.5}) or as
394 fractions, either as mixed numbers (@samp{12-1/2}) or raw fractions
398 A number of different units are available. These are suffixed to the
399 numeric part of the dimension. There must be no spaces between the
400 number and the unit. The available units are identical to those offered
401 by the popular typesetting system @TeX{}:
405 inch (1 @code{in} = 2.54 @code{cm})
408 inch (1 @code{in} = 2.54 @code{cm})
411 printer's point (1 @code{in} = 72.27 @code{pt})
414 pica (12 @code{pt} = 1 @code{pc})
417 PostScript point (1 @code{in} = 72 @code{bp})
423 millimeter (10 @code{mm} = 1 @code{cm})
426 didot point (1157 @code{dd} = 1238 @code{pt})
429 cicero (1 @code{cc} = 12 @code{dd})
432 scaled point (65536 @code{sp} = 1 @code{pt})
436 If no explicit unit is given, PSPP attempts to guess the best unit:
440 Numbers less than 50 are assumed to be in inches.
443 Numbers 50 or greater are assumed to be in millimeters.
447 @node papersize, Distinguishing line types, Dimensions, Output devices
448 @subsection Paper sizes
450 Output drivers usually deal with some sort of hardcopy media. This
451 media is called @dfn{paper} by the drivers, though in reality it could
452 be a transparency or film or thinly veiled sarcasm. To make it easier
453 for you to deal with paper, PSPP allows you to have (of course!) a
454 configuration file that gives symbolic names, like ``letter'' or
455 ``legal'' or ``a4'', to paper sizes, rather than forcing you to use
456 cryptic numbers like ``8-1/2 x 11'' or ``210 by 297''. Surprisingly
457 enough, this configuration file is named @file{papersize}.
458 @xref{Configuration files}.
460 When PSPP tries to connect a symbolic paper name to a paper size, it
461 reads and parses each non-comment line in the file, in order. The first
462 field on each line must be a symbolic paper name in double quotes.
463 Paper names may not contain double quotes. Paper names are not
464 case-sensitive: @samp{legal} and @samp{Legal} are equivalent.
466 If a match is found for the paper name, the rest of the line is parsed.
467 If it is found to be a pair of dimensions (@pxref{Dimensions}) separated
468 by either @samp{x} or @samp{by}, then those are taken to be the paper
469 size, in order of width followed by length. There @emph{must} be at
470 least one space on each side of @samp{x} or @samp{by}.
472 Otherwise the line must be of the form
473 @samp{"@var{paper-1}"="@var{paper-2}"}. In this case the target of the
474 search becomes paper name @var{paper-2} and the search through the file
477 @node Distinguishing line types, Tokenizing lines, papersize, Output devices
478 @subsection How lines are divided into types
480 The lines in @file{devices} are distinguished in the following manner:
484 Leading white space is removed.
487 If the resulting line begins with the exact string @code{define},
488 followed by one or more white space characters, the line is processed as
492 Otherwise, the line is scanned for the first instance of a colon
493 (@samp{:}) or an equals sign (@samp{=}).
496 If a colon is encountered first, the line is processed as a driver
500 Otherwise, if an equals sign is encountered, the line is processed as a
504 Otherwise, the line is ill-formed.
507 @node Tokenizing lines, , Distinguishing line types, Output devices
508 @subsection How lines are divided into tokens
510 Each driver definition line is run through a simple tokenizer. This
511 tokenizer recognizes two basic types of tokens.
513 The first type is an equals sign (@samp{=}). Equals signs are both
514 delimiters between tokens and tokens in themselves.
516 The second type is an identifier or string token. Identifiers and
517 strings are equivalent after tokenization, though they are written
518 differently. An identifier is any string of characters other than
519 white space or equals sign.
521 A string is introduced by a single- or double-quote character (@samp{'}
522 or @samp{"}) and, in general, continues until the next occurrence of
523 that same character. The following standard C escapes can also be
524 embedded within strings:
528 A single-quote (@samp{'}).
531 A double-quote (@samp{"}).
534 A question mark (@samp{?}). Included for hysterical raisins.
537 A backslash (@samp{\}).
540 Audio bell (ASCII 7).
552 Carriage return (ASCII 13).
558 Vertical tab (ASCII 11).
560 @item \@var{o}@var{o}@var{o}
561 Each @samp{o} must be an octal digit. The character is the one having
562 the octal value specified. Any number of octal digits is read and
563 interpreted; only the lower 8 bits are used.
565 @item \x@var{h}@var{h}
566 Each @samp{h} must be a hex digit. The character is the one having the
567 hexadecimal value specified. Any number of hex digits is read and
568 interpreted; only the lower 8 bits are used.
571 Tokens, outside of quoted strings, are delimited by white space or equals
574 @node PostScript driver class, ASCII driver class, Output devices, Configuration
575 @section The PostScript driver class
577 The @code{postscript} driver class is used to produce output that is
578 acceptable to PostScript printers and other interpreters.
580 The available options are listed below.
583 @item output-file=@var{file-name}
585 File to which output should be sent. This can be an ordinary file name
586 (i.e., @code{"pspp.ps"}), a pipe (i.e., @code{"|lpr"}), or
587 stdout (@code{"-"}). Default: @code{"pspp.ps"}.
589 @item headers=@var{boolean}
591 Controls whether the standard headers showing the time and date and
592 title and subtitle are printed at the top of each page. Default:
595 @item paper-size=@var{paper-size}
597 Paper size, either as a symbolic name (i.e., @code{letter} or @code{a4})
598 or specific measurements (i.e., @code{8-1/2x11} or @code{"210 x 297"}.
599 @xref{papersize, , Paper sizes}. Default: @code{letter}.
601 @item orientation=@var{orientation}
603 Either @code{portrait} or @code{landscape}. Default: @code{portrait}.
605 @item left-margin=@var{dimension}
606 @itemx right-margin=@var{dimension}
607 @itemx top-margin=@var{dimension}
608 @itemx bottom-margin=@var{dimension}
610 Sets the margins around the page. The headers, if enabled, are not
611 included in the margins; they are in addition to the margins. For a
612 description of dimensions, see @ref{Dimensions}. Default: @code{0.5in}.
614 @item prop-font=@var{afm-file}[,@var{font-file}[,@var{encoding-file}]]
615 @itemx emph-font=@var{afm-file}[,@var{font-file}[,@var{encoding-file}]]
616 @itemx fixed-font=@var{afm-file}[,@var{font-file}[,@var{encoding-file}]]
618 Sets the font used for proportional, emphasized, or fixed-pitch text.
619 The only required value is @var{afm-file}, the AFM file for the font.
621 If specified, @var{font-file} will be downloaded to the printer at the
622 beginning of the print job. The font file may be in PFA or PFB format.
624 The font is reencoded as specified in @var{encoding-file}, if specified.
625 Each line in @var{encoding-file} should consist of a PostScript
626 character name and a decimal encoding value (between 0 and 255),
627 separated by white space. Blank lines and comments introduced by
628 @samp{#} are also allowed.
630 The files specified on these options are located as follows. If
631 the file name begins with @samp{/}, then it is taken as an absolute
632 path. Otherwise, PSPP searches its configuration path for the specified
633 name prefixed by @code{psfonts/} (@pxref{File locations}).
635 Default: proportional font @code{Times-Roman.afm}, emphasis font
636 @code{Times-Italic.afm}, fixed-pitch font @code{Courier.afm}.
638 @item font-size=@var{font-size}
640 Sets the size of the default fonts, in thousandths of a point. Default:
643 @item line-gutter=@var{dimension}
645 Sets the width of white space on either side of lines that border text
646 or graphics objects. @xref{Dimensions}. Default: @code{1pt}.
648 @item line-spacing=@var{dimension}
650 Sets the spacing between the lines in a double line in a table.
653 @item line-width=@var{dimension}
655 Sets the width of the lines used in tables. Default: @code{0.5pt}.
658 @node ASCII driver class, HTML driver class, PostScript driver class, Configuration
659 @section The ASCII driver class
661 The ASCII driver class produces output that can be displayed on a
662 terminal or output to printers. The ASCII driver has class name
665 The available options are listed below.
668 @item output-file=@var{file-name}
670 File to which output should be sent. This can be an ordinary file name
671 (e.g., @code{"pspp.txt"}), a pipe (e.g., @code{"|lpr"}), or
672 stdout (@code{"-"}). Default: @code{"pspp.list"}.
674 @item paginate=@var{boolean}
676 If set, a formfeed will be written at the end of every page. Default:
679 @item tab-width=@var{tab-width-value}
681 The distance between tab stops for this device. If set to 0, tabs will
682 not be used in the output. Default: @code{8}.
684 @item headers=@var{boolean}
686 If enabled, two lines of header information giving title and subtitle,
687 page number, date and time, and PSPP version are printed at the top of
688 every page. These two lines are in addition to any top margin
689 requested. Default: @code{on}.
691 @item length=@var{line-count}
693 Physical length of a page, in lines. Headers and margins are subtracted
694 from this value. Default: @code{66}.
696 @item width=@var{character-count}
698 Physical width of a page, in characters. Margins are subtracted from
699 this value. Default: @code{130}.
701 @item top-margin=@var{top-margin-lines}
703 Length of the top margin, in lines. PSPP subtracts this value from
704 the page length. Default: @code{2}.
706 @item bottom-margin=@var{bottom-margin-lines}
708 Length of the bottom margin, in lines. PSPP subtracts this value from
709 the page length. Default: @code{2}.
711 @item box[@var{line-type}]=@var{box-chars}
713 The characters used for lines in tables produced by the ASCII driver can
714 be changed using this option. @var{line-type} is used to indicate which
715 type of line to change; @var{box-chars} is the character or string of
716 characters to use for this type of line.
718 @var{line-type} must be a 4-digit number. The digits are in the order
719 `right', `bottom', `left', `top'. The possibilities for each digit are:
737 Sets @samp{|} as the character to use for a single-width line with
738 bottom and top components.
742 Sets @samp{#} as the character to use for the intersection of four
743 double-width lines, one each from the top, bottom, left and right.
745 @item box[1100]="\xda"
747 Sets @samp{"\xda"}, which under MS-DOS is a box character suitable for
748 the top-left corner of a box, as the character for the intersection of
749 two single-width lines, one each from the right and bottom.
761 @*@code{box[0010]="-"}
762 @*@code{box[1010]="-"}
766 @*@code{box[0001]="|"}
767 @*@code{box[0101]="|"}
771 @*@code{box[0020]="="}
772 @*@code{box[2020]="="}
776 @*@code{box[0030]="="}
777 @*@code{box[3030]="="}
780 For all others, @samp{+} is used unless there are double lines or
781 special lines, in which case @samp{#} is used.
784 @item emphasis=@var{emphasis-style}
786 How to emphasize text. Your choices are @code{bold}, @code{underline},
787 or @code{none}. Bold and underline emphasis are achieved with
788 overstriking, which may not be supported by all the software to which
789 you might pass the output.
792 @node HTML driver class, Miscellaneous configuring, ASCII driver class, Configuration
793 @section The HTML driver class
795 The @code{html} driver class is used to produce output for viewing in
796 tables-capable web browsers such as Emacs' w3-mode. Its configuration
797 is very simple. Currently, the output has a very plain format. In the
798 future, further work may be done on improving the output appearance.
800 There are only a few options:
803 @item output-file=@var{file-name}
805 File to which output should be sent. This can be an ordinary file name
806 (i.e., @code{"pspp.ps"}), a pipe (i.e., @code{"|lpr"}), or
807 stdout (@code{"-"}). Default: @file{"pspp.html"}.
809 @item chart-files=@var{file-name-template}
810 Template for the file names used for charts, which are output in PNG
811 format. The name should contain a single @samp{#}, which is replaced by
812 the chart number. Default: @file{"pspp-#.png"}.
815 @node Miscellaneous configuring,, HTML driver class, Configuration
816 @section Miscellaneous configuration
818 The following environment variables can be used to further configure
824 Used to determine the user's home directory. No default value.
826 @item STAT_INCLUDE_PATH
828 Path used to find include files in PSPP syntax files. Defaults vary
829 across operating systems:
839 @file{~/.pspp/include}
842 @file{/usr/local/lib/pspp/include}
845 @file{/usr/lib/pspp/include}
848 @file{/usr/local/share/pspp/include}
851 @file{/usr/share/pspp/include}
861 @file{C:\PSPP\INCLUDE}
873 The terminal type @code{termcap} or @code{ncurses} will use, if such
874 support was compiled into PSPP.
876 @item STAT_OUTPUT_INIT_FILE
878 The basename used to search for the driver definition file.
879 @xref{Output devices}. @xref{File locations}. Default: @code{devices}.
881 @item STAT_OUTPUT_PAPERSIZE_FILE
883 The basename used to search for the papersize file. @xref{papersize}.
884 @xref{File locations}. Default: @code{papersize}.
886 @item STAT_OUTPUT_INIT_PATH
888 The path used to search for the driver definition file and the papersize
889 file. @xref{File locations}. Default: the standard configuration path.
893 The directory in which PSPP stores its temporary files (used when sorting
894 cases or concatenating large numbers of cases).
895 Default: (UNIX) @file{/tmp}, (MS-DOS) @file{\}, (other OSes) empty string.
900 Under MS-DOS only, these variables are consulted after TMPDIR, in this