Difference between revisions of "Template:ProbMacro"
From Maths
m (Typo) |
(Adding conditional versions) |
||
Line 1: | Line 1: | ||
− | <div style="font-size:0px;">{{ | + | <div style="font-size:0px;">{{m|1=\newcommand{\P}[1]{ {\mathbb{P}\left[{#1}\right]} } <!-- |
+ | --> \newcommand{\Plcond}[2]{ {\mathbb{P}\left.\left[{#1}\right\vert{#2}\right]} }<!-- | ||
+ | --> \newcommand{\Prcond}[2]{ {\mathbb{P}\left[{#1}\left\vert{#2}\right.\right]} }<!-- | ||
+ | -->}}</div><noinclude> | ||
==Description== | ==Description== | ||
* Prototype created: 3rd Nov 2017 | * Prototype created: 3rd Nov 2017 | ||
* Purpose: to be included and uniformly provide a short cut to typing {{C|\mathbb{P}\left[''(whatever)''\right]}} every time | * Purpose: to be included and uniformly provide a short cut to typing {{C|\mathbb{P}\left[''(whatever)''\right]}} every time | ||
+ | * No spaces are provided either side of the {{M|\vert}} in conditional versions. | ||
==Tasks== | ==Tasks== | ||
{{Todo|Remove this when there are none left}} | {{Todo|Remove this when there are none left}} | ||
* Support variations, for example to underbrace things without the brackets becoming huge | * Support variations, for example to underbrace things without the brackets becoming huge | ||
* Support things like {{M|\mathbb{P}'[A]}} or {{M|\overline{\mathbb{P} }[A]}} | * Support things like {{M|\mathbb{P}'[A]}} or {{M|\overline{\mathbb{P} }[A]}} | ||
+ | * 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 {{C|\vert}} in the middle) | ||
==Tests== | ==Tests== | ||
− | * {{M|\P{A} }} | + | * {{M|\P{A} }}, {{M|\Prcond{A}{B} }} |
+ | ** lcond: | ||
+ | *** {{MM|\Plcond{\sum^n_{k\eq 1} }{\text{small} } }} | ||
+ | *** {{MM|\Plcond{\text{small} }{\sum^n_{k\eq 1} } }} | ||
+ | ** rcond: | ||
+ | *** {{MM|\Prcond{\sum^n_{k\eq 1} }{\text{small} } }} | ||
+ | *** {{MM|\Prcond{\text{small} }{\sum^n_{k\eq 1} } }} | ||
+ | Pay careful condition to the {{M|\vert}} heights as much as the {{M|[}} and {{M|]}} | ||
</noinclude> | </noinclude> |
Revision as of 16:49, 3 November 2017
[ilmath]\newcommand{\P}[1]{ {\mathbb{P}\left[{#1}\right]} } \newcommand{\Plcond}[2]{ {\mathbb{P}\left.\left[{#1}\right\vert{#2}\right]} } \newcommand{\Prcond}[2]{ {\mathbb{P}\left[{#1}\left\vert{#2}\right.\right]} }[/ilmath]
Description
- 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
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)
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]
- lcond:
Pay careful condition to the [ilmath]\vert[/ilmath] heights as much as the [ilmath][[/ilmath] and [ilmath]][/ilmath]