I am developing a project where I have a lot of functions and complex tasks rannanble from a single notebook. I would like to use a version control like git, but using it with a single notebook is not ideal, as the notebook increases the size of the project, having a lot of lines changing even without having edited something, plus it's a single file. I tried to save it as .m and then running Import[file.m] or something like that from another notebook, but the m file won't get run when loaded. If I set it as "initialization group" before saving it to .m, then it load succesfully. I wanted to ask if there are other ways to obtain what I want. Note that, I tried several times in the past to convert my notebooks in what are called mathematica packages, but this never seems to work, I think it's because of the context of the variables. My tasks usually get messed up when the notebook is converted into a package. I would prefer just something simper that lets me load the .m file and that's it.
Asked
Active
Viewed 143 times
1
Getwill simply evaluate all Mathematica code present in a plain text file. How you edit or create that plain text file is up to you. You can use Mathematica's editor, or another editor. You can write in it directly, or you can copy and paste from a notebook. – Szabolcs May 18 '20 at 09:48Get. If you want to create a proper package, you must follow certain conventions. However, this is not generally necessary to create a proper package if all you want is to evaluate a bunch of definitions at the same time. For that, simply write the definitions in a text file, ideally use the.mor.wlextesnions (not strictly necessary) and then load it withGet. – Szabolcs May 18 '20 at 09:49