7
$\begingroup$

If I type

Information[ProductLog]

I see

Information[ProductLog]

If I type

Framed[Information[ProductLog]]

I see

Framed[Information[ProductLog]]

This is expected, though not desired, because Information prints its output, rater than returning it. However, I want to get access to the text of the description, or the boxes of the description, or something, to, e.g., put the descriptions of functions in columns or rows. How do I do things like this?

$\endgroup$
1
  • 3
    $\begingroup$ The output cells are created by CellPrint. You can capture the cell expressions with Block[{CellPrint = Sow}, Reap@Information[ProductLog] ], but I'm not sure that's what you want. $\endgroup$
    – Michael E2
    Mar 10, 2019 at 22:52

2 Answers 2

5
$\begingroup$

You may use the "PlaintextUsage" or "TypesetUsage"property of WolframLanguageData.

WolframLanguageData["ProductLog", "PlaintextUsage"]

or

WolframLanguageData[ToString@ProductLog, "PlaintextUsage"]

gives

"ProductLog[z] gives the principal solution for w in z\[LongEqual]we^w. ProductLog[k, z] gives the k^th solution."

Note the escapes like "\[LongEqual]" will evaluate to their symbol in strings in Mathematica/Wolfram Language.

For typeset lines then

WolframLanguageData["ProductLog", "TypesetUsage"][[1, 1]]

Mathematica graphics

Hope this helps.

$\endgroup$
1
  • $\begingroup$ Thanks! This is exactly what I was looking for. $\endgroup$ Mar 11, 2019 at 0:30
2
$\begingroup$

A simpler method to get the usage messages for further manipulation is to use MessageName[symbol, "usage"]:

MessageName[ProductLog, "usage"]

which already yields a typeset version, similar to what is produced by Information[].

And of course, Attributes[symbol] will return symbol's associated attributes.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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