2

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

\begin{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}
\end{equation}

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?

1 Answer 1

2

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}

\begin{equation} 
\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{equation}

\end{document}

The input is even easier.

enter image description here

2
  • +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
    Commented Jan 2, 2023 at 22:27
  • @Mico I didn't even see it.
    – egreg
    Commented Jan 2, 2023 at 22:34

You must log in to answer this question.

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