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.

This question came to mind because of this answer to a recent question.

Under Style, the Mathematica Documentation Center says the following about named styles.

A few common named styles include: "Button", "Graphics", ..., "Title"

Altogether it lists 13 named styles, but the phrase "a few of" implies there are more. Other cell styles such as "SubTitle" and "SubSubSection" come to mind. But strings other than those naming cell styles evidently qualify as named styles. In the referenced answer, Mr.Wizard uses "TI" as a named style for the "Times Italic" font.

Style["The quick brown fox ...", "TI"]

TI.png

By trial and error, I have found these addition named styles:

"TR"   (Times Roman -- plain Times)
"TB"   (Times Bold)
"TBI"  (Times Bold Italic)
"SR"   (Sans serif Roman -- plain sans serif)
"SB"   (Sans serif Bold)
"SO"   (Sans serif Oblique)
"SBO"  (Sans serif Bold Oblique)

I wonder what other named styles exist, other than cell styles, that Mathematica will accept in a Style expression. I further wonder what sort of spelunking in Mathematica would turn them up.

share|improve this question
    
    
As per @MichaelE2 link the available built-in style names are specified in the default and the core stylesheets. –  Mike Honeychurch Jul 31 '13 at 2:34
    
@MichaelE2. That link seems to answe my first question. Thanks. –  m_goldberg Jul 31 '13 at 2:55
    
Note that the function used no longer works (V8 and later, at least). –  Michael E2 Jul 31 '13 at 2:59
    
@m_goldberg,Dear m_goldberg,I am a Chinese undergraduate student,I want to practice writing English,so I wonder if I can know your Email Address and can you help me to revise my English Writing.Thanks sincerely! –  ShutaoTang Nov 26 '13 at 14:30

1 Answer 1

up vote 15 down vote accepted
nb2 = NotebookOpen[$InstallationDirectory <> $PathnameSeparator <> 
   "SystemFiles" <> $PathnameSeparator <> 
       "FrontEnd" <> $PathnameSeparator <> 
   "StyleSheets" <> $PathnameSeparator <> "Core.nb"];

Note that some of the named styles in the core stylesheet styles are empty, i.e. the style name is defined but no styles set:

Cell[StyleData["style"]]

For example (with V8):

Union[Cases[NotebookGet[nb2],StyleData[x_, ___] :> x, \[Infinity]]] // Length   
(* 526 *)

Union[Cases[NotebookGet[nb2],Cell[StyleData[x_, ___], __] :> x, \[Infinity]]] // Length    
(* 477 *)

Those style names with some style settings defined are (note the repeated All at the start of the output list due to the style environment names. You can modify if you wanted to use this programmatically in some way):

styles=Union[Cases[NotebookGet[nb2], Cell[StyleData[x_,___], __] :> x, \[Infinity]]]

