Mathematica - How to Go to Next Line Without Running Process?

AI Thread Summary
In Mathematica's free-form input mode, hitting "Enter" typically executes the input, which can be problematic for users trying to enter multiple lines. The issue arises because the Wolfram Language processes complete expressions immediately upon hitting "Enter." To indicate that an expression is incomplete and to continue on the next line, users can use the backslash "\\" or the continuation character "" at the end of a line. However, it appears that this method may not work in free-form input as it does in standard Mathematica input. Users seeking to input multiple lines in free-form mode may need to adjust their approach, as the standard method for indicating continuation may not apply. Learning the Mathematica language is recommended for more complex input handling in the future.
Ascendant0
Messages
175
Reaction score
38
I am trying to run multiple lines input in Mathematica in the free-form input. From everything I read online, you simply hit "enter", but hitting enter runs my process. Both enters, the one next to my letters, and the one on the numerical keypad. Hitting shift+enter also runs it. I can't find anything explaining why this is happening. I would imagine it's some kind of setting I need to change in Mathematica, but I looked through settings and couldn't find one that would be applicable. Help please?
 
Physics news on Phys.org
See https://reference.wolfram.com/language/tutorial/InputSyntax.html#14153:

If at the end of a particular line the input you have given so far corresponds to a complete expression, then the Wolfram Language will normally begin immediately to process that expression.

You can however explicitly tell the Wolfram Language that a particular expression is incomplete by putting a ∖ or a  (\[Continuation]) at the end of the line. The Wolfram Language will then include the next line in the same expression, discarding any spaces or tabs that occur at the beginning of that line.
 
pasmith said:
Thank you for the information. I can't look at the entire link while working, but I'll be able to later this evening.

I did have a minute to try using the "\" at the end of a line, and it is still processing it as soon as I hit enter. Is that \ maybe only applicable for "Mathematica Input" and not "Free-form input"? I still need to learn the Mathematica language, so I'm using the free form for now. I absolutely plan to learn the language before the end of this year, I just can't at this time.
 

Similar threads

Replies
6
Views
4K
Replies
5
Views
3K
Replies
5
Views
7K
Replies
2
Views
4K
Back
Top