# NewLine Inconsistency

Copy and paste the following two lines into Mathematica.

1 \[Alpha] \[NewLine] 2
f[ 1 \[Alpha] \[NewLine] 2]


The first posts \[NewLine] while the second doesn't. This doesn't duplicate the behavior as if you would have typed the same expression.

This should definitely be a bug IMO because it is both not displayed or interpreted. The same holds true for \[RawReturn] and \[IndentingNewLine]

Cell[BoxData[{
RowBox[{"1", " ", "\[Alpha]"}], "\[NewLine]", "2", "\n",
RowBox[{"f", "[",
RowBox[{"1", " ", "\[Alpha]", " ", "2"}], "]"}]}], "Input"]


It doesn't copy the same behavior as if you would have typed the expression straight into Mathematica.

• I don't think you can call it a bug unless you can point to where the docs say what to expect when you stick a non printing special character in the middle of an expression. – george2079 Sep 3 '15 at 15:00
• @george2079 Does bribery work? I'll give rep points if I can mark it as a bug. :) Just Kidding. Although you are right it isn't documented but at the same time or don't think it should be the intended behavior. They are both multiplication \[Alpha] \[IndentingNewLine] working but not inside a function is inconsistent. – William Sep 3 '15 at 15:02
• @george2079 Each character has a name and a number of shortcut aliases. They are fully supported by the standard Wolfram System fonts. It doesn't matter to me if it displayed, but it should be interpreted. Check BoxData post above. – William Sep 3 '15 at 15:13
• @george2079 There should be an inconsistent-bug tag. I'm not sure about your original example it is debatable if Symbol@"\[IndentingNewLine]" should work. – William Sep 3 '15 at 15:46
• Ok, I see what you are saying. Its worth pointing out a regular "\[Newline]" works fine (displaying a line break within your function argument). ref: reference.wolfram.com/language/ref/character/… – george2079 Sep 3 '15 at 15:46

It isn't a bug but probably the intended behavior of automatic code formatter for "Input" Cells. Such Cells have AutoSpacing->True by default and so aren't intended to hold newlines, spaces etc. appearing in a string which you paste into them. If you wish to hold original appearance of the code you should use "Code" Cells (Alt+8) which has AutoSpacing->False or you could create custom stylesheet where "Input" Cells will have AutoSpacing->False by default.
When pasting your code into a "Code" Cell everything works as you expected:
• My issue is that if you take a valid box form of the data and type it in exactly it produces a different result then if you paste the same data into the cell. NewLine characters appear to be the only that have this happen. They are very much intended to hold new lines. It has been patched so paste works properly mathematica.stackexchange.com/questions/30604/… I'm ok with the \n but \[RawReturn] and \[IndentingNewLine] and \[NewLine] should not all be stripped. They are different characters. – William Feb 25 '16 at 6:59
• When you paste a string into an "Input" cell it is parsed having AutoSpacing->True "in mind". As I showed in my answer, it is sufficient to set AutoSpacing->False (even for "Input" cell) to prevent this. Try to add this option at the end of FullForm (Ctrl+E) of "Input" cell and then paste your code. You will see, it works! – Alexey Popkov Feb 25 '16 at 7:04
• For what actually do you need \[NewLine], \[IndentingNewLine] and \[RawReturn] to be parsed differently when you paste a string? And in what way? With AutoSpacing->False they are all preserved and I see this as expected and correct behavior. – Alexey Popkov Feb 25 '16 at 7:27