4
$\begingroup$

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).

$\endgroup$
2
  • 3
    $\begingroup$ Why not put that in init.m? $\endgroup$ Jun 8, 2016 at 13:43
  • 2
    $\begingroup$ Why go against the flow - imperial units are bound to make a comeback. This metric thing is just a fad :-) $\endgroup$
    – Jason B.
    Sep 16, 2016 at 1:21

1 Answer 1

4
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.