I can't get any function defined in $UserBaseDirectory/Kernel/init.m to work.
For example:
SinDeg[d_] := Sin[d * Degree]; (* Only line in init.m *)
Output:
SinDeg[90]
(* => SinDeg[90] *)
However when copying the code and executing it inside a Mathematica notebook, it works fine:
SinDeg[d_] := Sin[d * Degree];
SinDeg[90]
(* => 1 *)
The Mathematica front-end can definitely see the function definitions as it displays SinDeg as an autocompletion suggestion, when typing SinD.
I'm using Mathematica 9 Home Edition on OS X.
?SinDegdirectly after Mathematica starts up? – Sjoerd C. de Vries Mar 12 '13 at 00:42Information::notfound: Symbol SinDeg not found. >>– Tyilo Mar 12 '13 at 00:44init.mwas(* ::Package:: *)\n\nSinDeg[d_]:=Sin[d*Degree];, where\nis a newline. – Tyilo Mar 12 '13 at 00:56BeginandEndto create an"Init`"context and append that context to the context path so that the definitions are available regardless of the notebook's context. (better still, use packages) – rm -rf Mar 12 '13 at 01:19Globalfixed it, however I would like to have it set toUnique to This Notebook. Is that possible? – Tyilo Mar 12 '13 at 06:38