10
$\begingroup$

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?

$\endgroup$
7
  • $\begingroup$ What is the style of the "any given cell"? Does it happen in a regular Input cell? I can see that happening in SubSection $\endgroup$
    – Rojo
    Jan 25, 2013 at 2:50
  • $\begingroup$ "any given cell" is a regular Input cell (one where I run expressions). $\endgroup$
    – QuantumDot
    Jan 25, 2013 at 2:59
  • 1
    $\begingroup$ Then that shouldn't happen. The cell option that controls this is StyleKeyMapping. Try evaluating CurrentValue[StyleKeyMapping] and see what comes out $\endgroup$
    – Rojo
    Jan 25, 2013 at 3:01
  • $\begingroup$ @Rojo and @kguler, After running CurrentValue[StyleKeyMapping], I get {"=" -> "WolframAlphaShort"}. $\endgroup$
    – QuantumDot
    Jan 25, 2013 at 3:16
  • 1
    $\begingroup$ @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 $\endgroup$
    – kglr
    Jan 25, 2013 at 3:24

1 Answer 1

15
$\begingroup$

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

$\endgroup$
8
  • 3
    $\begingroup$ 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? $\endgroup$
    – QuantumDot
    Jan 25, 2013 at 4:42
  • 3
    $\begingroup$ 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 $\endgroup$
    – kglr
    Jan 25, 2013 at 4:57
  • $\begingroup$ 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? $\endgroup$
    – m_goldberg
    Jan 25, 2013 at 6:06
  • $\begingroup$ @m_goldberg try another tab $\endgroup$
    – Rojo
    Jan 25, 2013 at 6:22
  • 1
    $\begingroup$ @Rojo. I tried again and got Subsubsubsubsection. I guess I can't count beyond three in the wee hours of the morning. $\endgroup$
    – m_goldberg
    Jan 25, 2013 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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