Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

(any documentation for) linear syntax?

46 views
Skip to first unread message

divisor

unread,
Feb 16, 2010, 3:51:47 AM2/16/10
to
Hello MathGroup:

Solving a recent problem I had, Maxim mentioned that this string:

Subscript[\[Alpha], 23]"

can be used in the Find-Replace dialog by its evaluated equivalent
using this string:

\!\(\[Alpha]\_23\)

He called this "linear syntax".

Since I will have other expressions that I need to convert into a form
like this, I tried to look this up in the help documentation. No luck
when trying these pages:

guide/Syntax
tutorial/SpecialWaysToInputExpressions

Can anyone tell me what this is called in the documentation or where I
can find documentation describing it?

Thanks in advance.

Roger Williams
Franklin Laboratory

Vince Virgilio

unread,
Feb 17, 2010, 6:57:54 AM2/17/10
to
On Feb 16, 3:51 am, divisor <congruentialumina...@yahoo.com> wrote:
> Hello MathGroup:

SNIP

>
> \!\(\[Alpha]\_23\)
>
> He called this "linear syntax".
>
> Since I will have other expressions that I need to convert into a form
> like this, I tried to look this up in the help documentation. No luck
> when trying these pages:
>
> guide/Syntax
> tutorial/SpecialWaysToInputExpressions
>
> Can anyone tell me what this is called in the documentation or where I
> can find documentation describing it?
>
> Thanks in advance.
>
> Roger Williams
> Franklin Laboratory


tutorial/TheRepresentationOfTextualForms
and
tutorial/TheInterpretationOfTextualForms

are good places to start.

Vince Virgilio

John Fultz

unread,
Feb 17, 2010, 6:58:47 AM2/17/10
to
If you want to search for a typeset form in the Find/Replace dialog, I strongly
recommend not doing this by hand. Instead, use Edit->Enter Selection while you
have an instance of the thing you're looking for selected. Mathematica will
automatically convert it to the right form for you.

That's really all you need to know. The rest of my response is for anyone who
wants to understand a bit more about the details of the system, and cares to
hear any ramblings and ruminations I might have to offer about it.

The form you're talking about is not documented exhaustively, but it is
documented. In the help viewer, enter the following to find it...

tutorial/StringRepresentationOfBoxes

This form is the only way in which boxes can be represented inside of strings.
That is, by the way, where the term "linear syntax" comes from. In a string,
you must have a linear representation (as opposed to an expression tree) because
strings are a linear sequence of characters.

This is all a bit unfortunate, because linear syntax can get extremely unwieldy,
and it's particularly inside of strings where it becomes most unwieldy due to
subtle issues with how the backslash escaping mechanism works within strings.
While it's possible to create such forms by hand, we generally don't recommend
it, and recommend instead using the various built-in ways of auto-converting
when necessary (the documentation points to some of these).

If it sounds like I'm not exactly thrilled about how we designed this aspect of
the system, that's because I'm not. There are several gotchas I haven't fleshed
out here, and with the hindsight that we now have, we could probably have done
this better. Maybe we will someday. In the mean time, when you do have to
interact with it, it's best to let the system work it out for you. In the case
of Find/Replace, that tends to be pretty simple using the method I described in
my first paragraph.

Sincerely,

John Fultz
jfu...@wolfram.com
User Interface Group
Wolfram Research, Inc.


On Tue, 16 Feb 2010 03:52:49 -0500 (EST), divisor wrote:
> Hello MathGroup:
>
> Solving a recent problem I had, Maxim mentioned that this string:
>
> Subscript[\[Alpha], 23]"
>
> can be used in the Find-Replace dialog by its evaluated equivalent
> using this string:
>

Adam Griffith

unread,
Feb 17, 2010, 6:56:30 AM2/17/10
to
I've found the following tutorials very useful:

tutorial/ConvertingBetweenStringsBoxesAndExpressions
tutorial/StringRepresentationOfBoxes

Thanks,
-Adam

Albert Retey

unread,
Feb 17, 2010, 8:04:37 AM2/17/10
to
Am 16.02.2010 09:51, schrieb divisor:
> Hello MathGroup:
>
> Solving a recent problem I had, Maxim mentioned that this string:
>
> Subscript[\[Alpha], 23]"
>
> can be used in the Find-Replace dialog by its evaluated equivalent
> using this string:
>
> \!\(\[Alpha]\_23\)
>
> He called this "linear syntax".
>
> Since I will have other expressions that I need to convert into a form
> like this, I tried to look this up in the help documentation. No luck
> when trying these pages:
>
> guide/Syntax
> tutorial/SpecialWaysToInputExpressions
>
In:

