10

In the front end of v9, in any given cell that contains content, if I hit backspace to clear the content until there is nothing left, and then hit backspace one more time, the cell becomes a 'section'.

Is this a new feature? How do I use it?

Edit

Would someone verify this effect in the comments?

QuantumDot
  • 19,601
  • 7
  • 45
  • 121
  • What is the style of the "any given cell"? Does it happen in a regular Input cell? I can see that happening in SubSection – Rojo Jan 25 '13 at 02:50
  • "any given cell" is a regular Input cell (one where I run expressions). – QuantumDot Jan 25 '13 at 02:59
  • 1
    Then that shouldn't happen. The cell option that controls this is StyleKeyMapping. Try evaluating CurrentValue[StyleKeyMapping] and see what comes out – Rojo Jan 25 '13 at 03:01
  • @Rojo and @kguler, After running CurrentValue[StyleKeyMapping], I get {"=" -> "WolframAlphaShort"}. – QuantumDot Jan 25 '13 at 03:16
  • This depends on the style of the current cell. I get this behaviour for cells with Title, Subtitle, Subsubtitle or Section, Subsection, Subsubsection style. StyleKeyMapping option in the style definitions controls the behaviour in response to Backspace and Tab. See, for example, CurrentValue[{StyleDefinitions, "Subsection", StyleKeyMapping}] – kglr Jan 25 '13 at 03:20
  • 1
    @QuantumDot, that is the key mapping for Input cells (which happens to be the setting for DefaultNewCellStyle); it means "typing = in the beggining of a new cell" changes the style of the cell from Input to WolframAlphaShort – kglr Jan 25 '13 at 03:24
  • Why does "Input" gets transformed into "Subsection" when pressing backspace? I thought there should be a backspace entry under StyleKeyMapping. – Karolis Jun 29 '14 at 16:43

1 Answers1

15

In Version 9, in cells with Title, Subtitle, Subsubtitle or Section, Subsection, Subsubsection, ..., Subsubsubsubsection (perhaps others) style, Backspace in the beginning of the cell changes the cell style to the style of the next level up the hierarchy (e.g., Subsubsection > Subsection > Section). Similarly, Tab changes the style of the cell to that of the lower level; e.g., Section > Subsection > Subsubsection > ...

StyleKeyMapping suboption in the style definitions controls the behaviour in response to Backspace and Tab

  somestyles ={"Title", "Subtitle", "Subsubtitle",   "Section", "Subsection", "Subsubsection",
  "Subsubsubsection",   "Subsubsubsubsection"}; 
  Grid[ Prepend[{Style[#,#], Column[CurrentValue[{StyleDefinitions, #, StyleKeyMapping}], 
        Center]} & /@ somestyles, 
   Style[#, Bold, 16] & /@ {"Style", "StyleKeymapping"}], Dividers -> All]

enter image description here

kglr
  • 394,356
  • 18
  • 477
  • 896
  • 3
    Very helpful! Unfortunately, I find this highly annoying. Is there any way to turn this feature completely off, for all notebooks, for both my computers? – QuantumDot Jan 25 '13 at 04:42
  • 3
    The style definitions for Title, Section etc. are in the file Default.nb. Although you can replace the appropriate lines in that file with StyleKeyMapping->{}, I would not recommend any tempering with the installation files. Instead, you can define your custom style along the lines used in these related Q/As: How can I style ... and Quickly editing the stylesheet and saving it – kglr Jan 25 '13 at 04:57
  • I'm fascinated that a Tab in an empty subsubsection produces a subsubsubsection. I verified that it really does (the toolbar Style popup goes blank because it has no such menu item). But what the heck is a subsubsubsection? – m_goldberg Jan 25 '13 at 06:06
  • @m_goldberg try another tab – Rojo Jan 25 '13 at 06:22
  • @Rojo. Another Tab has no effect -- style stays at subsubsubsection. (OS X 10.6.8) – m_goldberg Jan 25 '13 at 06:37
  • @m_goldberg you sure? I have a Subsubsubsubsection. W8 – Rojo Jan 25 '13 at 06:55
  • 1
    @Rojo. I tried again and got Subsubsubsubsection. I guess I can't count beyond three in the wee hours of the morning. – m_goldberg Jan 25 '13 at 16:00
  • Did anyone figure out how to disable this feature? I agree with QuantumDot - it is very irritating. – Karolis Jun 29 '14 at 16:35