4

I've got the following equation

\begin{align*}
  \hat{\boldsymbol{\eta}} = \underset{(\boldsymbol{\beta}_{1}, \ldots,
  \boldsymbol{\beta}_{d}, \boldsymbol{\theta}) \in B_{1} \times
  \cdots \times B_{d} \times \Theta}{\text{arg max }}
  \ell(\boldsymbol{\beta}_{1}, \ldots, \boldsymbol{\beta}_{d}, \boldsymbol{\theta})
\end{align*}

resulting in

Problematic spacing

I would like for the expression under "arg max" to be positioned a bit lower so that the large horizontal spaces disappear.

4 Answers 4

8

In the example below, the first equation reproduces what you have right now, while the second equation achieves your stated objective (by encasing the subscript material in a \mathclap directive). Note the use of \strut to force a bit more whitespace between the two lines. Even so, the reader may have to study the equation for more time than should be required to figure out what the material in the second line pertains to.

The third equation below uses the \substack macro to insert a judiciously-chosen line break in the subscript material. IMNSHO, breaking up the subscript material into two parts strikes a reasonable balance between compact appearance and readability of the equation.

Note that the code also defines a dedicated "math operator" named \argmax.

enter image description here

\documentclass{article}
\usepackage{mathtools,bm}
\DeclareMathOperator*{\argmax}{arg\,max} 

\begin{document}
\[
  \hat{\bm{\eta}} = \argmax_{(\bm{\beta}_{1}, \dots,
  \bm{\beta}_{d}, \bm{\theta}) \in B_{1} \times
  \cdots \times B_{d} \times \Theta}
  \ell(\bm{\beta}_{1}, \dots, \bm{\beta}_{d}, \bm{\theta})
\]

\bigskip
\[
  \hat{\bm{\eta}} = \argmax_{\strut\mathclap{(\bm{\beta}_{1}, \dots,
  \bm{\beta}_{d}, \bm{\theta}) \in B_{1} \times
  \cdots \times B_{d} \times \Theta}}
  \ell(\bm{\beta}_{1}, \dots, \bm{\beta}_{d}, \bm{\theta})
\]

\bigskip
\[
  \hat{\bm{\eta}} = \argmax_{\substack{(\bm{\beta}_{1}, \dots,
  \bm{\beta}_{d}, \bm{\theta}) \in \\ (B_{1} \times
  \cdots \times B_{d} \times \Theta)}}
  \ell(\bm{\beta}_{1}, \dots, \bm{\beta}_{d}, \bm{\theta})
\]

\end{document} 

Addendum: The \substack and \mathclap approaches may be combined, to create the following look:

enter image description here

\documentclass{article}
\usepackage{mathtools,bm}
\DeclareMathOperator*{\argmax}{arg\,max}

\begin{document}

\[
  \hat{\bm{\eta}} = \argmax_{\mathclap{\substack{
     (\bm{\beta}_{1}, \dots,\bm{\beta}_{d}, \bm{\theta}) \in \\ 
     (B_{1} \times \cdots \times B_{d} \times \Theta)}}} \,
  \ell(\bm{\beta}_{1}, \dots, \bm{\beta}_{d}, \bm{\theta})
\]

\end{document} 
2
  • I like the third one (the line break makes it more readable). Is it possible to reduce the horizontal space? Commented Jun 5, 2015 at 13:16
  • @user2249626 - Sure, just encase the entire two-line subscript in a \mathclap directive. I'll post an addendum to show how to do this.
    – Mico
    Commented Jun 5, 2015 at 14:30
5

I would suggest an alternative notation:

Sample output

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{equation*}
  \hat{\boldsymbol{\eta}} = \operatorname{arg\,max}\bigl\{
  \ell(\boldsymbol{\beta}_{1}, \ldots, \boldsymbol{\beta}_{d},
  \boldsymbol{\theta}) : (\boldsymbol{\beta}_{1}, \dots,
  \boldsymbol{\beta}_{d}, \boldsymbol{\theta}) \in B_{1} \times
  \cdots \times B_{d} \times \Theta \bigl\}
\end{equation*}


\end{document}
2
  • Should that maybe be \colon instead of :?
    – Mico
    Commented Jun 4, 2015 at 14:52
  • 1
    @Mico I only use \colon when defining a function, in that case (I think) it's a normal : which is a relation, exactly the same as \mid.
    – Manuel
    Commented Jun 4, 2015 at 15:01
2

Two ways: \mathclap (requires mathtools package) or a \stackunder (requires stackengine package), which allows vertical underset distance to be set.

\documentclass{article}
\usepackage{amsmath,stackengine,mathtools}
\stackMath
\begin{document}
\begin{align*}
  \hat{\boldsymbol{\eta}} = \underset{\mathclap{(\boldsymbol{\beta}_{1}, \ldots,
  \boldsymbol{\beta}_{d}, \boldsymbol{\theta}) \in B_{1} \times
  \cdots \times B_{d} \times \Theta}}{\text{arg max }}
  \ell(\boldsymbol{\beta}_{1}, \ldots, \boldsymbol{\beta}_{d}, \boldsymbol{\theta})
\end{align*}

\begin{align*}
\renewcommand\useanchorwidth{T}
  \hat{\boldsymbol{\eta}} = \stackunder[5pt]{\text{arg max }}{
  \scriptstyle(\boldsymbol{\beta}_{1}, \ldots,
  \boldsymbol{\beta}_{d}, \boldsymbol{\theta}) \in B_{1} \times
  \cdots \times B_{d} \times \Theta}
  \ell(\boldsymbol{\beta}_{1}, \ldots, \boldsymbol{\beta}_{d}, \boldsymbol{\theta})
\end{align*}

\end{document}

enter image description here

2

Third Fourth way: \smashoperator (requires mathtools package), which does the same as \mathclap in a sub and superscript, but also features an optional argument in case you only want to “clap” one side, e.g., \smashoperator[r]{..}.

\documentclass{scrartcl}
\usepackage{mathtools,amssymb}
\DeclareMathOperator*{\argmax}{arg\,max}

\begin{document}
\begin{align*}
  \hat{\boldsymbol{\eta}} = \smashoperator{\argmax_{(\boldsymbol{\beta}_{1}, \ldots,
  \boldsymbol{\beta}_{d}, \boldsymbol{\theta}) \in B_{1} \times
  \cdots \times B_{d} \times \Theta}}
  \ell(\boldsymbol{\beta}_{1}, \ldots, \boldsymbol{\beta}_{d}, \boldsymbol{\theta})
\end{align*}
\end{document}

In any case I would add some space manually like \quad \smashoperator{..} \quad. Or even normal text rather than as a subscript.

3
  • Mico, is that edit what you mean? I think the spacing doesn't change, just added a few words.
    – Manuel
    Commented Jun 4, 2015 at 14:57
  • Indeed, the \smashoperator[r]{...} variant that may be most appropriate (at least in terms of preserving readability). For sure, I'd say that its result looks a lot better than what's produced by \mathclap.
    – Mico
    Commented Jun 4, 2015 at 15:02
  • Yep, probably \smashoperator[r]{..} \quad is what I would do, or not write it in the subscript at all.
    – Manuel
    Commented Jun 4, 2015 at 15:11

You must log in to answer this question.

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