Repository navigation
Expand file tree
/
Copy pathtest-math-latex.xml
More file actions
executable file
·125 lines (104 loc) · 5.4 KB
/
Copy pathtest-math-latex.xml
File metadata and controls
executable file
·125 lines (104 loc) · 5.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?xml version="1.0" encoding="utf-8"?>
<!-- $Id: test-math-latex.xml 13565 2012-12-07 22:28:42Z maloneyc $ -->
<!--
This work is in the public domain and may be reproduced, published or
otherwise used without the permission of the National Library of Medicine (NLM).
We request only that the NLM is cited as the source of the work.
Although all reasonable efforts have been taken to ensure the accuracy and
reliability of the software and data, the NLM and the U.S. Government do
not and cannot warrant the performance or results that may be obtained by
using this software or data. The NLM and the U.S. Government disclaim all
warranties, express or implied, including warranties of performance,
merchantability or fitness for any particular purpose.
-->
<t:test xmlns:t="http://www.ncbi.nlm.nih.gov/ns/test" xmlns="http://www.w3.org/1999/xhtml">
<t:title>LaTeX samples / test page</t:title>
<t:content>
<article data-type="main">
<div class="jrb">
<div class="t">Journal of Interesting Things</div>
<div class="p">The Society for Putting Things on Top of Other Things</div>
</div>
<header class="fm-sec">
<h1 class="content-title">LaTeX samples / test page</h1>
<p class="contribs">Various outstanding people</p>
</header>
<h2>LaTeX</h2>
<section>
<h3>LaTeX sample that uses upgreek</h3>
<p>This equation is from <a
href="http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3117236/#eq9">PMC3117236</a>,
equation "(A1)". </p>
<p> Equation (from \begin{align*} \begin{split} \upvarepsilon_r^i &= a_{11}^i
\sigma_r^i + \sigma_{12}^i \sigma_{\uptheta}^i \\ \upvarepsilon_{\uptheta}^i & =
a_{12}^i \sigma_r^i + a_{22}^i \sigma_{\uptheta}^i \\ \gamma_{r \uptheta}^i & =
a_{66}^i \tau_{r \uptheta}^i \\ \gamma_{rz}^i & = \gamma_{\uptheta z}^i =
\tau_{rz}^i = \tau_{\uptheta z}^i = 0 \end{split} \end{align*} </p>
<p> For comparison, here's the image source on PMC: <img
src="http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3117236/equ/M20"/>. </p>
<p> Here's the same equation but with standard characters (not upright): \begin{align*}
\begin{split} \varepsilon_r^i &= a_{11}^i \sigma_r^i + \sigma_{12}^i
\sigma_{\theta}^i \\ \varepsilon_{\theta}^i & = a_{12}^i \sigma_r^i + a_{22}^i
\sigma_{\theta}^i \\ \gamma_{r \theta}^i & = a_{66}^i \tau_{r \theta}^i \\
\gamma_{rz}^i & = \gamma_{\theta z}^i = \tau_{rz}^i = \tau_{\theta z}^i = 0
\end{split} \end{align*} </p>
</section>
<section>
<h3>Some simple LaTeX</h3>
<ul>
<li>Inline: \(a + b = c\)</li>
<li>Fractions: \[\frac{n!}{k!(n-k)!} = {n \choose k}\]</li>
<li>Array: \[ \begin{array}{cc} a + \frac{b}{c} & \sqrt{a^b} \\ c & c
\end{array} \] </li>
</ul>
</section>
<section>
<h3>The Lorenz Equations, LaTeX</h3>
<p> \begin{align} \dot{x} & = \sigma(y-x) \\ \dot{y} & = \rho x - y - xz \\
\dot{z} & = -\beta z + xy \end{align} </p>
</section>
<section>
<h3>The Cauchy-Schwarz Inequality, LaTeX</h3>
<p>\[ \left( \sum_{k=1}^n a_k b_k \right)^{\!\!2} \leq \left( \sum_{k=1}^n a_k^2 \right)
\left( \sum_{k=1}^n b_k^2 \right) \]</p>
</section>
<section>
<h3>A Cross Product Formula</h3>
<p>\[ \mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix} \mathbf{i} & \mathbf{j} &
\mathbf{k} \\ \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0
\\ \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \\
\end{vmatrix} \]</p>
</section>
<section>
<h3>The probability of getting \(k\) heads when flipping \(n\) coins is:</h3>
<p>\[P(E) = {n \choose k} p^k (1-p)^{ n-k} \]</p>
</section>
<section>
<h3>An Identity of Ramanujan</h3>
<p>\[ \frac{1}{(\sqrt{\phi \sqrt{5}}-\phi) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}}
{1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\ldots} } } } \]</p>
</section>
<section>
<h3>A Rogers-Ramanujan Identity</h3>
<p>\[ 1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots =
\prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \quad\quad \text{for
$|q|<1$}. \]</p>
</section>
<section>
<h3>Maxwell's Equations</h3>
<p> \begin{align} \nabla \times \vec{\mathbf{B}} -\, \frac1c\,
\frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\
\nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ \nabla \times \vec{\mathbf{E}}\, +\,
\frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ \nabla
\cdot \vec{\mathbf{B}} & = 0 \end{align} </p>
</section>
<section>
<h3>In-line Mathematics</h3>
<p>Finally, while display equations look good for a page of samples, the ability to mix
math and text in a paragraph is also important. This expression \(\sqrt{3x-1}+(1+x)^2\)
is an example of an inline equation. As you see, MathJax equations can be used this way
as well, without unduly disturbing the spacing between lines.</p>
</section>
</article>
</t:content>
</t:test>