5

I would like to set the system of units ($UnitSystem) permanently to "Metric".

I know that I can do

$UnitSystem = "Metric"

Or use the option UnitSystem -> "Metric", but I would like that change to be permanent and be there when the next session is started.

SetOptions[$FrontEnd, UnitSystem -> "Metric"]

Does not solve the problem (and by the way now I have a meaningless permanent option for $FrontEnd that I don't know how to remove).

rhermans
  • 36,518
  • 4
  • 57
  • 149

1 Answers1

4

I'm on "10.0 for Mac OS X x86 (64-bit) (December 4, 2014)", but the action should not differ for other systems substantially. Nevertheless, a backup is indicated with every system manipulation.

Find the default unit system:

$UnitSystem

Imperial

The base directory in which user-specific files are placed:

$UserBaseDirectory
/Users/xxxx/Library/Mathematica

And the files within this Directory:

FileNames["*", "/Users/xxxx/Library/Mathematica"] // Column
{
 {"/Users/xxxx/Library/Mathematica/ApplicationData"},
 {"/Users/xxxx/Library/Mathematica/Applications"},
 {"/Users/xxxx/Library/Mathematica/Autoload"},
 {"/Users/xxxx/Library/Mathematica/FrontEnd"},
 {"/Users/xxxx/Library/Mathematica/Kernel"},
 {"/Users/xxxx/Library/Mathematica/Licensing"},
 {"/Users/xxxx/Library/Mathematica/Logs"},
 {"/Users/xxxx/Library/Mathematica/Paclets"},
 {"/Users/xxxx/Library/Mathematica/SystemFiles"}
}

Find all init.mwithiun this Directory:

initFiles = FileNames["init.m", $UserBaseDirectory, Infinity]
{"/Users/xxxx/Library/Mathematica/Applications/WSMLink/Kernel/init.\
m", "/Users/xxxx/Library/Mathematica/FrontEnd/init.m", \
"/Users/xxxx/Library/Mathematica/Kernel/init.m"}

Your User Mathematica initialization file

FilePrint@Last@initFiles

Will show in the same *.nb the following:

(** User Mathematica initialization file **)

$UnitSystem = "Metric"

What to do:

  1. Locate your Kernel/init.m file
  2. Open the init.m file with a text editor
  3. Add statement an save the file

Restart MMA and check.