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.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.