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.

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.

share|improve this question

marked as duplicate by 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.

1 Answer 1

up vote 1 down vote accepted

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:

InputField[
           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?

share|improve this answer
    
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. –  Wenli Sep 23 '13 at 12:24
    
@Wenli Take a look at my comment under your question –  belisarius Sep 23 '13 at 12:27
    
Thx! That's a duplicate indeed. –  Wenli Sep 23 '13 at 12:35

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