Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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!

share|improve this question
    
What happens if you select all (command-A) and then enter? –  bill s Jan 17 at 19:22
    
@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. –  YungHummmma Jan 17 at 19:29
    
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. –  Szabolcs Jan 17 at 19:30
    
@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 –  YungHummmma Jan 17 at 19:34
    
@YungHummmma Remove Quit from the beginning and try again. Does it work now? –  Szabolcs Jan 17 at 19:42

1 Answer 1

up vote 5 down vote accepted

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]
share|improve this answer
    
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. –  Jason B Jan 17 at 20:31
    
@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! –  Szabolcs Jan 17 at 20:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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