Skip to main content

front end - Questions about InlineCell vs InlineFormula vs DisplayFormula cells


I'm having trouble with typesetting, and can't get these questions straight in my head.





  1. What is the difference between "InlineCell" and "InlineFormula" style?




  2. Is one a subset of the other?




  3. In what situations should I use each?





  4. And why is InlineCell important enough to have default shortcut (Ctrl + 9) but InlineFormula is not?




  5. Does "InlineFormula" have anything to do with an "DisplayFormula" cell?





Answer



I don't have much experience with writting books or articles in Mathematica so let me just add technicall notes. For use cases I'd search around using those styles as keywords:






4


Ctrl+9 starts an Inline cell which is not the same thing as an "InlineCell". But one step at a time.


So an Inline cell is special as it is a cell inside a cell (notice that you can't just create it between cells with Crtl+9). And now an "InlineCell" is a style that is used for that area automatically after it is created. (more info in Order/Dependency of Styles in a Stylesheet by John Fultz)


Notice also that "InlineCell" style is not even explicitly present in Cell[] expression whereas for custom setting e.g. DefaultNewInlineCellStyle -> {"InlineFormula"}, the "InlineFormula" will be there. So the former style is really a core stuff.


1; 2; 3


As you can see from definition in Core.nb it is not so much about styling but about behavior/experience:


Cell[StyleData["InlineCell"],
ShowCodeAssist->False,
CodeAssistOptions->{"DynamicHighlighting"->False},
TextAlignment->Left,

TranslationOptions->{"Enabled"->False},
LanguageCategory->"Formula",
ScriptLevel->1,
StyleMenuListing->None
]

so is the case with "InlineFormula" (from Default.nb):


Cell[StyleData["InlineFormula"],
StripStyleOnPaste->True,
HyphenationOptions->{"HyphenationCharacter"->"\[Continuation]"},

LanguageCategory->"Formula",
ScriptLevel->1,
SingleLetterItalics->True,
MenuSortingValue->1650,
FontSize->Inherited 1.05
]

but here that SingleLetterItalics and enlarged FontSize suggest it is meant for... formulas, in mathematical sense probably.


So you can compare those options and set DefaultNewInlineCellStyle whatever you like. You can set also other styles or modify those, whatever fit your needs.


Comments