Template:ProbMacro

From Maths
Revision as of 21:58, 4 November 2017 by Alec (Talk | contribs) (Saving work, fixed it!)

Jump to: navigation, search
[ilmath]\newcommand{\P}[1]{\mathbb{P}\!\left[{#1}\right]\!} \newcommand{\Pcond}[2]{\mathbb{P}\!\left[{#1}\middle\vert{#2}\right]\!} \newcommand{\Plcond}[2]{\Pcond{#1}{#2} } \newcommand{\Prcond}[2]{\Pcond{#1}{#2} }[/ilmath]

Description

  • 4th of November 2017 - scrapping prototype, using \middle and \! for spacing issue

Original

  • Prototype created: 3rd Nov 2017
  • Purpose: to be included and uniformly provide a short cut to typing \mathbb{P}\left[(whatever)\right] every time
  • No spaces are provided either side of the [ilmath]\vert[/ilmath] in conditional versions.

Tasks

For 4th Nov 2017 update

  • Make \Pcond use \P rather than being it's own thing

For original


TODO: Remove this when there are none left


  • Support variations, for example to underbrace things without the brackets becoming huge
  • Support things like [ilmath]\mathbb{P}'[A][/ilmath] or [ilmath]\overline{\mathbb{P} }[A][/ilmath]
  • If Plcond and Prcond always work the same, introduce Pcond alone. I have no solution right now. Examples of why below
    • They are named so that the left one is sized by the first argument, the right one is sized by the second (due to the \vert in the middle)

Compare

\P

  • [ilmath]\P{A}\oplus [/ilmath] - macro
  • [ilmath]\mathbb{P}[A]\oplus[/ilmath] - orig

\Pcond

  • [ilmath]\Pcond{A}{B}\oplus [/ilmath] - macro
  • [ilmath]\mathbb{P}[A\vert B]\oplus[/ilmath] - orig

Tests

  • [ilmath]\P{A} [/ilmath], [ilmath]\Prcond{A}{B} [/ilmath]
    • lcond:
      • [math]\Plcond{\sum^n_{k\eq 1} }{\text{small} } [/math]
      • [math]\Plcond{\text{small} }{\sum^n_{k\eq 1} } [/math]
    • rcond:
      • [math]\Prcond{\sum^n_{k\eq 1} }{\text{small} } [/math]
      • [math]\Prcond{\text{small} }{\sum^n_{k\eq 1} } [/math]

Pay careful condition to the [ilmath]\vert[/ilmath] heights as much as the [ilmath][[/ilmath] and [ilmath]][/ilmath]