(* {"Abs", "ActionMenu", "ActionMenuLabel", "AddOnsLink", \
"AddOnsLinkText", "AiryAi", "AiryAiPrime", "AiryBi", "AiryBiPrime", \
"AngerJ", "AngerJ2", "AppellF1", "ArithmeticGeometricMean", "Assert", \
"AugmentedSymmetricPolynomial", "AugmentedSymmetricPolynomialList", \
"BarnesG", "BellB", "BellB2", "BernoulliB", "BernoulliB2", \
"BernsteinBasis", "BesselI", "BesselJ", "BesselJZero", "BesselK", \
"BesselY", "BesselYZero", "Beta", "Beta3", "Beta4", \
"BetaRegularized", "BetaRegularized4", "BF", "Binomial", "Bra", \
"BraKet", "BSplineBasis", "BSplineBasis3", "BSplineBasis4", "Button", \
"CalculateInput", "CalculatePrompt", "CardinalBSplineBasis", \
"CarmichaelLambda", "CatalanNumber", "Ceiling", "CellExpression", \
"CellInsertionMenu", "CellInsertionMenuShortcut", "CellLabel", \
"CentralMoment", "CentralMomentList", "ChampernowneNumber", \
"Citation", "Code", "Column", "CompatibilityControls", \
"CompatibilityDocked1", "CompatibilityDocked2", "CompatibilityInput", \
"CompatibilityInputTop", "CompatibilityText", "CompatibilityTextTop", \
"ConditionedIntegrate", "ConditionedLimit", "ConditionedList", \
"ConditionedListWithAttributes", "ConditionedMax", "ConditionedMin", \
"ConditionedProduct", "ConditionedSet", \
"ConditionedSetWithAttributes", "ConditionedSum", "Conjugate", \
"ConjugateTranspose", "ControlStyle", "CoordinateTooltipLabel", \
"CopyEvaluate", "CopyEvaluateCell", "CoshIntegral", "CosIntegral", \
"Cumulant", "CumulantList", "Cyclotomic", "DawsonF", "DedekindEta", \
"DemosLink", "Deploy", "Det", "DialogStyle", "DialogText", \
"DifferenceDelta2", "DifferenceDelta3", "DifferenceDelta4", \
"DiracDeltaSeq", "DirichletCharacter", "DirichletL", \
"DiscreteDeltaSeq", "DiscreteRatio2", "DiscreteRatio3", \
"DiscreteRatio4", "DiscreteShift2", "DiscreteShift3", \
"DiscreteShift4", "DivisorSigma", "DockedCell", "DockedTitleCell", \
"DomainIntegrate", "DomainProduct", "DomainSum", "EllipticE", \
"EllipticE2", "EllipticF", "EllipticK", "EllipticNomeQ", \
"EllipticPi", "EllipticPi3", "EllipticTheta", "EllipticThetaPrime", \
"EulerE", "EulerE2", "EulerPhi", "Evaluate", "EvaluateCell", \
"EvaluationMarker", "ExpIntegralE", "ExpIntegralEi", \
"FactorialMoment", "FactorialMomentList", "FactorialPower", \
"FactorialPower3", "Fibonacci", "Fibonacci2", "FieldHintStyle", \
"Floor", "Footer", "FooterSection", "FooterSubsection", \
"FooterTitle", "FrameLabel", "FresnelC", "FresnelS", \
"FunctionTemplate", "FunctionTemplateArgument", \
"FunctionTemplateHighlight", "Gamma", "Gamma2", "Gamma3", \
"GammaRegularized", "GammaRegularized3", "GeneralizedPlaceholder", \
"GenericButton", "GenericLink", "GettingStartedLink", "Graphics", \
"Graphics3D", "Grid", "Gudermannian", "HankelH1", "HankelH2", \
"HarmonicNumber", "HarmonicNumber2", "Haversine", "Header", \
"HeaderSection", "HeaderSubsection", "HeaderTitle", \
"HeavisideLambdaSeq", "HeavisidePiSeq", "HeavisideThetaSeq", \
"HideContentsInPrint", "HistoryCurrentPage", "HurwitzLerchPhi", \
"HurwitzZeta", "Hypergeometric0F1", "Hypergeometric0F1Regularized", \
"Hypergeometric1F1", "Hypergeometric1F1Regularized", \
"Hypergeometric2F1", "Hypergeometric2F1Regularized", \
"HypergeometricU", "Hyperlink", "HyperlinkActive", "ImageGraphics", \
"Inert", "InfoCell", "InfoGrid", "InfoHeading", "InformationCell", \
"InformationLink", "InformationLinkLF", "InlineCell", \
"InlineCellEditing", "InlineOutput", "Input", "InputField", \
"InputForm", "InputOnly", "InsetString", "IntervalClosed", \
"IntervalClosedOpen", "IntervalOpen", "IntervalOpenClosed", \
"Inverse", "InverseBetaRegularized", "InverseBetaRegularized4", \
"InverseEllipticNomeQ", "InverseGammaRegularized", \
"InverseGammaRegularized3", "InverseGudermannian", \
"InverseHaversine", "InverseJacobiCD", "InverseJacobiCN", \
"InverseJacobiCS", "InverseJacobiDC", "InverseJacobiDN", \
"InverseJacobiDS", "InverseJacobiNC", "InverseJacobiND", \
"InverseJacobiNS", "InverseJacobiSC", "InverseJacobiSD", \
"InverseJacobiSN", "InverseWeierstrassP", "InverseWeierstrassP4", \
"IT", "ItemizedPicture", "JacobiAmplitude", "JacobiCD", "JacobiCN", \
"JacobiCS", "JacobiDC", "JacobiDN", "JacobiDS", "JacobiNC", \
"JacobiND", "JacobiNS", "JacobiSC", "JacobiSD", "JacobiSN", \
"JacobiSymbol", "JacobiZeta", "KelvinBei", "KelvinBei2", "KelvinBer", \
"KelvinBer2", "KelvinKei", "KelvinKei2", "KelvinKer", "KelvinKer2", \
"Ket", "KleinInvariantJ", "KroneckerDeltaSeq", "KroneckerSymbol", \
"Label", "Large", "LegendreP", "LegendreP3", "LegendreP4", \
"LegendreQ", "LegendreQ3", "LegendreQ4", "LerchPhi", "Link", \
"LiouvilleLambda", "ListGraphic", "LocatorPane", "LogGamma", \
"LogIntegral", "LucasL", "LucasL2", "MainBookLink", "MainBookLinkMR", \
"MangoldtLambda", "Manipulate", "ManipulateLabel", "Manipulator", \
"MasterIndexLink", "MathCaption", "MathieuCharacteristicA", \
"MathieuCharacteristicB", "MB", "MBO", "Medium", "Menu", "MenuLabel", 
 "MenuViewLabel", "Message", "MessageLink", "MessagesWindow", \
"MixedFraction", "MO", "Mod", "ModularLambda", "MoebiusMu", "Moment", \
"MomentList", "MR", "MSG", "NetworkEdge", "NetworkGraphics", \
"NetworkVertex", "NevilleThetaC", "NevilleThetaD", "NevilleThetaN", \
"NevilleThetaS", "NorlundB", "NorlundB3", "Norm", "Norm2", \
"NotationMadeBoxesTag", "NotationPatternTag", "NotationTemplateTag", \
"Notebook", "NotebookLink", "NotebookLinkMR", "Notes", "ObjectName", \
"OpenCloseItemizedPicture", "OtherInformationLink", \
"OtherInformationLinkMR", "Output", "OutputForm", "PageBreak", \
"PageLink", "PageNumber", "Pane", "Panel", "PanelLabel", \
"PaneSelector", "ParabolicCylinderD", "PartitionsP", "PartitionsQ", \
"Paste", "Picture", "PictureGroup", "Piecewise", "Placeholder", \
"PluginEmbeddedContent", "PluginEmbeddedWindow", "PluginInfoText", \
"PluginInitWindow", "PluginMainErrorText", "PluginSubErrorText", \
"PluginWindow", "Pochhammer", "PolyGamma", "PolyGamma2", "PolyLog", \
"PolyLog3", "PolynomialMod", "PopupMenu", "PopupMenuLabel", \
"PowerMod", "PowerSymmetricPolynomial", \
"PowerSymmetricPolynomialList", "PreviousNext", "PrimaryPlaceholder", \
"Prime", "PrimeNu", "PrimeOmega", "PrimePi", "PrimeZetaP", "Print", \
"PrintTemporary", "PrintUsage", "QBinomial", "QFactorial", "QGamma", \
"QHypergeometricPFQSeq", "QPochhammer", "QPochhammer1", \
"QPochhammer2", "QPolyGamma", "QPolyGamma3", "RamanujanTau", \
"Reference", "ReferenceMarker", "Residue", "RiemannR", \
"RiemannSiegelTheta", "RiemannSiegelZ", "RM", "RowDefault", \
"RowNoSeparators", "RowWithSeparator", "RowWithSeparators", "SB", \
"SBO", "SelectionPlaceholder", "SinhIntegral", "SinIntegral", \
"SlideHyperlink", "SlidePreviousNextLink", "SlideShowCanvas", \
"SlideShowNavigationBar", "SlideShowNavigationBar2", \
"SlideShowPaletteButton", "SlideShowPaletteTitle", \
"SlideShowSection", "SlideTOC", "SlideTOCLink", "Small", "SO", \
"Sound", "SphericalBesselJ", "SphericalBesselY", "SphericalHankelH1", \
"SphericalHankelH2", "SpheroidalEigenvalue", "SpheroidalPS", \
"SpheroidalPSPrime", "SpheroidalQS", "SpheroidalQSPrime", \
"SpheroidalS1", "SpheroidalS1Prime", "SpheroidalS2", \
"SpheroidalS2Prime", "SquaresR", "SR", "StandardForm", \
"StieltjesGamma", "StieltjesGamma2", "StirlingS1", "StirlingS2", \
"StruveH", "StruveL", "Subsuperscript", "Superscript", \
"TableViewGrid", "TableViewItem", "TableViewItem2", \
"TableViewItemExpression", "TableViewItemExpression2", \
"TableViewLabel", "TableViewPlaceholder", "TableViewStringBoxes", \
"TabView", "TabViewLabel", "TB", "TBI", \
"TemplateBoxErrorDisplayArgumentStyle", \
"TemplateBoxErrorDisplayStyle", "TemplateDockedCell", \
"TemplateHeaderCell", "TemplateLink", "TemplateVariable", "TextForm", \
"TextStyleInputField", "TextStyling", "TI", "TooltipLabel", \
"TourLink", "TR", "TraditionalForm", "Transpose", "UnitBoxSeq", \
"UnitStepSeq", "UnitTriangleSeq", "UnmatchedBracket", "Usage", \
"WeberE", "WeberE2", "WeierstrassP", "WeierstrassPPrime", \
"WeierstrassSigma", "WeierstrassZeta", "WhittakerM", "WhittakerW", \
"WolframAlphaLong", "WolframAlphaShort", "WolframAlphaShortInput", \
"Zeta", "Zeta2", "ZetaZero", All} *)

And to see which of these built-in named styles might be visually useful:

Grid[{Style["The quick brown fox ...", #], Style[#, #]} & /@ 
  Cases[styles, _String], Alignment -> {{Right, Left}, Center}]

enter image description here

share|improve this answer
    
I had just thought of doing this when your answer showed up. I was trying to find a built-in function. (+1) –  Michael E2 Jul 31 '13 at 2:59
    
Note that StyleData can take a StyleDefinitions option, which your pattern doesn't account for. So there are even more styles... –  Brett Champion Jul 31 '13 at 4:22
    
@BrettChampion good point. I'll make the changes –  Mike Honeychurch Jul 31 '13 at 4:43

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.