MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Cell["\<\ ... \>", ... ; TextData[...]

Cell[_String] is equivalent to Cell[TextData[{_String}]] as far as the front end
is concerned.  The former is just an abbreviation of the latter syntax, which is
necessarily used when the contents are more complex (e.g., contain styles or

The \<\> business dates back to a hoarier day (in my opinion) in the design of
strings in Mathematica.  Once upon a time, Mathematica had an odd interpretation
of newlines which I probably made more sense in the days of 80 character
terminal usage.  You'll have to forgive memory is fuzzy here, and I
don't have an old Mathematica text to double-check this from my current
location...but I believe the issue was something like this...


...with the newlines and spaces as shown, being equivalent to "abc d" (with just
the single space).  The \<\> business forced everything inside the string to
really be interpreted literally, with backslash at the end of a line meaning to
simply escape the newline, and do nothing special to leading spaces.  Since the
Mathematica notebook format generally wraps at about 70 characters, the
non-literal interpretation would have made the representation of more than 70
consecutive spaces difficult.

The modern Mathematica notebook format (introduced in 1996) was always made to
be interpreted properly as a Mathematica expression should you call Get[] on it
from the kernel.  So this syntax was standardized, and is still used today.
Now, the kernel simply ignores the \<\> delimiters as you can see below:

In[1]:== StringLength["\<x\>"]

Out[1]== 1


John Fultz
jfultz at
User Interface Group
Wolfram Research, Inc.

On Wed, 15 Dec 2010 07:51:11 -0500 (EST), kj wrote:
> When I examine the source code of Mathematica notebooks, I often
> see Cell objects whose first argument is preceded by
> "\<\
> and followed by
> \
> \>"
> E.g.
> Cell["\<\
> Yet another undocumented item.\
> \>", "Text"...
> What do these delimiters mean?  And how do they differ from the
> TextData symbol?  (The latter is also undocumented, but at least
> I've seen "cameo appearances" of it in the documentation.)
> TIA!
> ~kj

  • Prev by Date: Re: how to plot nminimized result
  • Next by Date: Re: How to create a notebook outside of Mathematica?
  • Previous by thread: Re: Cell["\<\ ... \>", ... ; TextData[...]
  • Next by thread: NMinimize::nrnum: