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
The `LaTeX` view's body is built up of `Text` views so feel free to use any of the supported modifiers.
38
52
@@ -46,7 +60,17 @@ LaTeX("Hello, $\\LaTeX$!")
46
60
47
61
Along with supporting the built-in SwiftUI modifies, `LaTeXSwiftUI` defines more to let you configure the view.
48
62
49
-
#### Parsing Mode
63
+
#### 🔤 Parsing Mode
64
+
65
+
`LaTexSwiftUI` can parse and render equations (aside from the entire input string) defined with the following terminators.
66
+
67
+
| Terminators |
68
+
|-------------|
69
+
|`$...$`|
70
+
|`$$...$$`|
71
+
|`\[...\]`|
72
+
|`\begin{equation}...\end{equation}`|
73
+
|`\begin{equation*}...\end{equation*}`|
50
74
51
75
Text input can either be completely rendered, or `LaTeXSwiftUI` can search for top-level equations. The default behavior is to only render equations. Use the `parsingMode` modifier to change the default behavior.
`LaTexSwiftUI` can parse and render equations (aside from the entire input string) defined with the following terminators.
68
-
69
-
| Terminators |
70
-
|-------------|
71
-
|`$...$`|
72
-
|`$$...$$`|
73
-
|`\[...\]`|
74
-
|`\begin{equation}...\end{equation}`|
75
-
|`\begin{equation*}...\end{equation*}`|
76
-
77
-
#### Image Rendering Mode
89
+
#### 🌄 Image Rendering Mode
78
90
79
91
You can specify the rendering mode of the rendered equations so that they either take on the style of the surrounding text or display the style rendered by MathJax. The default behavior is to use the `template` rendering mode so that images match surrounding text.
When an error occurs while parsing the input the view will display the original LaTeX. You can change this behavior by modifying the view's `errorMode`.
The typical "LaTeX-ish" way to render the input is with `blockViews`. This mode renders text as usual, and block equations as... blocks; on their own line and centered. MathJax 3 does not support line breaking, so the view places block equations in horizontal scroll views in case the width of the equation is more than the width of the view.
116
128
@@ -136,7 +148,7 @@ LaTeX("The quadratic formula is $$x=\\frac{-b\\pm\\sqrt{b^2-4ac}}{2a}$$ and it h
Input may contain HTML entities such as `<` which will not be parsed by LaTeX as anything meaningful. In this case, you may use the `unencoded` modifier.
`LaTeXSwiftUI` caches its SVG responses from MathJax and the images rendered as a result of the view's environment. If you want to control the cache, then you can access the static `cache` property.
166
178
@@ -176,9 +188,9 @@ LaTeX.imageCache.removeAll()
176
188
177
189
`LaTeXSwiftUI` uses the [caching](https://github.com/kean/Nuke/tree/master/Sources/Nuke/Caching) components of the [Nuke](https://github.com/kean/Nuke) package.
178
190
179
-
### Preloading
191
+
### 🏃♀️ Preloading
180
192
181
-
SVGs and images are rendered and cached on demand, but there may be situations where you want to preload the data so that there is no lag when the view appears.
193
+
SVGs and images are rendered and cached on demand, but there may be situations where you want to preload the data so that there is minimal lag when the view appears.
0 commit comments