1. Is there a way to split the screen so that the code is visible on top, and the output generated from its execution appears at the bottom?
  2. Is there any way to clear the screen from previous runs, so that the result of execution is presented in a clean screen, something like the cls command in BASIC?
  • 1
    $\begingroup$ I don't think the functionality exists in the standard notebook interface, although it could probably be created in a custom notebook with the help of dynamic interactivity. I could imagine this might be useful for some things, but notebooks are not organized like that by default. $\endgroup$
    – Jens
    Apr 7, 2015 at 2:41
  • 1
    $\begingroup$ In the book "An Introduction to Programming with Mathematica" by Wellin, Gaylord & Kamin all of chapter 10 is on programming the "front end" of Mathematica. Using functions like NotebookCreate and NotebookWrite you might be able to do some or much of what you want. $\endgroup$
    – Bill
    Apr 7, 2015 at 3:15

1 Answer 1


Here's a quick&dirty&buggy solution for your two wishes, although I strongly suggest you to do you works the way as the notebook interface designed to.

Cls := (SelectionMove[InputNotebook[], All, Notebook];
$Post = (If[Head@$outputNB == Symbol, $outputNB = CreateNotebook[]];
      If[# === Null, 1;, Paste[$outputNB, #]]) &;

Cls is the screen-cleaning command, it deletes all the cells in current notebook. Then the $Post variable is modified to redirect all the outputs.

  • $\begingroup$ Nice solution. I would use cls[] for the clear command as that is safer and more conventional. $\endgroup$
    – Mr.Wizard
    May 6, 2015 at 6:30

Your Answer

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

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