How can I get the the term shown in the picture:
$\underline{x_a}$
should be centered under max.
What I know is the structure below, but this is not what I am looking for:
$max_{\atop \underline{x_a}}^k$
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityIf \underline
is really needed this is a matter of taste (I just kept it)
But the centering can be achieved by using \underset
. \max
is declared as an operator, as far as I know.
\documentclass{article}
\usepackage{mathtools}
\begin{document}
$\underset{\underline{x_{a}}}{\max}^k$
\end{document}
\underline
...
\underline
is actually not wrong, rather underlining that really look nice in general
\underline
is necessary since x
is a vector of a boolean variable.
If you want to keep the standard notation for \max
, you can play some tricks:
\documentclass{article}
\usepackage{amsmath}
\makeatletter
\newcommand{\varmax}[1]{%
\mathop{}\!{\mathpalette\varmaxback{#1}}\!%
\mathop{\hphantom{{}^{#1}}\!\max\nolimits^{#1}}\limits
}
\newcommand{\varmaxback}[2]{%
\sbox0{\mathsurround=0pt $#1{}^{#2}$}%
\kern-\wd0
}
\begin{document}
$\varmax{k}_{\underline{x_a}}$
\begin{align*}
X&=\varmax{k}_{\underline{x_a}}=Y
\\
X&=\max_{\underline{x_a}}
\end{align*}
\end{document}