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,23 +60,7 @@ 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
50
-
51
-
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
66
@@ -74,7 +72,17 @@ LaTeX("e^{i\\pi}+1=0")
74
72
|`\begin{equation}...\end{equation}`|
75
73
|`\begin{equation*}...\end{equation*}`|
76
74
77
-
#### Image Rendering Mode
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.
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
124
@@ -136,7 +144,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
174
@@ -176,9 +184,9 @@ LaTeX.imageCache.removeAll()
176
184
177
185
`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
186
179
-
### Preloading
187
+
### 🏃♀️ Preloading
180
188
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.
189
+
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