答案1
我只会使用array
s:
\documentclass{article}
\usepackage{mathptmx}% for the Times-like font, though I'd prefer newtxtext+newtxmath
\usepackage{amsmath}
\begin{document}
\[
\operatorname{Pr}
\left[
\begin{array}{c}
(pk,sk) \gets \mathsf{Gen}(1^k) \\
(I,c_1,r_1,c_2,r_2) \gets A(pk)
\end{array}
:
\begin{array}{c}
c_1 \neq c_2 \\
\text{and}\\
(pk,I,c_1,r_1), (pk,I,c_2,r_2) \\
\text{are both accepting transcripts}
\end{array}
\right].
\]
\end{document}
答案2
bmatrix
(正如@Bernard 在他的评论中所建议的那样)并且gathered
:
\documentclass{article}
\usepackage{mathptmx}% for the Times-like font, though I'd prefer newtxtext+newtxmath
\usepackage{amsmath}
\begin{document}
\[
\operatorname{Pr}
\begin{bmatrix}
\begin{gathered}
(pk,sk) \gets \mathsf{Gen}(1^k) \\
(I,c_1,r_1,c_2,r_2) \gets A(pk)
\end{gathered}
& : & \begin{gathered}
c_1 \neq c_2 \\
\text{and}\\
(pk,I,c_1,r_1), (pk,I,c_2,r_2) \\
\text{are both accepting transcripts}
\end{gathered}
\end{bmatrix}
\]
\end{document}
答案3
还有另一种\DeclarePairedDelimitersXPP
可能性mathtools
:stackengine
\documentclass{article}
\usepackage{mathptmx}%
\usepackage{mathtools}
\DeclarePairedDelimiterXPP\Prob[1]{\operatorname{Pr}}[]{}{#1}
\usepackage[usestackEOL]{stackengine}
\begin{document}
\[
\Prob*{\Vectorstack{(pk,sk) \gets \mathsf{Gen}(1^k) \\
(I,c_1,r_1,c_2,r_2) \gets A(pk) }
\, : \,\Vectorstack{c_1 \neq c_2 \\
\text{and}\\
(pk,I,c_1,r_1), (pk,I,c_2,r_2) \\
\text{are both accepting transcripts}}
}\]
\end{document}