Why is it impossible to use tab to indent e.g. an inline comment i.e. (* ... *) in an Input cell?

However, I have seen that it is possible, if I use Cell>ConvertTo>TextDisplay. The cell remains evaluatable, but the cell bracket goe wwithout the diagonal decoration at the upper end.


In Input cells Tab has another use: to move between Placeholder characters and other "active" objects.

You can still use other ways to insert a \[RawTab] character such as an Input Alias. To create one in the current Notebook evaluate:

  CurrentValue[InputNotebook[], InputAliases],
  "ta" -> "\t"

You can then enter a raw tab with EsctaEsc. If you like this you can make it a persisting change by replacing InputNotebook[] with $FrontEnd and evaluating it again, but only do it once. Or use the Option Inspector to edit the Global value for InputAliases.

  • $\begingroup$ I like to use Code cells (Alt 8): there tab behaves nice. $\endgroup$ – Rolf Mertig Jun 26 '15 at 0:36
  • $\begingroup$ @RolfMertig Szabolcs had an answer where he suggested that but he deleted it. (You can't quite see "deleted" posts yet.) As noted in the comments Tab only works at the beginning of lines there whereas the OP wants tabs mid-line. $\endgroup$ – Mr.Wizard Jun 26 '15 at 0:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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