Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to set a setting in the option inspector to a path that is relative to some global Mathematica variable?

I'm trying to set up a default stylesheet by setting DefaultStyleDefinitions to a style sheet located in $UserBaseDirectory/SystemFiles/FrontEnd/StyleSheets. I need the setting to be independent of the path to $UserBaseDirectory because I'm using the same settings on different machines where my user's directory has different names. But setting it to a value containing $UserBaseDirectory didn't work.

share|improve this question
I just found out that I can use a path like "~/Library/Mathematica/SystemFiles/FrontEnd/StyleSheets/My Default.nb" for that setting, which solves my problem as I only need this setting to work on OS X. But I would still be interested in an answer to my question. – Feuermurmel Aug 13 '13 at 8:21
up vote 4 down vote accepted

Mathematica looks for style sheets in the folders specified by StyleSheetPath and this already includes

FrontEnd`FileName[{$UserBaseDirectory, "SystemFiles", "FrontEnd", "StyleSheets"}]

on my system. So just change the setting of DefaultStyleDefinitions to the name of your style sheet.

The setting for StyleSheetPathshows how to construct file names from global variables in a cross-platform manner.

share|improve this answer
Something has changed, now it contains only one path and ParentList, whatever that is, and adding new directories doesn't help to find stylesheets there :-/ – Kuba Feb 12 at 18:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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