MathGroup Archive 2005

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

Search the Archive

Re: holding boxes verbatim

  • To: mathgroup at smc.vnet.net
  • Subject: [mg56258] Re: holding boxes verbatim
  • From: Chris Chiasson <chris.chiasson at gmail.com>
  • Date: Wed, 20 Apr 2005 05:31:54 -0400 (EDT)
  • References: <00aa01c544e3$6db4af30$6400a8c0@Main>
  • Reply-to: Chris Chiasson <chris.chiasson at gmail.com>
  • Sender: owner-wri-mathgroup at wolfram.com

As a follow up to those who requested clairification:

Consider the simple examples:

HoldAllComplete[b*(a + s*m)] (*notice the order of the vairables
inside the inner Times is rearranged on output*)
HoldAllComplete[(x)^(1/2)] (*notice the reformatting of an expression
to the power 1/2 is reformatted to the square root of the expression*)
HoldAllComplete[(x/y)(h/g)] (*notice the elimination of the parenthesis*)

The reason these things happen is that the boxes are parsed into
Mathematica input such as Times[b,Plus[a,Times[s,m]]].

I need a way to work directly with the boxes, but still at least do
some variable substitution.

Thank you again for your time.


On 4/19/05, Carl K. Woll <carlw at u.washington.edu> wrote:
> "Chris Chiasson" <chris.chiasson at gmail.com> wrote in message
> news:d42l18$3gf$1 at smc.vnet.net...
> > Dear Math Group gurus,
> >
> > Mathematica is annoying me. I would like some way to type in a two
> > dimensional box form (representing an arbitrary expression) and assign
> > it to a symbol. I would then like to be able to operate on the
> > expression by, for instance:
> > 1 printing it
> > 2 printing it with some variables' values substitued into it
> > 3 and finally evaluating it
> >
> > Hold and its variants do not do the job because they prevent
> > expression evaluation, but I need something that will keep its box
> > form exactly as I have typed it.
> >
> > Please, how does one do this?
> >
> > A method for doing this is very useful to me because my professors
> > like to see the variables substitued into the original (not
> > Mathematica reparsed original, but verbatim original) equations.
> >
> > Thank you for your very valuable time,
> 
> An example of the desired behavior would be helpful. At any rate, have you
> tried using HoldForm? For example:
> 
> expr = HoldForm[2^(x+1)];
> expr
> expr /. x->2
> ReleaseHold[ expr /. x->2 ]
> 
>  x + 1
> 2
>  2 + 1
> 2
> 8
> 
> I used InputForm instead of a 2D box form for expr for legibility, but using
> a 2D box form for expr won't cause any problems.
> 
> If the above is not helpful, please give an example of the behavior you
> desire.
> 
> Carl Woll
> 
> 


-- 
Chris Chiasson
Kettering University
Mechanical Engineering
Graduate Student
1 810 265 3161


  • Prev by Date: Re: (x-y) DiracDelta[x-y] does not simplify to 0
  • Next by Date: Re: How can I get a nonscalar logical variable into a compiled function?
  • Previous by thread: Re: holding boxes verbatim
  • Next by thread: Re: Re: holding boxes verbatim