I have a function fthat I want to restrict to a certain sub-domain of the domain it has been originally defined for. Usually, in mathematics this is illustrated by a vertical bar followed by the restricted set in the lower right of the function symbol. E.g. usually I write

f_{\mid A}

which means f restricted to the set A.

Unfortunately, I have a sequence of functions f_i that has already a subscript. If I write

f_{i_{{\mid A}}}

I do net get an LaTeX error, but the result is semantically wrong. \bar A is not a subscript of i which happens to be a subscript of f, but \mid A is a subscript of f_i. Especially, the font size of {\mid A} should not be smaller than the size of i, but have the same size.

However, if a write

{f_i}_{\mid A}

(which btw would be semantically correct) I get a "double subscript error".

Alternatively, I could write

f_{i \; \mid A}

and get the correct font size for \mid A but it is placed too high. \mid A should be below i.




{\hat{f}_i}_{\mid A}


As I have already found out, the problem occurs only with the accent above f. But I need the accent there.

  • f_{\bar{A}}, f_{i_{\bar{A}}} ... ?
    – Zarko
    Commented May 24, 2017 at 11:41
  • You say that “\mid A should be below i.” But should it really? The convention I’ve seen before is that double subscripts are collapsed and put on the same subscript level, at the same size, and sometimes separated by a comma/semicolon. Commented May 24, 2017 at 17:27
  • Although I think no-one will be confused, your post and @Zarko's comment both slip into using \bar in place of \mid.
    – LSpice
    Commented Jan 17, 2019 at 20:41

1 Answer 1


It is a known problem, see Why am I getting a double subscript error?:


will issue a “double subscript” error. The cure is adding {} to the base.

On the other hand, I can't see so much a difference between this and


which I'd prefer.

Here's the code.





enter image description here

Note that \mid A is semantically wrong, although leading to the same result.

  • Surely the semantically right symbol is not \mid or | but \rvert?
    – LSpice
    Commented Jan 17, 2019 at 20:42
  • @LSpice Surely not \rvert.
    – egreg
    Commented Jan 17, 2019 at 20:43
  • Why not? I thought that indeed this was exactly what it was for, a vertical bar on the right. Surely | is semantically neutral and, in particular, has no idea where or why it is in a formula.
    – LSpice
    Commented Jan 17, 2019 at 20:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .