8
$\begingroup$

When working in a Mathematica notebook, I often want to reorder cells. Most of the time, I am adding cells at the bottom of the notebook, until I realize it may be better to insert this calculation at an earlier point, between existing cells.

Is there a convenient way to reorder cells in a Mathematica notebook without having to cut and paste?

Ideally, I would like to be able to drag cells by their bracket, possibly holding a modifier key. I've searched through the internet in general and this StackExchange in particular and come up with nothing.

$\endgroup$
3
  • $\begingroup$ Interesting idea. I've wanted something like this before, but never bothered to implement it. Off the top of my head, I think it should be possible by using SelectedCells, then copy, NotebookDelete, SelectionMove (in the desired direction), followed by NotebookWrite. These could be bound to particular (modified) keys in KeyevenTranslations.tr $\endgroup$
    – rm -rf
    Dec 6, 2013 at 20:24
  • $\begingroup$ @rm-rf - Thanks, I'll look into it. (Note: this is my second day of Mathematica, so I have some figuring out to do.) $\endgroup$ Dec 6, 2013 at 20:26
  • 4
    $\begingroup$ Oh... then it might be a little too much too soon for you, I think. FrontEnd programming is not easy (and definitely not for a day 2 user). I'll try and post answer later if I get some time (you might get an answer sooner than that). Also, if it's only your day 2, I would encourage you to try to work with the notebook as is and get used to it a bit. It's not like your traditional text editor, so some very common features like undo, line numbers, moving lines up/down, joining lines, block indenting, etc. are unavailable. Everything is based around a Cell as the lowest common unit, not a line. $\endgroup$
    – rm -rf
    Dec 6, 2013 at 20:36

0

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.

Browse other questions tagged or ask your own question.