[Tex/LaTex] Using underset and overset together

subscriptssuperscripts

I would like to use underset and overset together above and below the word. Current output looks like this:

\begin{equation}
    v_t(j)=max^{N}_{i=1}v_{t-1}(i)a_{ij}b_j(o_t)
\end{equation}

enter image description here

I would like both the superset and the underset to be placed exactly above and below the max.

Best Answer

Welcome to TeX.SE! As egreg pointed out in the comments, you can achieve what you want using \max_{i=1}^{N}, like so:

\documentclass[12pt]{article}
\usepackage{amsmath} % Only for the equation* environment

\begin{document}
  \begin{equation*}
    v_t(j) = \max_{i=1}^{N}v_{t-1}(i)a_{ij}b_j(o_t)
  \end{equation*}
\end{document}