dvips: Configuration file searching

 
 3.4.1 Configuration file searching
 ----------------------------------
 
 The Dvips program loads many different configuration files, so that
 parameters can be set globally across the system, on a per-device basis,
 or individually by each user.
 
   1. Dvips first reads (if it exists) 'config.ps'; it is searched for
      along the path for Dvips configuration files, as described in ⇒
      (kpathsea)Supported file formats.
 
   2. A user-specific startup file is loaded, so individual users can
      override any options set in the global file.  The environment
      variable 'DVIPSRC', if defined, is used as the specification of the
      startup file.  If this variable is undefined, Dvips uses a
      platform-specific default name.  On Unix Dvips looks for the
      default startup file under the name '$HOME/.dvipsrc', which is in
      the user's home directory.  On MS-DOS and MS-Windows, where users
      generally don't have their private directories, the startup file is
      called 'dvips.ini' and it is searched for along the path for Dvips
      configuration files (as described in ⇒(kpathsea)Supported file
      formats.); users are expected to set this path as they see fit
      for their taste.
 
   3. The command line is read and parsed: if the '-PDEVICE' option is
      encountered, at that point 'config.DEVICE' is loaded.  Thus, the
      printer configuration file can override anything in the site-wide
      or user configuration file, and it can also override options in the
      command line up to the point that the '-P' option was encountered.
      (On MS-DOS, the printer configuration files are called
      'DEVICE.cfg', since DOS doesn't allow more than 3 characters after
      the dot in filenames.)
 
   4. If no '-P' option was specified, and also the '-o' and '-f' command
      line options were not used, Dvips checks the environment variable
      'PRINTER'.  If it exists, then 'config.$PRINTER' ('$PRINTER.cfg' on
      MS-DOS) is loaded (if it exists).
 
    Because the '.dvipsrc' file is read before the printer-specific
 configuration files, individual users cannot override settings in the
 latter.  On the other hand, the 'TEXCONFIG' path can be set to anything,
 so the users can always define their own printer-specific configuration
 files to be found before the system's.
 
    A few command-line options are treated specially, in that they are
 not overridden by configuration files:
 
 '-D'
      As well as setting the resolution, this unsets the mode, if the
      mode was previously set from a configuration file.  If
      'config.$PRINTER' is read, however, any 'D' or 'M' lines from there
      will take effect.
 
 '-mode'
      This overrides any mode setting ('M' line) in configuration files.
      '-mode' does not affect the resolution.
 
 '-o'
      This overrides any output setting ('o' line) in configuration
      files.
 
    The purpose of these special cases is to (1) minimize the chance of
 having a mismatched mode and resolution (which 'mktexpk' cannot
 resolve), and (2) let command-line options override config files where
 possible.