BookML

v0.28.5

0.8.8

2018/12/01

1 Sums and Limits

mathclap & friends

X=1ijnXijX=\sum_{1\leq i\leq j\leq n}X_{ij}
X=1ijnXijX=\sum_{\mathclap{1\leq i\leq j\leq n}}X_{ij}
X=1ijnXijX=\sum_{\mathrlap{1\leq i\leq j\leq n}}X_{ij}
X=1ijnXijX=\sum_{\mathllap{1\leq i\leq j\leq n}}X_{ij}

Cramped

x2x2x2x2\cramped{x^{2}}\leftrightarrow x^{2}\quad\cramped[\scriptstyle]{x^{2}}% \leftrightarrow{\scriptstyle x^{2}}

Smashoperator

V=1ijnVijX=1ijn3456XijY=1ijnYijZ=𝑇1ijnZijV=\sum_{1\leq i\leq j\leq n}^{\infty}V_{ij}\quad X=\sum_{1\leq i\leq j\leq n}^% {3456}X_{ij}\quad Y=\sum\limits_{1\leq i\leq j\leq n}Y_{ij}\quad Z=\mathop{T}_% {1\leq i\leq j\leq n}Z_{ij}
V=1ijnVijX=1ijn3456XijY=1ijnYijZ=𝑇1ijnZijV=\sum_{1\leq i\leq j\leq n}^{\infty}V_{ij}\quad X=\smashoperator[]{\sum_{1% \leq i\leq j\leq n}^{3456}}X_{ij}\quad Y=\smashoperator[r]{\sum_{1\leq i\leq j% \leq n}^{}}Y_{ij}\quad Z=\smashoperator[l]{\mathop{T}_{1\leq i\leq j\leq n}^{}% }Z_{ij}

Adjustlimits

a)limnmaxpnb)limnmaxp2nc)limnsupp2nKd)lim supnmaxpn\text{a)}\lim_{n\to\infty}\max_{p\geq n}\quad\text{b)}\lim_{n\to\infty}\max_{p% ^{2}\geq n}\quad\text{c)}\lim_{n\to\infty}\sup_{p^{2}\geq nK}\quad\text{d)}% \limsup_{n\to\infty}\max_{p\geq n}
a)limnmaxpnb)limnmaxp2nc)limnsupp2nKd)lim supnmaxpn\text{a)}\adjustlimits{\lim}_{n\to\infty}{\max}_{p\geq n}\quad\text{b)}% \adjustlimits{\lim}_{n\to\infty}{\max}_{p^{2}\geq n}\quad\text{c)}% \adjustlimits{\lim}_{n\to\infty}{\sup}_{p^{2}\geq nK}\quad\text{d)}% \adjustlimits{\limsup}_{n\to\infty}{\max}_{p\geq n}

2 Tags

equation Q&A Q&A
a=ba=b

See Q&A or is it better with Q&A? In the star form \ref* becomes Q&A (\refeq* is not defined).

equation Q&A Q&A
a=ba=b
equation [Q&A] [Q&A]
a=ba=b

Normal tags.

equation (1) (1)
a=aa=a

That was equation (1).

OK tags.

equation [2] [2]
a=aa=a

That was equation [2], but recall [1]

odd tag.

equation {3} {3}
a=aa=a

That was equation {3}, but recall {1} and {2}.

weird tag.

equation ((4)) ((4))
b=bb=b

That was equation ((4)), but recall ((1)), ((2)) and ((3)).

Normal tags again.

equation (5) (5)
c=cc=c

Non-textual

equation (nth) (nth)
d=dd=d

That was equation (5), but recall (1), (2), (3), (4) and (nth).

equation (6) (6)
a=a\displaystyle a=a
equation (**) (**)
b=b\displaystyle b=b

This should refer to the equation containing a=aa=a: (6). Then a switch of tag forms.

equation (7) (7)
c\displaystyle c
=c\displaystyle=c
equation (8) (8)
d\displaystyle d
=d\displaystyle=d

This should refer to the equation containing d=dd=d: (8) (but recall (6)).

equation (9) (9)
e=ee=e
equation (10) (10)
f=ff=f
1+1=21+1=2
2+2=42+2=4

Blabla (2).

3 Arrows

