MathGroup Archive 2006

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

Search the Archive

"Anti-Comments"?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg69096] "Anti-Comments"?
  • From: AES <siegman at stanford.edu>
  • Date: Wed, 30 Aug 2006 06:32:44 -0400 (EDT)
  • Organization: Stanford University
  • Sender: owner-wri-mathgroup at wolfram.com

[Apologies if my earlier version of this query was answered and I missed 
it.]

You can put text comments inside an Input cell using the (* ---- *) 
syntax and they'll be displayed, but not executed.  

Is it possible to have an "anti-comment" capability -- maybe indicated 
by an anti-comment syntax like  *( --Input stuff-- )* -- that will do 
the opposite?

That is, I'd like to be able to insert properly coded Input expressions 
inside a Text cell and have them be executed -- *without* messing with 
the basic Text cell structure.

Example: Define, using an Input cell in the initialization part of a 
notebook,

   results := Module[{}, Plot[{x, Sin[a x]}, {x, 0, Pi}]

and then, later in the notebook, have Text cells (*standard* Text cells) 
with contents like:

   But if we change the input parameter to be *( a = 3 )*, the
   new *( result )* looks quite different:

         - -  plot shows up here --

   And if we chose *( a = 4 )* the *( result )* is really
   different:

         - -  another plot shows up here --

NOTE!!  I'm not asking how one might define any such *( )* commands to 
accomplish this result -- I'm just using them to illustrate how the 
executable subcells would fit into the text cells.  

Section 1.1.10 of The Book tells how to insert a differently formatted 
formula in a text cell using ctrl-( and ctrl-).  My question is: using 
any kind of menu commands or mousing around, can an inserted subcell 
that is displayed inside a standard Text (or Heading) cell be made 
executable???


  • Prev by Date: transforming a rule of lists to a list of rules
  • Next by Date: Re: restart?
  • Previous by thread: Re: transforming a rule of lists to a list of rules
  • Next by thread: Re: if Magnification is an Option for Cell, why is it ... not?