Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Re: Two-dimensional input

  • To: mathgroup at
  • Subject: [mg31564] Re: [mg31183] Two-dimensional input
  • From: Omega Consulting <omega_consulting at>
  • Date: Sun, 11 Nov 2001 16:26:07 -0500 (EST)
  • Sender: owner-wri-mathgroup at

At 11:19 PM 10/15/2001, Garry Helzer wrote:
>To accompany some lecture notes I am developing I would like to define a
>pair of functions of x that could be entered from the keyboard as
>x^\[UpArrow] and x^\[DownArrow]. The problem is that \[UpArrow] is a
>binary operator and \[DownArrow] is a letterlike form. Is there a way? I
>could, of course, use something like superminus and subminus, but I really
>prefer the arrows.

To have a certain kind of input interpreted as an expression, you must 
define how to convert the boxes into that expression. For example,

In[]:= MakeExpression[SuperscriptBox["x","\[UpArrow]"],form_] :=

In[]:= \!\(\(x\^\[UpArrow]\)[1]\)
Out[]= XUpArrow[1]

If you want output to use the special form, you must define how to turn an 
expression into boxes.

In[]:= MakeBoxes[XUpArrow[arg_], form_] :=
   RowBox[{SuperscriptBox["x","\[UpArrow]"], "[",MakeBoxes[arg],"]"}]

In[]:= \!\(\(x\^\[UpArrow]\)[1]\)
Out[]= \!\(\(x\^\[UpArrow]\)[1]\)

Omega Consulting
"The final answer to your Mathematica needs"

Spend less time searching and more time finding.

  • Prev by Date: Rendering Error in Raster and RasterArray
  • Next by Date: Re: style sheeting
  • Previous by thread: Re: Rendering Error in Raster and RasterArray
  • Next by thread: Re: style sheeting