Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Possible Duplicate:
Relative paths for portable notebooks in Mathematica

I have a deep subdirectory structure, and the calculations should always be done in one of the deepest subdirectories. Instead of clicking through it using the SetDirectory command, is it possible to predefine somehow at the very first beginning of the notebook the second deepest subdirectory as a working directory, so that I can choose with SetDirectory just one of the deepest subdirectories?

share|improve this question
add comment

marked as duplicate by rm -rf, whuber, F'x, Sjoerd C. de Vries Aug 26 '12 at 21:24

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

I think you can do this by setting global options:

Navigate to Format >> OptionInspector select Global Preferences and set NotebookBrowseDirectory and NotebookPath

enter image description here

share|improve this answer
    
Hi Jagra, thanks a lot, this would be possible. But, to be more flexible, I would not prefer to change some global settings... –  Harald Jul 27 '12 at 15:49
    
I do the following: inside the directory I would like to be a working directory, create a blank mathematica notebook, and in your .bashrc or .profile, define a global variable that stores the path to the notebook. From the command line, just type mathematica $pathname/notebookname.nb & and you will have mathematica launch in the correct working directory. You can then populate the notebook. I have tested this in Unix and OS X, and I think something similar might work on Windows. The disadvantage is that this is OS based(and requires you to modify your bashrc)--breaks across machines. –  Y.P. Jul 27 '12 at 18:06
add comment

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