File Coverage

blib/lib/Acme/Pod/MathJax.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package Acme::Pod::MathJax;
2              
3 1     1   925 use strict;
  1         3  
  1         49  
4 1     1   5 use warnings;
  1         2  
  1         87  
5              
6             our $VERSION = '0.03';
7             $VERSION = eval $VERSION;
8              
9             1;
10              
11             =head1 NAME
12              
13             Acme::Pod::MathJax - All your math are belong to us!
14              
15             =head1 DESCRIPTION
16              
17             For now this isn't a module as such, but rather a way to test different pod-renderer's abilities to handle MathJax. The following examples are taken directly from MathJax's website.
18              
19             =head1 EXAMPLES
20              
21             The following equations are represented in the HTML source code as LaTeX expressions.
22              
23             =head2 The Lorenz Equations
24              
25             \[\begin{aligned}
26             \dot{x} & = \sigma(y-x) \\
27             \dot{y} & = \rho x - y - xz \\
28             \dot{z} & = -\beta z + xy
29             \end{aligned} \]
30              
31             =head2 The Cauchy-Schwarz Inequality
32              
33             \[ \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) \]
34              
35             =head2 A Cross Product Formula
36              
37             \[\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix}
38             \mathbf{i} & \mathbf{j} & \mathbf{k} \\
39             \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\
40             \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0
41             \end{vmatrix} \]
42              
43             =head2 The probability of getting \(k\) heads when flipping \(n\) coins is
44              
45             \[P(E) = {n \choose k} p^k (1-p)^{ n-k} \]
46              
47             =head2 An Identity of Ramanujan
48              
49             \[ \frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} =
50             1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}}
51             {1+\frac{e^{-8\pi}} {1+\ldots} } } } \]
52              
53             =head2 A Rogers-Ramanujan Identity
54              
55             \[ 1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots =
56             \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})},
57             \quad\quad \text{for $|q| E 1$}. \]
58              
59             =head2 Maxwell's Equations
60              
61             \[ \begin{aligned}
62             \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 \\
63             \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\
64             \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned}
65             \]
66              
67             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.
68              
69             =head1 SEE ALSO
70              
71             =over
72              
73             =item L
74              
75             =item L
76              
77             =item L
78              
79             =back
80              
81             =head1 SOURCE REPOSITORY
82              
83             L
84              
85             =head1 AUTHOR
86              
87             Joel Berger, Ejoel.a.berger@gmail.comE
88              
89             =head1 COPYRIGHT AND LICENSE
90              
91             All content except math examples Copyright (C) 2013 by Joel Berger
92              
93             This library is free software; you can redistribute it and/or modify
94             it under the same terms as Perl itself.
95              
96             =begin html
97              
98            
112              
113             =end html
114              
115             =cut
116