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

I'd like to make some features of my notebooks responsive to some properties of styles in the active stylesheet. Is there a way to do this? I can't seem to get anything out of StyleData. What I'm looking for is something of the form

StyleData["SomeStyle", "FontName"]
StyleData["SomeStyle", "FontSize"]


Are there functions or settings I can use to programmatically get information about properties of a style?

share|improve this question
Open the stylesheet (possibly Default.nb). If necessary, choose a style from the "Choose a style" drop-down menu. Select the now-displayed cell named after that style. Now use the Option Inspector, either browsing for what you want in the outline hierarchy or else by using the Search box in the Option Inspector. – murray Nov 13 '12 at 21:59
@murray: How can I do that in code? (See edit.) – raxacoricofallapatorius Nov 13 '12 at 22:08
up vote 7 down vote accepted

You need

 CurrentValue[{StyleDefinitions, stylename}]


 CurrentValue[{StyleDefinitions, "Section"}]

enter image description here

 CurrentValue[{StyleDefinitions, "Section", "CellFrame"}]
 (* {{0, 0}, {0, 1}} *)
 CurrentValue[{StyleDefinitions, "Subsection", "FontFamily"}]
 (* "Helvetica" *)
 CurrentValue[{StyleDefinitions, "Graphics", "CapForm"}]
 (* "Square" *)


share|improve this answer
Hey, do you know how to get the info for a particular screen environment such as printout? – Rojo Feb 16 '13 at 22:24
It seems a particular option you can get with CurrentValue[notebook, {StyleDefinitions, "style/Printout", theOption}], but I still haven't found how to get the whole list – Rojo Feb 16 '13 at 22:31
Hi @Rojo, i don't know how to get the definitions for combo styles. I would expect/wish that using the stylenames (like "Section/SlideShow" or StyleData["Section", "SlideShow"]) would work; but it doesn't (ver 9 on windows vista). And, the option values returned by CurrentValue[notebook, {StyleDefinitions, "style/Printout", theOption}] do not match the defined/inherited values of these options based on the definitions in Default.nb. For example, CurrentValue[{StyleDefinitions, "Section/xx", "FontSize"}] gives 14 for xx in {"PrintOut","Condensed","Working","SlideShow"}. – kglr Feb 17 '13 at 1:07
That's sad. Thanks! – Rojo Feb 17 '13 at 6:51
It is possible to use CurrentValue to get some property of a style of the same stylesheet I'm defining? I.e. if I want to use the same FontColor many times and I don't want to write it explicitely all times? I tried but I get a wrong color... Thanks – unlikely Mar 4 at 16:59

(Very incomplete answer!)

Open the style sheet, e.g.:

nb = NotebookOpen[

Find what you want, e.g., style for Section:

NotebookFind[nb, "Styles for Title and Section Cells"]
NotebookFind[nb, "Section"]
SelectionMove[nb, Next, Cell]

Read it:

properties = NotebookRead[nb]

Of course to use my method, you already need to know in detail the structure of the style sheet.

share|improve this answer

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.