tutorial/InputSyntax

there is a Subsection "String-Based Input" of "Input of Boxes" which
describes the Syntax of what is also refered to as ShortBoxForm.

hth,

albert

Vince Virgilio

unread,
Feb 18, 2010, 5:16:25 AM2/18/10
to
On Feb 17, 6:58 am, John Fultz <jfu...@wolfram.com> wrote:

SNIP

>
> This is all a bit unfortunate, because linear syntax can get extremely unwieldy,
> and it's particularly inside of strings where it becomes most unwieldy due to
> subtle issues with how the backslash escaping mechanism works within strings.
> While it's possible to create such forms by hand, we generally don't recommend
> it, and recommend instead using the various built-in ways of auto-converting
> when necessary (the documentation points to some of these).
>
> If it sounds like I'm not exactly thrilled about how we designed this aspect of
> the system, that's because I'm not. There are several gotchas I haven't fleshed
> out here, and with the hindsight that we now have, we could probably have done
> this better. Maybe we will someday. In the mean time, when you do have to
> interact with it, it's best to let the system work it out for you. In the case
> of Find/Replace, that tends to be pretty simple using the method I described in
> my first paragraph.
>
> Sincerely,
>
> John Fultz
> jfu...@wolfram.com
> User Interface Group
> Wolfram Research, Inc.


What does WRI think of linear format based on Unicode, a la Murray
Sargent III (and Office 2007)?

http://www.unicode.org/notes/tn28/

Vince Virgilio

DrMajorBob

unread,
Feb 18, 2010, 5:17:08 AM2/18/10
to
Having to enter \!\(\[Alpha]\_23\) in a search box is absurd. I won't do
it, if the damn thing NEVER gets found.

Maybe that's why I rarely use special characters.

Bobby

On Wed, 17 Feb 2010 07:04:10 -0600, Albert Retey <aw...@gmx-topmail.de>
wrote:

> Am 16.02.2010 09:51, schrieb divisor:

>> Hello MathGroup:
>>
>> Solving a recent problem I had, Maxim mentioned that this string:
>>
>> Subscript[\[Alpha], 23]"
>>
>> can be used in the Find-Replace dialog by its evaluated equivalent
>> using this string:
>>
>> \!\(\[Alpha]\_23\)
>>
>> He called this "linear syntax".
>>
>> Since I will have other expressions that I need to convert into a form
>> like this, I tried to look this up in the help documentation. No luck
>> when trying these pages:
>>
>> guide/Syntax
>> tutorial/SpecialWaysToInputExpressions
>>

> In:
>
> tutorial/InputSyntax
>
> there is a Subsection "String-Based Input" of "Input of Boxes" which
> describes the Syntax of what is also refered to as ShortBoxForm.
>
> hth,
>
> albert
>


--
DrMaj...@yahoo.com

DrMajorBob

unread,
Feb 19, 2010, 3:33:07 AM2/19/10
to
> Instead, use Edit->Enter Selection while you
> have an instance of the thing you're looking for selected.

There is no "Enter Selection" option under "Edit" on my menu bar.

If that option DID exist, I couldn't do it unless I already had that
symbol or group of symbols present in the notebook, in order to select
them.

$Version

"7.0 for Mac OS X x86 (64-bit) (February 19, 2009)"

So... tell me again how I'd search for a symbol such as esc elem esc??

Bobby

On Wed, 17 Feb 2010 06:03:48 -0600, John Fultz <jfu...@wolfram.com> wrote:

> If you want to search for a typeset form in the Find/Replace dialog, I
> strongly
> recommend not doing this by hand. Instead, use Edit->Enter Selection
> while you
> have an instance of the thing you're looking for selected. Mathematica
> will
> automatically convert it to the right form for you.
>
> That's really all you need to know. The rest of my response is for
> anyone who
> wants to understand a bit more about the details of the system, and
> cares to
> hear any ramblings and ruminations I might have to offer about it.
>
> The form you're talking about is not documented exhaustively, but it is
> documented. In the help viewer, enter the following to find it...
>
> tutorial/StringRepresentationOfBoxes
>
> This form is the only way in which boxes can be represented inside of
> strings.
> That is, by the way, where the term "linear syntax" comes from. In a
> string,
> you must have a linear representation (as opposed to an expression tree)
> because
> strings are a linear sequence of characters.
>

