2

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.

Wenli
  • 23
  • 3

1 Answers1

1

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?

Kuba
  • 136,707
  • 13
  • 279
  • 740