5

I try to write the following formula in Latex

enter image description here

My question is that how to write the right-hand side formula? How to ensure that the text paragraphs on the right side are consistent in the formula environment?

My code is

$\mathbb{P}[\mbox{there exists a black path from ${0}\times [0,s]$ to $\pho s\mtis [0,s]$ in the rectangle $[0,\pho s]\times [0,s]$}]
1
  • 1
    Welcome to TeX.SE. Commented Mar 5, 2021 at 23:47

5 Answers 5

7

I'd go with a tabular, but with a small twist:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\[
f_s(\rho)=\mathbf{P}\left[
  \begin{tabular}{@{\,}l@{\,}}
  there exists a black path from $\{0\}\times[0,s]$ to \\
  $\{\rho s\}\times[0,s]$ in the rectangle $[0,\rho s]\times[0,s]$
  \end{tabular}
\right]
\]

\end{document}

enter image description here

This seems to exactly replicate the picture you show.


My plain TeX version would be

$$
f_s(\rho)={\bf P}\left[
  \,\vcenter{\ialign{#\hfil\cr
    there exists a black path from $\{0\}\times[0,s]$ to\cr
    $\{\rho s\}\times[0,s]$ in the rectangle $[0,\rho s]\times[0,s]$\cr
  }}\,
\right]
$$

possibly with a macro for making the thing less heavy:

\def\longsetdesc#1{\,\vcenter{\ialign{##\hfil\cr#1\crcr}}\,}

$$
f_s(\rho)={\bf P}\left[
  \longsetdesc{
    there exists a black path from $\{0\}\times[0,s]$ to\cr
    $\{\rho s\}\times[0,s]$ in the rectangle $[0,\rho s]\times[0,s]$
  }
\right]
$$
\bye
7

With tabular:

\documentclass{article}

\begin{document}
\[ 
f_s(P) = \mathbf {P} 
        \left[\begin{tabular}{l}
        there exists a black path from ${0}\times [0,s]$ to\\ 
        $\rho s\times [0,s]$ in the rectangle $0,\rho s]\times [0,s]$
              \end{tabular}\right]
\]

\end{document}

enter image description here

5

This is task for \vcenter and \hbox TeX primitives:

$$
  f_s(P) = {\bf P} \left[
  \vcenter{
    \hbox{there exists a black path from ${0}\times [0,s]$ to}
    \hbox{$\rho s\times [0,s]$ in the rectangle $[0,\rho s]\times [0,s]$}
  }\right]
$$
4

I would do it with a bmatrix and the stackengine package:

\documentclass{article}
\usepackage{mathtools}
\usepackage[usestackEOL]{stackengine} 

\begin{document}

 \[ f_s(P) = \mathbf {P}\begin{bmatrix}\Centerstack[l]{there exists a black path from ${0}\times [0,s]$ to\\ $\rho s\times [0,s]$ in the rectangle $0,\rho s]\times [0,s]$}\end{bmatrix}\]

\end{document} 

enter image description here

2

Here's a solution that employs a \parbox and doesn't require loading any extra packages. (I did replace \pho with \rho, \mtis with \times, and {0} with \{0\}.)

enter image description here

\documentclass{article}
\newlength\mylen
\settowidth\mylen{there exists a black path from $\{0\}\times [0,s]$ to} % measure width
\begin{document}
\[
\mathbf{P}\left[\,
\parbox{\mylen}{\raggedright there exists a black path from $\{0\}\times [0,s]$ to 
  $\{\rho s\}\times [0,s]$ in the rectangle $[0,\rho s]\times [0,s]$}
\,\right]
\]
\end{document}

You must log in to answer this question.

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