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.

Is it possible to span one expression across multiple cells? E.g. long if statement or function evaluation. I looked in documentation and searched forum/google and could not find.

share|improve this question
1  
I don't think so. But given that you can format the expression inside the cell using the enter key, what would be the use of multiple cells? –  celtschk Apr 15 at 15:41
    
Multiple cells for collapsable regions of code and text –  denfromufa Apr 17 at 4:34
    
One option would be to factor out some of the code into separate definitions. If your code is so long that you would like to collapse parts of it, then doing so is probably a good idea anyway. –  celtschk Apr 17 at 8:23

1 Answer 1

up vote 5 down vote accepted

No, this is not possible. A cell can only be evaluated if it contains a complete and syntactically correct expression.

You might want to try Code style cells (Alt-8 or Command-8) which contain plain text and allow arbitrary formatting with spaces, tabs and newlines.

share|improve this answer

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.