# Normal mode in Math when assigning function

I am curious about your thoughts of the use of math vs normal mode in this Equation:

$$\hat{P}^{\textnormal{Naive\textsubscript{3}}}_{d,h} = \begin{cases} P_{d-7,h},\quad \textrm{DoW}(d) = 1, 6, 7\\ P_{d-1,h},\quad \textrm{otherwise}, \end{cases}$$


Where DoW(d) is a function of the Day of the Week that depends on d which takes the value 1 if Monday, 2 if Tuesday etc. I have heard that abbreviation in general short be in normal mode, but what about a function that is an abbreviation? I chose to put the DoW in normal mode and the (d) in math mode above, but I think it looks a bit funny.

Any thoughts?

You can call your functions any way you like, so long as you clearly explain the notation.

Don't use \textnormal or \textrm for something that's mathematical in nature, such as textual superscripts or subscripts.

There's also no reason for \textsubscript in math mode.

As observed by eagle-eyed Mico, you should use & inside cases and not \quad.

\documentclass{article}
\usepackage{amsmath}

\DeclareMathOperator{\DoW}{DoW} % similar to sin or log

\begin{document}

$$\hat{P}^{\mathrm{Naive}_3}_{d,h} = \begin{cases} P_{d-7,h}, & \DoW(d) = 1, 6, 7\\ P_{d-1,h}, & \text{otherwise}, \end{cases}$$

\end{document}


The input is even easier.

• +1. I'd also be inclined to replace both instances of \quad with & to assure proper vertical alignment of the "if" compoments of the cases construct. (Right now, the alignment is there, but it's more by happy coincidence than by deliberate design.)
– Mico
Jan 2 at 22:27
• @Mico I didn't even see it. Jan 2 at 22:34