> On Tue, 16 Feb 2010 03:52:49 -0500 (EST), divisor wrote:

>> Hello MathGroup:
>>
>> Solving a recent problem I had, Maxim mentioned that this string:
>>
>> Subscript[\[Alpha], 23]"
>>
>> can be used in the Find-Replace dialog by its evaluated equivalent
>> using this string:
>>
>> \!\(\[Alpha]\_23\)
>>
>> He called this "linear syntax".
>>
>> Since I will have other expressions that I need to convert into a form
>> like this, I tried to look this up in the help documentation. No luck
>> when trying these pages:
>>
>> guide/Syntax
>> tutorial/SpecialWaysToInputExpressions
>>

>> Can anyone tell me what this is called in the documentation or where I
>> can find documentation describing it?
>>
>> Thanks in advance.
>>
>> Roger Williams
>> Franklin Laboratory
>
>
>


--
DrMaj...@yahoo.com

John Fultz

unread,
Feb 19, 2010, 3:33:18 AM2/19/10
to
On Thu, 18 Feb 2010 14:50:32 -0600, DrMajorBob wrote:
>> Instead, use Edit->Enter Selection while you
>> have an instance of the thing you're looking for selected.
>>
> There is no "Enter Selection" option under "Edit" on my menu bar.

On Mac, it's Edit->Find->Use Selection for Find.


> If that option DID exist, I couldn't do it unless I already had that
> symbol or group of symbols present in the notebook, in order to select
> them.

True (except, technically, it would have to be in an open notebook; not
necessarily the notebook you were searching in). I didn't mean to imply
otherwise.


> $Version
>
> "7.0 for Mac OS X x86 (64-bit) (February 19, 2009)"
>
> So... tell me again how I'd search for a symbol such as esc elem esc??

You can use its longname. \[Element], in this case.

> Bobby


Sincerely,

John Fultz
jfu...@wolfram.com
User Interface Group
Wolfram Research, Inc.

>
> On Wed, 17 Feb 2010 06:03:48 -0600, John Fultz <jfu...@wolfram.com>=

John Fultz

unread,
Feb 19, 2010, 3:34:11 AM2/19/10
to
On Thu, 18 Feb 2010 05:16:32 -0500 (EST), Vince Virgilio wrote:
> On Feb 17, 6:58 am, John Fultz <jfu...@wolfram.com> wrote:
>
> SNIP
>
>>
>> This is all a bit unfortunate, because linear syntax can get extremely
>> unwieldy, and it's particularly inside of strings where it becomes most
>> unwieldy due to subtle issues with how the backslash escaping mechanism
>> works within strings. While it's possible to create such forms by hand,
>> we generally don't recommend it, and recommend instead using the various
>> built-in ways of auto- converting when necessary (the documentation

>> points to some of these).
>>
>> If it sounds like I'm not exactly thrilled about how we designed this
>> aspect of the system, that's because I'm not. There are several gotchas
>> I haven't fleshed out here, and with the hindsight that we now have, we
>> could probably have done this better. Maybe we will someday. In the
>> mean time, when you do have to interact with it, it's best to let the
>> system work it out for you. In the case of Find/Replace, that tends to
>> be pretty simple using the method I described in my first paragraph.
>>
>> Sincerely,
>>
>> John Fultz
>> jfu...@wolfram.com
>> User Interface Group
>> Wolfram Research, Inc.
>>
>
> What does WRI think of linear format based on Unicode, a la Murray
> Sargent III (and Office 2007)?
>
> http://www.unicode.org/notes/tn28/
>
> Vince Virgilio

