3

I have a long equation that it was hard for me to break so that it appears professional. How can I do it?

\begin{equation}
    \begin{split}
        &\mathbb{P}\left( \left. Z_{1}\in dx_{1},Z_{2}\in dx_{2},\cdots ,Z_{n}\in
            dx_{n}\right\vert Z_{n+1}=x_{n+1}\right) \\
        \qquad &=f_{Z_{n+1}}\left(x_{n+1}\right) ^{-1}\left[ \mathbb{P}\left( \left\{ Z_{1}\in dx_{1},Z_{2}\in
            dx_{2},\cdots ,Z_{n}\in dx_{n}\right\} \cap \left\{ Z_{n+1}=x_{n+1}\right\} \right) \right]  \\
        =f_{Z_{n+1}}\left( x_{n+1}\right) ^{-1}\times \mathbb{\pi } \\
        =e^{-x_{n+1}}dx_{1}\cdots dx_{n+1}/f_{Z_{n+1}}\left( x_{n+1}\right)  \\
        =n!x^{-n}dx_{1}\cdots dx_{n}
    \end{split}
\end{equation}
6

You're not far. Remove all \left and \right tokens that only do bad, in this context; there's just a pair of brackets that asks for being a bit larger (with \bigl and \bigr).

Also some help is needed for the dots in the final two lines; use \mid instead of \vert, for better spacing and don't forget \, after the factorial.

Last thing: I added empty superscripts to f_{Z_{n+1}}, so the subscript is slightly moved down.

\documentclass{article}
\usepackage{mathtools}
\usepackage{amsfonts} % for \mathbb

\DeclareMathOperator{\PR}{\mathbb{P}}

\begin{document}
\begin{equation}
\begin{split}
&\PR(Z_{1}\in dx_{1},Z_{2}\in dx_{2},\dots ,Z_{n}\in dx_{n}\mid Z_{n+1}=x_{n+1})
\\
&\quad =f^{}_{Z_{n+1}}(x_{n+1}) ^{-1}\bigl[
   \PR( \{ Z_{1}\in dx_{1},Z_{2}\in dx_{2},\dots,Z_{n}\in dx_{n}\}
\\
&\qquad\qquad \cap\{Z_{n+1}=x_{n+1}\})\bigr]  \\
&\quad =f^{}_{Z_{n+1}}( x_{n+1}) ^{-1}\times \pi \\
&\quad =e^{-x_{n+1}}dx_{1}\dotsm dx_{n+1}/f^{}_{Z_{n+1}}(x_{n+1})  \\
&\quad =n!\,x^{-n}dx_{1}\dotsm dx_{n}
\end{split}
\end{equation}
\end{document}

enter image description here

  • why not an outer multline with all lines but the first either split or aligned? – barbara beeton Mar 18 '16 at 14:33
  • 2
    @barbarabeeton I prefer the equals signs to be near the left side, like if the first line were X&=\PR(...) – egreg Mar 18 '16 at 14:35
4

Some suggestions:

  • Keep using a split environment, but provide alignment points on all lines

  • Use an aligned environment to the right of the = symbol in row 2 to break up that line into two separate lines

  • Don't overuse \left and \right; in fact, for the equations at hand, they're not needed at all.

  • Don't use \cdots for the equations at hand. Instead, use \dots in the first two rows and \dotsm ("multiplicate dots") in the final two rows.

  • There is no "Blackboard Bold" version of \pi; hence, \mathbb{\pi } is the same as \pi. If you must produce a bold version of the symbol, write \boldsymbol{\pi}; alternatively, load the bm package and write \bm{\pi}.

enter image description here

\documentclass{article}
\usepackage{amsmath,amsfonts,bm}

\begin{document}
\begin{equation}
\begin{split}
   \mathbb{P}(
        &Z_{1}\in dx_{1},Z_{2}\in dx_{2},\dots, Z_{n}\in
            dx_{n} \mid Z_{n+1}=x_{n+1}) \\
        &=\!\begin{aligned}[t] 
            f_{Z_{n+1}}^{} (x_{n+1})^{-1} \bigl[ \mathbb{P}(\{
            &Z_{1}\in dx_{1}, Z_{2}\in dx_{2}, \dots , Z_{n}\in dx_{n}\} \\
            &\cap \{ Z_{n+1}=x_{n+1}\} ) \bigr]
        \end{aligned}\\
        &=f_{Z_{n+1}}( x_{n+1})^{-1} \times \bm{\pi} \\
        &=e^{-x_{n+1}}\,dx_{1}\dotsm dx_{n+1} / f_{Z_{n+1}}( x_{n+1})  \\
        &=n!\,x^{-n}\,dx_{1}\dotsm dx_{n}
\end{split}
\end{equation}
\end{document}
2

I propose a solution with multline and aligned. The geometry package yields more sensible margins, if you don't use margin notes. Finally, I simplified your code, using the \DeclarePairedDelimiter commad form mathtools: I defined a \Prob+\given command for conditional probabilities, and a \set command, which have variable-sized delimiters if used in their starred version, or with an option (\big, \Big, &c.):

\documentclass{article}
\usepackage{mathtools,amsfonts} % for 'dcases' environment
\usepackage{xparse} \usepackage[showframe]{geometry}

\DeclarePairedDelimiterXPP\Prob[1]{\mathbb P}(){}{
\newcommand\given{\nonscript\:\delimsize\vert\nonscript\:}
#1}

\DeclarePairedDelimiterX{\set}[1]\{\}{\setargs{#1}}
\NewDocumentCommand{\setargs}{>{\SplitArgument{1}{;}}m} {\setargsaux#1}
\NewDocumentCommand{\setargsaux}{mm}
{\IfNoValueTF{#2}{\nonscript\,#1\nonscript\,}{\nonscript\,#1\nonscript\;{;}
\nonscript\:\allowbreak #2\nonscript\,}}

\begin{document}

\begin{multline}
  \Prob{ Z_{1} \in dx_{1},Z_{2} \in dx_{2}, \dots ,Z_{n}\in
    dx_{n}\given Z_{n+1} =x_{n+1}} \\
  \begin{aligned}
      & =f_{Z_{n+1}}\left(x_{n+1}\right) ^{-1}\left[ \Prob*{\set*{ Z_{1} \in dx_{1},Z_{2} ∈
    dx_{2}, \dots ,Z_{n} \in dx_{n}} \cap \set*{ Z_{n+1}=x_{n+1}}} \right] \\
      & =f_{Z_{n+1}}\left( x_{n+1}\right) ^{-1} \times \mathbb{\pi } \\
      & =e^{-x_{n+1}}dx_{1}\dotsm dx_{n+1}/f_{Z_{n+1}}\left( x_{n+1}\right) \\
      & =n!\,x^{-n}dx_{1} \dotsm dx_{n}
  \end{aligned}
\end{multline}

\end{document} 

enter image description here

  • I don't think it's typographically appropriate to use \cdots in comma-delimited lists -- see rows 1 and 2. Consider using either \dots or \dotsc ("dots between commas"). Also, \mathbb{\pi} is suspect. – Mico Mar 18 '16 at 15:12
  • @Mico: I just took the code from the O.P and didn't notice. But you're righht, I'll update my answer. Thanks for pointing it – Bernard Mar 18 '16 at 15:21

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.