Q:

How to avoid RecursionLimit error when using Interpretation formatting?

I am trying to define a function that has similar behavior as Indexed. Here is the code
Format[me : f[a_, i__]] := Interpretation[Subscript[a, i], me];
f[a_ + b_, i__] := f[a, i] + f[b, i];

For example, f[a + b, 1] will give
 
as expected. However, if I try ?f to view the code, I will run into the RecursionLimit error. The question is how to appropriately define the format to avoid this error, while still give the desired subscript formatting behavior? 

A:

I would use:
f /: MakeBoxes[f[a_, i__], form:StandardForm] := With[
    {s = MakeBoxes[Subscript[a, i], form]},
    InterpretationBox[s, f[a, i]]
]

instead.

