This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Documentation / Mathematica / The Mathematica Book / Mathematica Reference Guide / Mathematica File Organization /

A.8.2 Loadable Files

You can customize your Mathematica by adding files that can loaded into the system under different circumstances. Such files are conventionally placed in either system-wide or user-specific base directories.

Base directories for files to be loaded by Mathematica.

Typical values of $BaseDirectory.

Typical values of $UserBaseDirectory.

You can specify different locations for these directories by setting operating system environment variables when you launch Mathematica, as discussed in Section A.7.1.

Typical subdirectories of Mathematica base directories.

Some files in base directories serve as configuration files, automatically used by the Mathematica kernel or front end.

Some typical kernel and front end configuration files.

Kernel configuration files can contain any Mathematica commands. These commands can test global variables such as $SystemID and $MachineName to determine what operations to perform. Front end configuration files can contain only certain special commands, as described in Section A.2.12.

Subdirectories under $BaseDirectory and $UserBaseDirectory.

With the default setting for the kernel $Path variable, an add-on can be loaded from within a Mathematica session simply by using the command <<name`. This will load the init.m file for the add-on, which should in turn be set up to load other necessary files or packages.

By placing an add-on under the Autoload subdirectory of $BaseDirectory or $UserBaseDirectory, you can have Mathematica automatically load the add-on whenever you start the kernel or the front end.

Typical possible contents of the directory for an add-on.

Note that with the default setting for the front end documentation path, all documentation in Documentation directories will automatically show up in the front end Help Browser.