I want to get $\color{red}{\textbf{1}}$ plain string,but this function actually will give me some RowBox:

And the same case:


I want to get $\color{red}{\textbf{4}}$ plain string from it:

{"Plot[f,{x,Subscript[x, min],Subscript[x, max]}] generates a plot of f as a function of x from Subscript[x, min] to Subscript[x,max].","Plot[{Subscript[f, 1],Subscript[f,2],…},{x,Subscript[x,min],Subscript[x, max]}] plots several functions Subscript[f,i].","Plot[{…,w[Subscript[f, i]],…},…] plots Subscript[f,i] with features defined by the symbolic wrapper w.","Plot[…,{x}∈reg] takes the variable x to be in the geometric region reg."}

Can any method do this?

  • $\begingroup$ @Kuba I have,we can copy it as plain string to get it by right click. $\endgroup$
    – yode
    Feb 24 '17 at 13:55

How can I get the unchanged Box form of an arbitrary expression?

toBoxes = MathLink`CallFrontEnd[
    FrontEnd`UndocumentedTestFEParserPacket[#, True]
][[1]] &

How to convert arbitrary raw boxes directly into String?

toText = FrontEndExecute[
    FrontEnd`ExportPacket[#, "PlainText"]
][[1]] &

  , Map[toBoxes]
  , StringSplit[#[[1]], "\n"] &
] @ GeneralUtilities`GetUsages["System`Plot"]
 "Plot[f,{x,Subscript[x, min],Subscript[x, max]}]generates a plot of \
 f as a function of x from Subscript[x, min]to Subscript[x, max]."
 "Plot[{Subscript[f, 1],Subscript[f, 2],\[Ellipsis]},{x,Subscript[x, \
 min],Subscript[x, max]}]plots several functions Subscript[f, i]."
 "Plot[{\[Ellipsis],w[Subscript[f, i]],\[Ellipsis]},\[Ellipsis]]plots \
 Subscript[f, i]with features defined by the symbolic wrapper w."
 "Plot[\[Ellipsis],{x}\[Element]reg]takes the variable x to be in the \
 geometric region reg."
  • $\begingroup$ Good lesson to me.Thanks a lot. $\endgroup$
    – yode
    Feb 24 '17 at 14:06
  • $\begingroup$ I'm shy to say I don't know the function of FrontEnd`UndocumentedTestFEParserPacket still.And the function of the True? $\endgroup$
    – yode
    Feb 24 '17 at 15:12
  • $\begingroup$ @yode I can't say more than you can find in the topic linked above. $\endgroup$
    – Kuba
    Feb 24 '17 at 15:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.