Skip to main content
1 of 3
Jens
  • 97.9k
  • 7
  • 215
  • 510

Here is the formatting command that does this:

pvB /: MakeBoxes[pvB[n1_, n2_, x_, s_, m0_, m1_], TraditionalForm] :=

  RowBox[{SubscriptBox["B", 
    RowBox[{Sequence @@ Riffle[Table["0", {n1}], "\[ThinSpace]"], 
      "\[ThinSpace]", 
      Sequence @@ Riffle[Table["1", {n2 - n1}], "\[ThinSpace]"]}]], "(",
    Sequence @@ Riffle[Map[ToBoxes, {x, s, m0, m1}], ","], ")"}]

For example:

pvB[2, 4, x, s, m0, m1] // TraditionalForm

$B_{0\,0\,1\,1}(s,m0,m1)$

The \[ThinSpace] will display as a small empty string, but is useful to insure that the indices are separated by just a tiny bit.

Jens
  • 97.9k
  • 7
  • 215
  • 510