2
$\begingroup$

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.

$\endgroup$
  • $\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$ – Feuermurmel Aug 13 '13 at 8:21
4
$\begingroup$

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.

| improve this answer | |
$\endgroup$
  • $\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 '16 at 18:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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