WolframResearch / WolframLanguageForJupyter

Wolfram Language kernel for Jupyter notebooks
MIT License
1.03k stars 124 forks source link

InputForm not pastable: it inserts ">" for long expressions #93

Closed tueda closed 3 years ago

tueda commented 4 years ago

It would be nice if InputForm could output copyable and pastable text representation within the valid Wolfram language syntax, even for long expressions. Currently, I get > for each line break, which is not good to paste to another place:

image

Edit: indeed, it would be really good if InputForm could give the textual output as in a terminal, without any extra line breaks between lines:

In[1]:= (1 + x)^20 // Expand // InputForm

Out[1]//InputForm=
1 + 20*x + 190*x^2 + 1140*x^3 + 4845*x^4 + 15504*x^5 + 38760*x^6 + 77520*x^7 +
 125970*x^8 + 167960*x^9 + 184756*x^10 + 167960*x^11 + 125970*x^12 +
 77520*x^13 + 38760*x^14 + 15504*x^15 + 4845*x^16 + 1140*x^17 + 190*x^18 +
 20*x^19 + x^20
arnoudbuzing commented 4 years ago

You may get better results if you evaluate this first: SetOptions[$Output, PageWidth -> Infinity]

(I did not verify this in Jupyter, but it might help you)

tueda commented 4 years ago

Thanks for the comment, but it doesn't seem to work in Jupyter: image

cc-wr commented 3 years ago

@tueda, the pull request #84 should make it so that SetOptions[$Output, PageWidth -> Infinity] works for Wolfram Language for Jupyter, such that evaluating it removes the line breaks you have seen for long expression results.

cc-wr commented 3 years ago

There is a general request for comments on the pull request #84, which should address this issue, at #103.