5
$\begingroup$

For example, how to make Mathematica display only the lines beginning with In[some number]?

In[8]:= m1 = {{1, 1, 1}, {8, 4, 2}, {64, 16, 4}}
Out[8]= {{1, 1, 1}, {8, 4, 2}, {64, 16, 4}}
In[9]:= m1.{b1, b2, b3} == {1, 1, 1}
Out[9]= {b1 + b2 + b3, 8 b1 + 4 b2 + 2 b3, 64 b1 + 16 b2 + 4 b3} == {1, 1, 1}
$\endgroup$
1
  • $\begingroup$ I've deleted part of your code as not relevant for the question. Feel free to revert this if you want. $\endgroup$
    – Kuba
    Sep 2, 2013 at 19:55

2 Answers 2

8
$\begingroup$

I see three ways:

  1. Copy and paste everything into a new notebook (to ensure we don't destroy the output for good). Then select Cell -> Delete All Output from the menu.

  2. alt-click (-click on a Mac) on an input cell's bracket. All input cells will get selected. Now copy them and paste them into a new notebook.

  3. alt-click (-click on a Mac) on an input cell's bracket. All input cells will get selected. Now press ctrl-' (-' on a Mac). All outputs will be hidden, but they won't be deleted.

    (If you need to hide the input and keep the output, you can do the same but start with alt-clicking an output cell.)

$\endgroup$
1
$\begingroup$

4)

SetOptions[#, CellOpen -> False] & /@  Cells[EvaluationNotebook[], GeneratedCell -> True]

But I would choose Szabolcs's 3rd solution.

$\endgroup$

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.