AunderoverBunderoverCA\xLeftarrow[under]{over}B\xRightarrow[under]{over}C
xunderoverlooooooongyunderloooooooongoverzx\xleftrightarrow[under]{overlooooooong}y\xLeftrightarrow[underloooooooong]{% over}z
xbarfooybluuuuuuuuubbaztheeereeekx\xhookleftarrow[bar]{foo}y\xhookrightarrow[bluuuuuuuuub]{baz}t\xmapsto{% heeereee}k
k.l..mn.ok\xleftharpoonup[.]{}l\xleftharpoondown{..}m\xrightharpoondown[...]{}n% \xrightharpoonup{....}o
xbluuuuubyblaaaaaabzx\xrightleftharpoons{bluuuuub}y\xleftrightharpoons[blaaaaaab]{}z
z=xreal+iyimaginarycomplex number1+1=2z=\overbrace{\underbracket{x}_{\text{real}}+i\underbracket{y}_{\text{imaginary% }}}^{\text{complex number}}\quad\underbrace{1+1}_{=2}

4 Matrices

ccococococococc\begin{matrix}c&cocococococo\\ c&c\end{matrix}
lalalalalalalll\begin{matrix}[l]lalalalalala&l\\ l&l\end{matrix}
rererererererrr\begin{matrix}[r]rererererere&r\\ r&r\end{matrix}
(pppppppfoolppppppppppppppp)\begin{pmatrix}[l]ppppppp&foo\\ l&ppppppppppppppp\end{pmatrix}
[bbbb]\begin{bmatrix}b&b\\ b&b\end{bmatrix}
{BBBBBBBBBBrBBBBBB}\begin{Bmatrix}[r]B&B\\ B&BBBBBBBrBBBBBB\end{Bmatrix}
|vvvv|\begin{vmatrix}v&v\\ v&v\end{vmatrix}
VVVVVVVVcVVVVVVbar\begin{Vmatrix}[c]V&V\\ VVVVVVcVVVVVV&bar\end{Vmatrix}
|ablblblbllbblblblblblblblcd|\begin{vmatrix}[l]a&blblblbllbblblblblblblbl\\ c&d\end{vmatrix}
[abcd][abcd]\begin{bmatrix}a&-b\\ -c&d\end{bmatrix}\begin{bmatrix}[r]a&-b\\ -c&d\end{bmatrix}
efghefgh\begin{Vmatrix}e&-f\\ -g&h\end{Vmatrix}\begin{Vmatrix}[r]e&-f\\ -g&h\end{Vmatrix}
[abbbbbcd][abbbbbcd]\begin{bmatrix}a&-bbbbb\\ -c&d\end{bmatrix}\begin{bmatrix}[r]a&-bbbbb\\ -c&d\end{bmatrix}
efffffghefffffgh\begin{Vmatrix}e&-fffff\\ -g&h\end{Vmatrix}\begin{Vmatrix}[r]e&-fffff\\ -g&h\end{Vmatrix}
[abbbbbcd][abbbbbcd]\begin{bmatrix}[l]a&-bbbbb\\ -c&d\end{bmatrix}\begin{bmatrix}[r]a&-bbbbb\\ -c&d\end{bmatrix}
efffffghefffffgh\begin{Vmatrix}[l]e&-fffff\\ -g&h\end{Vmatrix}\begin{Vmatrix}[r]e&-fffff\\ -g&h\end{Vmatrix}

5 Cases

