This question already has an answer here:

Is there a way to input multiple rows of text and save it as a variable? Like an InputField, but with multiple rows? I would like to make a simple text redactor, so that I could enter a text and then use it as a variable.


marked as duplicate by Dr. belisarius, Kuba, Pinguin Dirk, Mr.Wizard Sep 23 '13 at 12:37

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Simple InputField will work. You just need to use \[NewLine] when you need it. Create a pallete for this purpose or a shortkey, or event handler.

You can use a quick fix too:

           Dynamic[x, (x = StringReplace[#, "\\n" -> "\n"]) &],
           String, ContinuousAction -> True]

enter image description here

so now every time you type "\n" it will create new line.

Is this what you're after?

  • $\begingroup$ Ideally I would like to have smth more user-friendly since my future application will be used by people without Mathematica experience, but this will work, thx. $\endgroup$ – Wenli Sep 23 '13 at 12:24
  • $\begingroup$ @Wenli Take a look at my comment under your question $\endgroup$ – Dr. belisarius Sep 23 '13 at 12:27
  • $\begingroup$ Thx! That's a duplicate indeed. $\endgroup$ – Wenli Sep 23 '13 at 12:35

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