This simple task is giving me trouble. Suppose I'd like to take the output from


and post-process it to append a vertical bar like

$$ {x^3\over 3}\Bigg|_0^1 $$

or a set of left & right brackets like

$$ \left[\frac{x^3}{3}\right]_0^1 $$

I am trying to figure out the best way to approach this problem. Is to convert the output to a string and then use StringJoin?

  • $\begingroup$ I thought there is answer for the above here mathematica.stackexchange.com/questions/30459/… (by @Jens). May be I overlooking something in the details... $\endgroup$
    – Nasser
    Aug 14, 2013 at 23:36
  • $\begingroup$ Based on the time stamps, I believe I posted my question just a little before Jens posted that answer there (or certainly before I saw it). $\endgroup$
    – JohnD
    Aug 15, 2013 at 0:18
  • 1
    $\begingroup$ sure, I did not look at times, just wanted to bring your attention that there is an answer there that might be what you wanted. $\endgroup$
    – Nasser
    Aug 15, 2013 at 0:22

1 Answer 1


In practice, I think it's inevitable that we'll have to work with box forms (which aren't that hard, but rather low-level functions) if you plan to typeset structures that aren't valid Mathematica expressions. The vertical right bracketing bar is one example for this. Also, square brackets in StandardForm would be translated to round brackets in TraditionalForm if you supply them to Mathematica as an expression. So it doesn't usually lead to robust results if you construct fake but valid expressions that happen to look like what you need. You have to construct the box structures yourself.

First, you want to preserve the two-dimensional structure of the integral, so I use DisplayForm:

t = TraditionalForm[Integrate[x^2, x]];

   StyleBox["\[RightBracketingBar]", SpanMinSize -> 2]}]


This is a type of display that by default doesn't render the content in TraditionalForm, even though we already specified it in t. So we have to add that again later. The super and subscripts can be added to this in a "less low-level" way, because they don't conflict with Mathematica syntax. So instead of having another RowBox or some other ...Box, I wrap the last object simply in Subsuperscript, and then combine it (if necessary) with other objects in a Row, Column or Grid:

    StyleBox["\[RightBracketingBar]", SpanMinSize -> 2]}]
  ], 1, 2]

sub super

You get the final desired output by adding the TraditionalForm again, as mentioned above:



  • $\begingroup$ Thanks for your remark, I should stop posting in the middle of the night :) $\endgroup$
    – Kuba
    Aug 15, 2013 at 7:50

Your Answer

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

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