MathGroup Archive 2013

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

Search the Archive

Unwanted parentheses appearing in a notebook that is opened by a

  • To: mathgroup at smc.vnet.net
  • Subject: [mg131451] Unwanted parentheses appearing in a notebook that is opened by a
  • From: Alexei Boulbitch <Alexei.Boulbitch at iee.lu>
  • Date: Mon, 8 Jul 2013 04:22:42 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net

Dear community,

I am writing an interactive document and try to make in-line buttons. Upon pressing such buttons would create and bring up separate notebooks containing some explanations or a reminding. One example of the code of such a button is as follows:

Button["Show it",
 CreateDocument[
  Column[{
    Spacer[30],
    TextCell["some explanatory text:" , "Text", FontSize -> 20],
    Spacer[10],
    TextCell[
      Row[{Spacer[50], Style["\[CapitalPhi]=", 24, Italic],
        Style[HoldForm[(\[Phi]*\[Tau]^2*\[Nu]^3*\[Omega]*\[Theta][
            1 - \[Nu]*\[Omega]])/(\[Tau]^2*\[Nu]^2 +
            2*\[Delta]*\[Nu]*\[Tau] + \[Omega]^2)^2], Italic, 30]}],
      TextAlignment -> Center] // TraditionalForm
     }, Alignment -> Left],
      WindowTitle -> "An expression", WindowSize -> {400, 300}],
     ImageSize -> {70, 18}, Background -> Brown,
     BaseStyle -> {"GenericButton", Bold}]

Upon its evaluation a button is created. This button one can copy-pasted into a necessary part of the text, say, into an in-line cell. It works, in principle. It works irreproachably, if there is only a text or a text and any graphics inside.

With formulas it is more complex. If the button contains a formula such as the one in the code above, and if I press the button for the first (second and so on) time I get the document open with the formula that looks as you would expect the following expression:

F==(f t^2 n^3 v q(1-n v))/(t^2 n^2+2 d n t+v^2)^2

if it is shown in the TraditionalForm. And that is what I intended to.

Now comes my "however":

However, if I save/close the main document (the one containing the button code and the button itself), then open it once more and press the button, I get this:

F==((((f t^2) n^3) v) q(1-n v))/(t^2 n^2+((2 d) n) t+v^2)^2.

Also in the traditional form. As you see there is a lot of unwanted parentheses appeared in each place of multiplication. The question is how can I get rid of these parasitic parentheses?

There is an evident work around. The expression in question may be saved as an image and in that form passed into the button statement. It may even be edited outside of Mathematica and saved as an image. Then the code is like this

Button["Show it",
 CreateDocument[
  Column[{
    Spacer[30],
    TextCell["some explanatory text:" , "Text", FontSize -> 20],
    Spacer[10],
    ExpressionCell[
     Row[{Spacer[50],
       Show["Paste here the image of a formula", ImageSize -> 250]}]]
     }, Alignment -> Left],
  WindowTitle -> "An expression", WindowSize -> {400, 300}],
 ImageSize -> {70, 18}, Background -> Brown,
 BaseStyle -> {"GenericButton", Bold}]

This is the way, of course, but I am not fond of it. The reason is that my document contains dozens of such buttons. If each of them will contain an image or two, the document size will rise too rapid.

Thank you in advance,

Alexei



Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone :  +352-2454-2566
Office fax:       +352-2454-3566
mobile phone:  +49 151 52 40 66 44

e-mail: alexei.boulbitch at iee.lu






  • Prev by Date: Re: User-defined Probability Mass Function
  • Next by Date: color surface according to absolut value of the gradient
  • Previous by thread: Re: how to write ParallelSubmit in a Do loop? trying to use up all CPU
  • Next by thread: color surface according to absolut value of the gradient