Hopefully a simple one...Does anyone know how to preserve "bracket stretching" in a string. For instance, if I copy a formula and use it as a plot label or in any string the brackets revert back to (...) and don't keep the stretched appearance they have when used as an input.


So people can see what I am seeing: So when I input my formula as a Mathematica input to be actually used for calculation and plotting: enter image description here

If I take the same formula in a string, using TraditionalForm[...] enter image description here

As can be seen the parenthesis are not stretched around the formula as they should be.

  • 1
    $\begingroup$ Diid you try TraditionalForm? $\endgroup$ Jul 8, 2016 at 12:02
  • $\begingroup$ @AlexeiBoulbitch Unfortunately this does not work :( $\endgroup$
    – user27119
    Jul 8, 2016 at 12:49
  • $\begingroup$ What does not work? Please publish your code and, may be, an image of what do you have and what are you after. $\endgroup$ Jul 8, 2016 at 13:06
  • 1
    $\begingroup$ TraditionalForm does not change a String, remove the quotation marks around the expression within the Print. $\endgroup$
    – Bob Hanlon
    Jul 8, 2016 at 14:26
  • 1
    $\begingroup$ Alternatively, convert to TraditionalForm prior to converting to String, i.e., Print[expr // TraditionalForm // ToString] $\endgroup$
    – Bob Hanlon
    Jul 8, 2016 at 14:40

1 Answer 1


Your code contains numerous syntax errors. The first formula has no sense in Mma. I tried to rewrite its part that seems reasonable:

expr = 10*
Log[10, Re[(1/Subscript[R, p] + 1/(2 \[Nu]*\[Pi]*L*I) + 
    2 \[Pi]*\[Nu]*Subscript[C, p]*I)^-1]] + Subscript[P, 0];

Then you may do the following:


enter image description here

There are also multiple other ways to represent a formula in Mma, and give it the desired form. However, your explanation does not show, what is precisely your need. Anyway, Print is the last way I would use for this purpose.

Have fun!

  • $\begingroup$ Thanks, for the input. I don't understand what you mean by syntax errors. The code compiles and behave as it should. If there were syntax errors it would not compile, if you are referring to the double-stamp R and i, then yes these are usually Re[..] and I in mathematica but I changed it for the purposes of being used in a label. Thanks for the help. $\endgroup$
    – user27119
    Jul 8, 2016 at 15:01
  • $\begingroup$ There are two left square brackets and three right ones. Further, in your expression {P0} and nu have no sense. This I mean by syntax errors. $\endgroup$ Jul 11, 2016 at 7:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.