{E=mc2Nothing to see herex3dxIntegral is text style\begin{cases}E=mc^{2}&\text{Nothing to see here}\\ \int x-3\,dx&\text{Integral is text style}\end{cases}
{E=mc2c3.00×108m/sx3dxIntegral is display style\begin{dcases}E=mc^{2}&c\approx 3.00\times 10^{8}\,\mathrm{m}/\mathrm{s}\\ \int x-3\,dx&\text{Integral is display style}\end{dcases}
a={E=mc2Nothing to see here (text in math)x3dxIntegral is display style (text in math)a=\begin{dcases*}E=mc^{2}&Nothing to see here (text in math)\\ \int x-3\,dx&Integral is display style (text in math)\end{dcases*}
E=mc256and so onx3dxx𝑑x}=b\begin{rcases}E=mc^{2}&5^{6}\quad\text{and so on}\\ \int x-3\,dx&\int x\,dx\end{rcases}=b
x2for x𝑑x>0x3else}\begin{rcases*}x^{2}&for $\int x\,dx>0$\\ x^{3}&else\end{rcases*}\Rightarrow\cdots
E=mc256and so onx3dxx𝑑x}=b\begin{drcases}E=mc^{2}&5^{6}\quad\text{and so on}\\ \int x-3\,dx&\int x\,dx\end{drcases}=b
x2for x𝑑x>0x3xelse}\begin{drcases*}x^{2}&for $\int x\,dx>0$\\ \int x^{3}\,x&else\end{drcases*}\Rightarrow\cdots
foo={πif somethingΩΞΩotherwise\text{foo}=\begin{cases*}\pi&if something\\ \int\Omega^{\Xi}\,\Omega&otherwise\end{cases*}

6 Gathered

A=firstlastBA=\begin{gathered}\framebox[113.81102pt]{first}\\ \framebox[113.81102pt]{last}\end{gathered}B
a=b+cb=c+d\begin{gathered}a=b+c\\ b=c+d\\ ...\end{gathered}
hello\boxed{hello}
f(x)\displaystyle f(x)
=h(x)𝑑x\displaystyle=\int h(x)\,dx
=g(x)\displaystyle=g(x)
equation (11) (11)
a\displaystyle a
=b\displaystyle=b
Some text
equation (12) (12)
c\displaystyle c
=d\displaystyle=d
Some short text
equation (13) (13)
e\displaystyle e
=f\displaystyle=f

7 Delimiters

|ac||ac||ab|\lvert\frac{a}{c}\rvert\quad\left\lvert\frac{a}{c}\right\rvert\quad\Bigg{% \lvert}\frac{a}{b}\Bigg{\rvert}
|ab||ab||ab||ab|\lvert\frac{a}{b}\rvert\quad\left\lvert\frac{a}{b}\right\rvert\quad\big{\lvert% }\frac{a}{b}\big{\rvert}\quad\Bigg{\lvert}\frac{a}{b}\Bigg{\rvert}
|π||_ϕ_|\lvert\pi\rvert\quad\left\lvert\_\phi\_\right\rvert
A,12B|kfk|C\left\langle A,\frac{1}{2}\right\rangle\quad\Big{\langle}B\,\Big{|}\,\sum_{k}f% _{k}\,\Big{|}\,C\Big{\rangle}
{xX|xx2+1>1}\left\{x\in X\middle|\allowbreak\frac{\sqrt{x}}{x^{2}+1}>1\right\}

1|841| 3\langle 1\,|\,\frac{8}{\frac{4}{1}}\,|\,3\rangle 1|841| 3\left\langle 1\,\middle|\,\frac{8}{\frac{4}{1}}\,\middle|\,3\right\rangle 1|841| 3\big{\langle}1\,\big{|}\,\frac{8}{\frac{4}{1}}\,\big{|}\,3\big{\rangle}

(πω)[x𝑑x][sinxcosz](foobarbazqux)\left(\frac{\pi}{\omega}\right)\cdot\left[\int xdx\right]\ldots[\sqrt{\frac{% \sin x}{\cos z}}]\cdots\lparen\frac{\frac{foo}{bar}}{\frac{baz}{qux}}\rparen

Operators

a:=ba:=ba:=ba:=b\quad a\vcentcolon=b\quad a\ordinarycolon=b
abc::≈de::fa\coloneqq b\quad c\Colonapprox d\quad e\dblcolon f
××\bigtimes\times\nuparrow\ndownarrow\otimes\bigotimes

8 Prescripts

𝐂25+124𝐂25+214𝐂25+124𝐂25+14𝐂25+2{}^{4}_{12}\mathbf{C}^{5+}_{2}\quad\prescript{14}{2}{\mathbf{C}}^{5+}_{2}\quad% \prescript{4}{12}{\mathbf{C}}^{5+}_{2}\quad\prescript{14}{}{\mathbf{C}}^{5+}_{% 2}\quad\prescript{}{2}{\mathbf{C}}^{5+}_{2}
X𝐙AY𝐙𝟐A4+α𝟐4\prescript{A}{Z}{X}\to\prescript{A-4}{Z-2}{Y}+\prescript{4}{2}{\alpha}
a=xy+xy+xydx+xy+xy+xy+xy+xy+xyz=xy+xy+xydx+xy+xy+xy+xy+xy+xyza=\frac{\begin{multlined}xy+xy+\int xy\,\text{dx}+xy+xy\\ +xy+xy+xy+xy\end{multlined}xy+xy+\int xy\,\text{dx}+xy+xy\\ +xy+xy+xy+xy}{z}=\frac{\displaystyle\begin{multlined}xy+xy+\int xy\,\text{dx}+% xy+xy\\ +xy+xy+xy+xy\end{multlined}xy+xy+\int xy\,\text{dx}+xy+xy\\ +xy+xy+xy+xy}{z}

9 Multlines

p(x)=3x6+14x5y+590x4y2+19x3y312x2y412xy5+2y6a3b3p(x)=3x^{6}+14x^{5}y+590x^{4}y^{2}+19x^{3}y^{3}\\ -12x^{2}y^{4}-12xy^{5}+2y^{6}-a^{3}b^{3}
A=firstlastBA=\begin{multlined}\boxed{first}\\ \boxed{last}\end{multlined}\boxed{first}\\ \boxed{last}B
A=firstlastBA=\begin{multlined}\boxed{first}\\ \boxed{last}\end{multlined}\boxed{first}\\ \boxed{last}B
A=firstlastBA=\begin{multlined}\boxed{first}\\ \boxed{last}\end{multlined}\boxed{first}\\ \boxed{last}B
A=firstlastBA=\begin{multlined}\boxed{first}\\ \boxed{last}\end{multlined}\boxed{first}\\ \boxed{last}B
A=firstlastBA=\begin{multlined}\boxed{first}\\ \boxed{last}\end{multlined}\boxed{first}\\ \boxed{last}B
A=firstlastBA=\begin{multlined}\boxed{first}\\ \boxed{last}\end{multlined}\boxed{first}\\ \boxed{last}B
A=firstlastBA=\begin{multlined}\boxed{first}\\ \boxed{last}\end{multlined}\boxed{first}\\ \boxed{last}B
A=firstlastBA=\begin{multlined}\boxed{first}\\ \boxed{last}\end{multlined}\boxed{first}\\ \boxed{last}B
A=firstlastBA=\begin{multlined}\boxed{first}\\ \boxed{last}\end{multlined}\boxed{first}\\ \boxed{last}B
equation (14) (14)
foox=1,x+1=2y=2foo\Coloneqq\begin{lgathered}x=1,\quad x+1=2\\ y=2\end{lgathered}x=1,\quad x+1=2\\ y=2
equation (15) (15)
barx=1,x+1=2y=2bar\Coloneqq\begin{rgathered}x=1,\quad x+1=2\\ y=2\end{rgathered}x=1,\quad x+1=2\\ y=2

10 Spread-lines

Spread it

abcdefghi\begin{matrix}a&b&c\\ d&e&f\\ g&h&i\end{matrix}
(a1,1a1,2a1,na2,1a2,2a2,nam,1am,2am,n)\begin{pmatrix}a_{1,1}&a_{1,2}&\cdots&a_{1,n}\\ a_{2,1}&a_{2,2}&\cdots&a_{2,n}\\ \vdots&\vdots&\ddots&\vdots\\ a_{m,1}&a_{m,2}&\cdots&a_{m,n}\end{pmatrix}

abcd\begin{smallmatrix}a&b\\ c&d\end{smallmatrix}

{n/2if n is even(n+1)/2if n is odd\begin{cases}n/2&\quad\text{if }n\text{ is even}\\ -(n+1)/2&\quad\text{if }n\text{ is odd}\\ \end{cases}

equation (16) (16)
a=b+cd+ef=g+h=i\begin{split}a&=b+c-d\\ &\quad+e-f\\ &=g+h\\ &=i\end{split}
equation (17) (17)
a+b+c+d+e+f+i+j+k+l+m+na+b+c+d+e+f\\ +i+j+k+l+m+n
equation (18) (18)
a=b\displaystyle a=b
equation (19) (19)
c=d\displaystyle c=d
equation (20) (20)
a1\displaystyle a_{1}
=b1+c1\displaystyle=b_{1}+c_{1}
equation (21) (21)
a2\displaystyle a_{2}
=b2+c2d2+e2\displaystyle=b_{2}+c_{2}-d_{2}+e_{2}
a11\displaystyle a_{11}
=b11\displaystyle=b_{11}
a12\displaystyle a_{12}
=b12\displaystyle=b_{12}
a21\displaystyle a_{21}
=b21\displaystyle=b_{21}
a22\displaystyle a_{22}
=b22+c22\displaystyle=b_{22}+c_{22}
equation (22) (22)
x\displaystyle x
=y1y2+y3y5+y8\displaystyle=y_{1}-y_{2}+y_{3}-y_{5}+y_{8}-\dots
by foo
equation (23) (23)
=yy\displaystyle=y^{\prime}\circ y^{*}
by baz
equation (24) (24)
=y(0)y\displaystyle=y(0)y^{\prime}
by Axiom 1.
B=×E,E=×B4πj,}Maxwell’s equations\left.\begin{aligned} B^{\prime}&=-\partial\times E,\\ E^{\prime}&=\partial\times B-4\pi j,\end{aligned}\right\}\qquad\text{Maxwell's% equations}
(abcd)\bigl{(}\begin{smallmatrix}a&b\\ c&d\end{smallmatrix}\bigr{)}
(abcd)\bigl{(}\begin{matrix}[l]a&b\\ c&d\end{matrix}\bigr{)}
iΛ0<j<nP(i,j)\sum_{\begin{subarray}{l}i\in\Lambda\\ 0<j<n\end{subarray}}P(i,j)
equation (25) (25)
y\displaystyle y
=\displaystyle=
ax2+bx+c\displaystyle ax^{2}+bx+c
equation (26) (26)
f(x)\displaystyle f(x)
=\displaystyle=
x2+2xy+y2\displaystyle x^{2}+2xy+y^{2}
FirstlineSecondlineL+E+F+TR+I+G+H+TL+E+F+TR+I+G+H+TWupWupLastline\begin{multlined}\boxed{Firstline}\\ \boxed{Secondline}\\ L+E+F+T\\ R+I+G+H+T\\ L+E+F+T\\ R+I+G+H+T\\ \boxed{WupWup}\\ \boxed{Lastline}\end{multlined}\boxed{Firstline}\\ \boxed{Secondline}\\ L+E+F+T\\ R+I+G+H+T\\ L+E+F+T\\ R+I+G+H+T\\ \boxed{WupWup}\\ \boxed{Lastline}

11 Stepped lines

1 x=1,x+1=2 over2 y=2 over\begin{gathered}x=1,\quad x+1=2\\ y=2\end{gathered}

42

See:s=2.8,s+0.2=3the endSee:t=4.5the end\begin{gathered}s=2.8,\quad s+0.2=3\\ t=4.5\end{gathered}

1337

12 Shifting equations

Part 1
=\displaystyle={}
2nd line
19\displaystyle 19
+ last part\displaystyle+\framebox[113.81102pt][c]{ last part}
equation (27) (27)
1
=2\displaystyle=\framebox[85.35826pt]{2}
equation (28) (28)
3
=4\displaystyle=\framebox[56.9055pt]{4}
a\displaystyle a
=b\displaystyle=b
\displaystyle\mathmakebox[\widthof{{}={}}][c]{\vdots}
=c\displaystyle=c
\displaystyle\mathmakebox[\widthof{{}={}}][c]{\vdots}
=d\displaystyle=d

13 Additional BookML tests

13.1 Nesting

equation (29) (29)
a\displaystyle a
=b\displaystyle=b
=c\displaystyle=c
=d\displaystyle=d
equation (30) (30)
a=b=c=dx2a=b=c=d\begin{gathered}\begin{aligned} a&=b\\ &=c\\ &=d\end{aligned}\\ x^{2}\end{gathered}\begin{aligned} a&=b\\ &=c\\ &=d\end{aligned}

13.2 Cases

equation (31) (31)
|x|=\displaystyle|x|=
x,\displaystyle x,
for x0x\geq 0
equation (32) (32)
|x|=\displaystyle|x|=
x,\displaystyle-x,
for x<0x<0
equation (33a) (33a)
w\displaystyle w\equiv
0\displaystyle 0
for c=d=0c=d=0
equation (33b) (33b)
w\displaystyle w\equiv
|c|1+1+(d/c)22\displaystyle\sqrt{|c|}\,\sqrt{\frac{1+\sqrt{1+(d/c)^{2}}}{2}}
for |c||d||c|\geq|d|
equation (33c) (33c)
w\displaystyle w\equiv
|d||c/d|+1+(c/d)22\displaystyle\sqrt{|d|}\,\sqrt{\frac{|c/d|+\sqrt{1+(c/d)^{2}}}{2}}
for |c|<|d||c|<|d|
equation (34a) (34a)
c+id=\displaystyle\sqrt{c+id}=
0,\displaystyle 0\,,
w=0w=0 (case 33a)
equation (34b) (34b)
c+id=\displaystyle\sqrt{c+id}=
w+id2w,\displaystyle w+i\frac{d}{2w}\,,
w0w\neq 0, c0c\geq 0
equation (34c) (34c)
c+id=\displaystyle\sqrt{c+id}=
|d|2w+iw,\displaystyle\frac{|d|}{2w}+iw\,,
w0w\neq 0, c<0c<0, d0d\geq 0
equation (34d) (34d)
c+id=\displaystyle\sqrt{c+id}=
|d|2wiw,\displaystyle\frac{|d|}{2w}-iw\,,
w0w\neq 0, c<0c<0, d<0d<0