4

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.

MWE

\documentclass{article}
\usepackage[TS1,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\begin{document}

\begin{equation}
{\hat{f}_i}_{\mid A}
\end{equation}

\end{document}

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 May 24 '17 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. – Konrad Rudolph May 24 '17 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 Jan 17 at 20:41
9

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

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

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

\hat{f}_{i\,|A}

which I'd prefer.

Here's the code.

\documentclass{article}

\begin{document}

\begin{equation}
\hat{f}_{i\,|A}
\qquad
{{}\hat{f}_i}_{|A}
\end{equation}

\end{document}

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 Jan 17 at 20:42
  • @LSpice Surely not \rvert. – egreg Jan 17 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 Jan 17 at 20:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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