3

enter image description here

When using displayed (in contrast to inline) equations LaTeX center-aligns subscripts:

\Pr\limits_{{r \leftarrow_R \{0,1\}^n}} [ ... ]

However, I like them to be left aligned. This can be done by using \hspace

\Pr\limits_{\hspace{1cm}{r \leftarrow_R \{0,1\}^n}}  [ ... ]

But this is not a good solution, since the parameter of \hspace must be specified manually. (It differs based on the font and the length of the subscript.)

What other option I have?

Sadeq Dousti
  • 4,380

1 Answers1

4
\documentclass{article}
\usepackage{amsmath}

\newcommand{\Prl}[1]{
  \mathop{\oalign{$\Pr$\hfill\cr
    $\begin{subarray}{l}#1\end{subarray}$\hfill\cr}}
}

\begin{document}
\begin{gather}
\Prl{r \leftarrow_R \{0,1\}^n}abc \\
\Prl{r \leftarrow_R \{0,1\}^n\\abc}abc
\end{gather}
\end{document}

But I find this layout horrible, particularly in in-line formulas. :)

David Carlisle
  • 757,742
egreg
  • 1,121,712