# Backslash commands in strings?

I discovered by playing around that

Text[DisplayForm@SubscriptBox["\[Lambda]", "k"]]


produces the same result as

Text["\*SubscriptBox[\"\[Lambda]\", \"k\"]"]


and, further, that the \* is essential. This finding suggests that \* means DisplayForm when inside a string. After more playing around, I found that

Text["\!$$\*SubscriptBox[\"\[Lambda]\", \"k\"]$$"]


produces the same result, but only if you have the bang and the parens, that is, that \! and $$+$$ are both necessary; either construct alone will not work.

Where can I find the documentation for this magic? I don't know what to search for because I don't know what these kinds of constructs are called.

-
To the close-voter: I contend that this is not easily found in the documentation. I used Mathematica for years before stumbling into the right section. It is hard to search for if you don't already know what you're looking for. –  Mr.Wizard Jul 27 at 14:48

I believe this is the documentation you are looking for:

Notably:

And:

-

These are Operator Input Forms

Characters that are not letters, letter‐like forms, or structural elements are treated by the Wolfram Language as operators. The Wolfram Language has built‐in rules for interpreting all operators. The functions to which these operators correspond may or may not, however, have built‐in evaluation or other rules. ...

Operators that construct two‐dimensional boxes—all of which have names beginning with backslash—can only be used inside $$…$$. ... "Input of Boxes" gives interpretations when no \! is included.

\*expr (boxes constructed from expr)
\!boxes (interpreted version of boxes)

-
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. –  m_goldberg Jul 27 at 15:08
It's relevant to the answer, but not as direct as the answer above. I'm upvoting because it's helpful and useful. –  Reb.Cabin Jul 27 at 15:59