16

I want to obtain the below output from below code:

arg max probability i
i ∈ child(v)

I have the below code:

\documentclass[runningheads,a4paper]{llncs}

\usepackage{amssymb}
\setcounter{tocdepth}{2}
\usepackage{graphicx}
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
\usepackage{url}

\usepackage{float}
\usepackage{booktabs}
\usepackage{multirow}% http://ctan.org/pkg/multirow
\usepackage{hhline}% http://ctan.org/pkg/hhline

\usepackage{mathtools}

\usepackage{amsmath}
\usepackage[english]{babel}
\usepackage{booktabs,array}



\usepackage{lipsum}
\setcounter{secnumdepth}{5}
\begin{document}


\begin{align*}
         arg \! max \! probability \! i   \\
           i \in \! child(V)
\end{align*}

\end{document}

but the result does not make space in the first line

argmaxprobabilityi
i∈child(V)

How can i fix the missed spaces?

2

3 Answers 3

24

\! creates a small negative space (i.e. moves things closer together). You could use \, for a small space, or just \ (or ~) for a bigger space.

\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator\prb{probability}
\DeclareMathOperator\child{child}
\begin{document}
\begin{align*}
         \arg \ \max \ \prb \ i   \\
           i \in \ \child(V)
\end{align*}
\end{document}

enter image description here

Note the use of \DeclareMathOperator from the amsmath package to get the correct spacing and fonts for 'probability' and 'child'. You don't need this for 'arg' or 'max' because those commands are already defined.

1
  • 4
    Note that the backslash requires a space after it, it should really be thought of as 'backslash space". I.e., \_ but the underscore is space. Jun 19, 2017 at 20:05
4
\documentclass[a4paper]{article}


\usepackage{mathtools}
\DeclareMathOperator*{\argmax}{arg max}

\begin{document}


    \[
    \argmax\limits_{i \in  \mathrm{child}(V)}  \text{probability } i 
\]

\end{document}
4

All you need is this, I guess:

\documentclass[runningheads,a4paper]{llncs}
\usepackage{mathtools}

\DeclareMathOperator*{\argmaxprob}{arg\,max\,probability}
\DeclareMathOperator{\child}{child}

\begin{document}

    \[ \argmaxprob_{i\in \child(V)} i\]%

\end{document} 

enter image description here

You must log in to answer this question.

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