0
$\begingroup$

I'm running a Mathematica (version 8) notebook. In one of the first few cells, it is supposed to plot some data. It uses a couple functions that are defined in an above cell.

If I do Evaluation-> Evaluate Notebook (which should evaluate the whole notebook, starting from the top, right?), it goes through and seems to evaluate it (the bars at the right turn from highlighted to regular as it goes down the notebook), but it doesn't produce the plot, or several other results that should output to the screen (they don't have a semicolon).

However, if I go down from the top and manually hit shift+enter for each cell in order, it produces what it's supposed to.

Am I doing something dumb? What's going on?

Thanks!

$\endgroup$
7
  • $\begingroup$ What happens if you select all (command-A) and then enter? $\endgroup$
    – bill s
    Jan 17, 2014 at 19:22
  • $\begingroup$ @bills, hi, I assume you mean shift+enter? I tried just enter and it did nothing. Doing ctrl+a and shift enter did the same thing doing "evaluate notebook" did. $\endgroup$ Jan 17, 2014 at 19:29
  • $\begingroup$ That does sound unusual. Can you upload somewhere a notebook that shows the problem? You could use Dropbox if you're signed up or maybe ge.tt I can test it for you in v8. $\endgroup$
    – Szabolcs
    Jan 17, 2014 at 19:30
  • $\begingroup$ @Szabolcs, thanks. Here it is, I've run just this much and it has the same issue. I hope the formatting hasn't been messed up too much: pastie.org/8643297 $\endgroup$ Jan 17, 2014 at 19:34
  • $\begingroup$ @YungHummmma Remove Quit from the beginning and try again. Does it work now? $\endgroup$
    – Szabolcs
    Jan 17, 2014 at 19:42

1 Answer 1

5
$\begingroup$

It turns out that you had Quit[] at the top of the notebook (as you mentioned in the comments). This quits the kernels and effectively cancels all evaluations that were queued by the front end when you clicked Evaluate Notebook.

Just make sure you won't evaluate that one cell containing Quit[].

Alternatively, it is possible to set the Front End not to clear the evaluation queue on kernel quit, as described here:

SetOptions[$FrontEnd, "ClearEvaluationQueueOnKernelQuit" -> False]
$\endgroup$
2
  • $\begingroup$ There is a way to fix it so that the notebook would behave the way you want it to. Using the trick on this page, you can set it so that Mathematica will evaluate the cell with the Quit command, then restart the kernel and evaluate the other cells you had selected. I did this a very long time ago and love it. $\endgroup$
    – Jason B.
    Jan 17, 2014 at 20:31
  • $\begingroup$ @JasonB Feel free to edit the answer next time (it's community wiki) or just post it as another answer. I didn't know about this, it's very useful! $\endgroup$
    – Szabolcs
    Jan 17, 2014 at 20:33

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.