Not speaking for WRI, but just speaking for myself. I think I'd have to say my
favorite linear format is still TeX. I wouldn't want to have to compose or read
anything non-trivial in either Mathematica's or Word's linear format. And as a
software developer, I wouldn't want to have to write either parsing or
serialization code for either format (yes, I have actually had to do this for
linear syntax in Mathematica...but it wasn't exactly fun!) .

Computer representations of typesetting map very easily to structured data
formats, such as Mathematica expressions and XML (or, more specifically,
MathML). In general, that's why XML has been so popular among software
developers. Highly structured data formats make it much less likely that
confused and all-too-human software developers will introduce bugs, or QA will
overlook those bugs, which will turn your Important Data Set into Unreadable
Data Pudding. It's true that structured data formats can lose some considerable
human readability. But TeX, linear syntax, and the Unicode technical note you
point to also fall down very quickly for non-trivial expressions.

On the other hand, some sort of linear format is going to be with us for a long
time. Mathematica still has to support copying and pasting into, for example,
plain text email. But I think as it evolves, it will evolve into something more
structured where there aren't obvious, human-readable/Mathematica-interpretable
linear representations. In fact, such an evolution has already been happening
(while maintaining backward compatibility, of course).

DrMajorBob

unread,
Feb 19, 2010, 3:33:29 AM2/19/10
to
Thanks!

Bobby

On Thu, 18 Feb 2010 15:19:42 -0600, John Fultz <jfu...@wolfram.com> wrote:

> On Thu, 18 Feb 2010 14:50:32 -0600, DrMajorBob wrote:
>>> Instead, use Edit->Enter Selection while you
>>> have an instance of the thing you're looking for selected.
>>>
>> There is no "Enter Selection" option under "Edit" on my menu bar.
>
> On Mac, it's Edit->Find->Use Selection for Find.
>
>
>> If that option DID exist, I couldn't do it unless I already had that
>> symbol or group of symbols present in the notebook, in order to select
>> them.
>
> True (except, technically, it would have to be in an open notebook; not
> necessarily the notebook you were searching in). I didn't mean to imply
> otherwise.
>
>
>> $Version
>>
>> "7.0 for Mac OS X x86 (64-bit) (February 19, 2009)"
>>
>> So... tell me again how I'd search for a symbol such as esc elem esc??
>
> You can use its longname. \[Element], in this case.
>
>> Bobby
>
>

> Sincerely,
>
> John Fultz
> jfu...@wolfram.com
> User Interface Group
> Wolfram Research, Inc.
>
>>

>> On Wed, 17 Feb 2010 06:03:48 -0600, John Fultz <jfu...@wolfram.com>

>> wrote:
>>
>>> If you want to search for a typeset form in the Find/Replace dialog, I
>>> strongly
>>> recommend not doing this by hand. Instead, use Edit->Enter Selection
>>> while you
>>> have an instance of the thing you're looking for selected. Mathematica
>>> will
>>> automatically convert it to the right form for you.
>>>
>>> That's really all you need to know. The rest of my response is for
>>> anyone who
>>> wants to understand a bit more about the details of the system, and
>>> cares to
>>> hear any ramblings and ruminations I might have to offer about it.
>>>
>>> The form you're talking about is not documented exhaustively, but it is
>>> documented. In the help viewer, enter the following to find it...
>>>
>>> tutorial/StringRepresentationOfBoxes
>>>
>>> This form is the only way in which boxes can be represented inside of
>>> strings.
>>> That is, by the way, where the term "linear syntax" comes from. In a
>>> string,
>>> you must have a linear representation (as opposed to an expression
>>> tree)
>>> because
>>> strings are a linear sequence of characters.
>>>

>>> On Tue, 16 Feb 2010 03:52:49 -0500 (EST), divisor wrote:
>>>> Hello MathGroup:
>>>>
>>>> Solving a recent problem I had, Maxim mentioned that this string:
>>>>
>>>> Subscript[\[Alpha], 23]"
>>>>
>>>> can be used in the Find-Replace dialog by its evaluated equivalent
>>>> using this string:
>>>>
>>>> \!\(\[Alpha]\_23\)
>>>>
>>>> He called this "linear syntax".
>>>>
>>>> Since I will have other expressions that I need to convert into a form
>>>> like this, I tried to look this up in the help documentation. No luck
>>>> when trying these pages:
>>>>
>>>> guide/Syntax
>>>> tutorial/SpecialWaysToInputExpressions
>>>>
>>>> Can anyone tell me what this is called in the documentation or where I
>>>> can find documentation describing it?
>>>>
>>>> Thanks in advance.
>>>>
>>>> Roger Williams
>>>> Franklin Laboratory
>
>


--
DrMaj...@yahoo.com

0 new messages