You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -19,6 +20,19 @@ A SwiftUI view that renders LaTeX.
19
20
-[TeX Options](#♾️-tex-options)
20
21
-[Caching](#🗄️-caching)
21
22
-[Preloading](#🏃♀️-preloading)
23
+
24
+
## ℹ️ About
25
+
26
+
`LaTexSwiftUI` is a package that exposes a view named `LaTeX` that can parse and render TeX and LaTeX equations that contain math-mode marcos.
27
+
28
+
The view utilizes the [MathJaxSwift](https://www.github.com/colinc86/MathJaxSwift) package to render equations with [MathJax](https://www.mathjax.org). Thus, the limitations of the view are heavily influenced by the [limitations](https://docs.mathjax.org/en/v2.7-latest/tex.html#differences) of MathJax.
29
+
30
+
It will
31
+
- render TeX and LaTeX equations (math-mode macros),
32
+
- and render the `\text{}` macro within equations.
33
+
34
+
It won't
35
+
- render TeX and LaTeX documents (text-mode macros, with the exception of the rule above).
22
36
23
37
## 📦 Installation
24
38
@@ -62,7 +76,7 @@ Along with supporting the built-in SwiftUI modifies, `LaTeXSwiftUI` defines more
62
76
63
77
#### 🔤 Parsing Mode
64
78
65
-
`LaTexSwiftUI`can parse and render equations (aside from the entire input string) defined with the following terminators.
79
+
Text input can either be completely rendered, or the view can search for top-level equations delimited by the following terminators.
66
80
67
81
| Terminators |
68
82
|-------------|
@@ -72,15 +86,20 @@ Along with supporting the built-in SwiftUI modifies, `LaTeXSwiftUI` defines more
72
86
|`\begin{equation}...\end{equation}`|
73
87
|`\begin{equation*}...\end{equation*}`|
74
88
75
-
Text input can either be completely rendered, or `LaTeXSwiftUI` can search for top-level equations. The default behavior is to only render equations with `onlyEquations`. Use the `parsingMode` modifier to change the default behavior.
89
+
The default behavior is to only render equations with `onlyEquations`. Use the `parsingMode` modifier to change the default behavior.
76
90
77
91
```swift
92
+
// Only parse equations (default)
93
+
LaTeX("Euler's identity is $e^{i\\pi}+1=0$.")
94
+
.font(.system(size: 18))
95
+
.parsingMode(.onlyEquations)
96
+
78
97
// Parse the entire input
79
-
LaTeX("e^{i\\pi}+1=0")
98
+
LaTeX("\\text{Euler's identity is } e^{i\\pi}+1=0\\text{.}")
0 commit comments