colinc86 / LaTeXSwiftUI

A SwiftUI view that renders LaTeX.
MIT License
186 stars 30 forks source link

Incorrect parsing of block math #10

Closed FliiFe closed 1 year ago

FliiFe commented 1 year ago

Whenever a math block is delimited with $$ but there is a line break around it, the library doesn't parse this correctly, as in the example below.

See how the code below renders:

A function $f(z)$ is said to be holomorphic in an open region $\Omega$ if it is complex differentiable at every point $z$ in $\Omega$. In other words, the derivative $f'(z)$ exists in the given region.

On the other hand, a function $f(z)$ is said to be analytic if it can be locally represented by a convergent power series. Specifically, for any point $z_0$ in the function's domain, there is a power series which converges to $f(z)$ in a neighborhood of $z_0$. The power series can be expressed as:

$$
f(z) = \sum_{n=0}^{\infty} a_n (z - z_0)^n
$$

Where $a_n$ are coefficients, and the power series converges for all $z$ in a neighborhood of $z_0$.

example

This is correctly handled my mathjax in the browser. This issue is also significant because subsequent math blocks (inline or not) are not correctly detected when they would have been without this issue.