Skip to content

Commit

Permalink
Fix equation rendering in docstrings (#309)
Browse files Browse the repository at this point in the history
* fix eqs rendering

* drop {aligned*} environment

* drop {eqnarray*} latex environments

* add aligned envs

* better align
  • Loading branch information
navidcy authored Nov 24, 2022
1 parent 7a0d840 commit 16fe479
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
16 changes: 8 additions & 8 deletions src/functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -633,10 +633,10 @@ either `Taylor1` or `TaylorN`.
The coefficients are given by
```math
\begin{eqnarray*}
s_k &=& \frac{1}{k}\sum_{j=0}^{k-1} (k-j) a_{k-j} c_j ,\\
c_k &=& -\frac{1}{k}\sum_{j=0}^{k-1} (k-j) a_{k-j} s_j.
\end{eqnarray*}
\begin{aligned}
s_k &= \frac{1}{k}\sum_{j=0}^{k-1} (k-j) a_{k-j} c_j ,\\
c_k &= -\frac{1}{k}\sum_{j=0}^{k-1} (k-j) a_{k-j} s_j.
\end{aligned}
```
""" sincos!
Expand Down Expand Up @@ -720,10 +720,10 @@ either `Taylor1` or `TaylorN`.
The coefficients are given by
```math
\begin{eqnarray*}
s_k &=& \frac{1}{k} \sum_{j=0}^{k-1} (k-j) a_{k-j} c_j, \\
c_k &=& \frac{1}{k} \sum_{j=0}^{k-1} (k-j) a_{k-j} s_j.
\end{eqnarray*}
\begin{aligned}
s_k = \frac{1}{k} \sum_{j=0}^{k-1} (k-j) a_{k-j} c_j, \\
c_k = \frac{1}{k} \sum_{j=0}^{k-1} (k-j) a_{k-j} s_j.
\end{aligned}
```
""" sinhcosh!
Expand Down
26 changes: 13 additions & 13 deletions src/power.jl
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ exploits `k_0`, the order of the first non-zero coefficient of `a`.

# The first non-zero coefficient of the result; must be integer
!isinteger(r*l0) && throw(DomainError(a,
"""The 0th order Taylor1 coefficient must be non-zero
"""The 0-th order Taylor1 coefficient must be non-zero
to raise the Taylor1 polynomial to a non-integer exponent."""))
lnull = trunc(Int, r*l0 )
kprime = k-lnull
Expand Down Expand Up @@ -278,12 +278,12 @@ both `c` and `a` either `Taylor1` or `TaylorN`.
The coefficients are given by
```math
\begin{eqnarray*}
c_k & = & 2 \sum_{j=0}^{(k-1)/2} a_{k-j} a_j,
\text{ if k is odd,} \\
c_k & = & 2 \sum_{j=0}^{(k-2)/2} a_{k-j} a_j + (a_{k/2})^2,
\text{ if k is even. }
\end{eqnarray*}
\begin{aligned}
c_k &= 2 \sum_{j=0}^{(k-1)/2} a_{k-j} a_j,
\text{ if $k$ is odd,} \\
c_k &= 2 \sum_{j=0}^{(k-2)/2} a_{k-j} a_j + (a_{k/2})^2,
\text{ if $k$ is even.}
\end{aligned}
```
""" sqr!
Expand Down Expand Up @@ -409,12 +409,12 @@ for both`c` and `a` either `Taylor1` or `TaylorN`.
The coefficients are given by
```math
\begin{eqnarray*}
c_k &=& \frac{1}{2 c_0} \big( a_k - 2 \sum_{j=1}^{(k-1)/2} c_{k-j}c_j\big),
\text{ if k is odd,} \\
c_k &=& \frac{1}{2 c_0} \big( a_k - 2 \sum_{j=1}^{(k-2)/2} c_{k-j}c_j
- (c_{k/2})^2\big), \text{ if k is even.}
\end{eqnarray*}
\begin{aligned}
c_k &= \frac{1}{2 c_0} \big( a_k - 2 \sum_{j=1}^{(k-1)/2} c_{k-j}c_j\big),
\text{ if $k$ is odd,} \\
c_k &= \frac{1}{2 c_0} \big( a_k - 2 \sum_{j=1}^{(k-2)/2} c_{k-j}c_j
- (c_{k/2})^2\big), \text{ if $k$ is even.}
\end{aligned}
```
For `Taylor1` polynomials, `k0` is the order of the first non-zero
Expand Down

0 comments on commit 16fe479

Please sign in to comment.