Suppose we have a cell like this:
boxes = Cell[
BoxData[RowBox[{"foo", "[", "\[IndentingNewLine]",
RowBox[{RowBox[{"{",
RowBox[{"1", ",", "2", ",", "3", ",", "4", ",", "5", ",",
"6", ",", "7", ",", "8", ",", "9", ",", "10", ",", "11",
",", "12", ",", "13", ",", "14", ",", "15", ",", "16",
",", "17", ",", "18", ",", "19", ",", "20", ",", "21",
",", "22", ",", "23", ",", "24", ",", "25"}], "}"}], ",",
"\[IndentingNewLine]", "\"asd\""}], "\[IndentingNewLine]",
"]"}]], "Input"];
To convert it to interpretable ASCII text, we can use
First @ FrontEndExecute @ FrontEnd`ExportPacket[boxes, "InputText"]
This produces
foo[
{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25},
"asd"
]
Notice that the code was wrapped at a width of about 70 characters. How can I control this wrapping width?
"What have you tried?"
ExportPacket[..., "InputText", PageWidth -> 200]
does not change the wrapping width.
Setting these does not work: