# Manipulate with formatted output

I would like to have 4 output fields for something like the following:

Manipulate[
n*x
n/x
n + x
n - x,
{n, 1, 10}, {x, 1, 10}, ControlType -> InputField]


but this just outputs all 4 calculations combined.

• Try something like this: Manipulate[ Row[{n*x, "," , n/x, ",", n + x ",", n - x}], {n, 1, 10}, {x, 1, 10}, ControlType -> InputField] Commented Dec 15, 2013 at 18:58
• Brilliant - thank you :) Commented Dec 15, 2013 at 19:01
• Although this question arises from a simple mistake, I recommend that it not be closed because this is common problem for beginners, and the question and its answer is likely to help future visitors with a similar problem. Commented Dec 15, 2013 at 19:33
• @m_goldberg but then the title should be improved. Perhaps: "manipulate with multiple outputs"? Of course the main problem here is not Manipulate, but CompoundExpression (and the fact that it is not needed in top level notebook cells) Commented Dec 15, 2013 at 22:19
• Related: Multiple output cells. One of the answers contains an answer to this question. Commented Dec 15, 2013 at 22:52

## 1 Answer

As mentioned in the comment by Artes, you can use Row, although you don't need to put in the "," individually. Row takes a spacing element as its second argument.

Manipulate[Row[{n*x, n/x, n + x, n - x}, ", "],
{n, 1, 10},
{x, 1, 10},
ControlType -> InputField]


You can get much fancier, of course. For example:

Manipulate[Column[{
Row[{"n*x = ", n*x}],
Row[{"n/x = ", n/x,}],
Row[{"n + x = ", n + x}],
Row[{"n - x = ", n - x}]}],
{n, 1, 10},
{x, 1, 10}, ControlType -> InputField]


For the ultimate in layout control, take a look at Grid.

• Thank you - this is really helpful :) Commented Dec 15, 2013 at 19:23