2

How do I get something like this in LaTex? I have tried the align-environment, but can't get the vertical text (argmin) right.enter image description here

  • 1
    (1) welcome (2) the xy or (perhaps better) tikz-cd package – daleif Dec 9 '17 at 13:18
  • there's traditionally a thin space in arg\,min. – barbara beeton Dec 9 '17 at 18:26
3

You get better arrows with tikz-cd:

\documentclass{article}
\usepackage[sc]{mathpazo}
\usepackage{amsmath}
\usepackage{tikz-cd}
\usepackage{graphicx}

\DeclareMathOperator{\argmin}{arg\,min}

\begin{document}

\begin{tikzcd}[row sep=0pt]
\displaystyle\frac{1}{N}\sum_{i=1}^{N} q(w_{i},\theta)
  \arrow[r]
&
\mathbb{E}[q(w,\theta)]
\\
\rotatebox[origin=c]{90}{$\argmin$}
&
\rotatebox[origin=c]{90}{$\argmin$}
\\
\hat{\theta} \arrow[r,red] & \theta
\end{tikzcd}

\end{document}

enter image description here

2

For example, environment array can be used for the alignment:

\documentclass{article}
\usepackage{amsmath}  % for \DeclareMathOperator
\usepackage{dsfont}   % for \mathds
\usepackage{color}    % for \color{red}
\usepackage{graphicx} % for \rotatebox

\DeclareMathOperator*{\argmin}{argmin}

\begin{document}
\[
  \begin{array}{ccc}
    N^{-1} \sum_{i=1}^{N} q(w_i, \theta)
    & \longrightarrow & \mathds{E} [q(w, \theta)] \\[1.5ex]
    \rotatebox{90}{$\argmin$} & &
    \rotatebox{90}{$\argmin$} \\[1ex]
    \hat\theta & \color{red}\longrightarrow & \theta_0
  \end{array}
\]
\end{document}

Result

1

Another solution with alignat,and eqparbox:

\documentclass{article}
\usepackage{mathtools, amsfonts} %
\DeclarePairedDelimiterXPP{\Exp}[1]{\mathbb{E}}[]{}{#1}
\DeclareMathOperator*{\argmin}{argmin}
\usepackage[svgnames]{xcolor} %
\usepackage{graphicx} %
\usepackage{eqparbox}
    \newcommand\eqmathbox[2][M]{\eqmakebox[#1]{$\displaystyle#2$}}

\begin{document}

  \begin{alignat*}{2}
   \eqmathbox[ML]{ N^{-1} \sum_{i=1}^{N} q(w_i, \theta)}
    & \longrightarrow{} & \eqmathbox[MR]{\Exp{q(w, \theta)}} \\%[1.5ex]
    \eqmathbox[ML]{\rotatebox{90}{$\argmin$}} & &
    \eqmathbox[MR]{\rotatebox{90}{$\argmin$}} \\[-0.7ex]
    \eqmathbox[ML]{\hat\theta} & \color{Crimson}\longrightarrow & \eqmathbox[MR]{\theta_0}
  \end{alignat*}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.