Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 4 down vote accepted
\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. :)

share|improve this answer
    
"this": the OP's desired layout, or the solution? –  Brent.Longborough May 17 '11 at 9:17
1  
@Brent: The desired layout, of course. :) –  egreg May 17 '11 at 9:17
    
+1, Good! But, can you make it work, even when the subscripts are stacked (using subarray)? –  Sadeq Dousti May 17 '11 at 9:38
    
@Sadeq: now it uses subarray; you give \Prl the subscript with rows separated, as usual, by `\` –  egreg May 17 '11 at 11:07
    
Thanks a lot :) –  Sadeq Dousti May 17 '11 at 11:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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