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.

  • $\begingroup$ 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. $\endgroup$ Aug 13, 2013 at 8:21

1 Answer 1


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.

  • $\begingroup$ 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 :-/ $\endgroup$
    – Kuba
    Feb 12, 2016 at 18:50

Your Answer

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

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