Skip to content

Commit 186e176

Browse files
committed
Update dependencies and README.
1 parent f56f060 commit 186e176

File tree

4 files changed

+30
-11
lines changed

4 files changed

+30
-11
lines changed

Package.resolved

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let package = Package(
1717
dependencies: [
1818
.package(url: "https://github.com/colinc86/MathJaxSwift", from: "3.2.2"),
1919
.package(url: "https://github.com/exyte/SVGView", from: "1.0.4"),
20-
.package(url: "https://github.com/kean/Nuke", from: "11.3.1"),
20+
.package(url: "https://github.com/kean/Nuke", from: "12.1.0"),
2121
.package(url: "https://github.com/Kitura/swift-html-entities", from: "4.0.1")
2222
],
2323
targets: [

README.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# LaTeXSwiftUI
22

3-
A SwiftUI view that renders LaTeX.
3+
A SwiftUI view that renders LaTeX equations.
44

55
![Swift Version](https://img.shields.io/badge/Swift-5.7-orange?logo=swift) ![iOS Version](https://img.shields.io/badge/iOS-16-informational) ![macOS Version](https://img.shields.io/badge/macOS-13-informational)
66

77
<center><img src="./assets/images/device.png" width="362" height="707"></center>
88

99
## 📖 Contents
1010

11+
- [About](#ℹ️-about)
1112
- [Installation](#📦-installation)
1213
- [Usage](#⌨️-usage)
1314
- [Modifiers](#⚙️-modifiers)
@@ -19,6 +20,19 @@ A SwiftUI view that renders LaTeX.
1920
- [TeX Options](#♾️-tex-options)
2021
- [Caching](#🗄️-caching)
2122
- [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).
2236

2337
## 📦 Installation
2438

@@ -62,7 +76,7 @@ Along with supporting the built-in SwiftUI modifies, `LaTeXSwiftUI` defines more
6276

6377
#### 🔤 Parsing Mode
6478

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.
6680

6781
| Terminators |
6882
|-------------|
@@ -72,15 +86,20 @@ Along with supporting the built-in SwiftUI modifies, `LaTeXSwiftUI` defines more
7286
| `\begin{equation}...\end{equation}` |
7387
| `\begin{equation*}...\end{equation*}` |
7488

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.
7690

7791
```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+
7897
// Parse the entire input
79-
LaTeX("e^{i\\pi}+1=0")
98+
LaTeX("\\text{Euler's identity is } e^{i\\pi}+1=0\\text{.}")
8099
.parsingMode(.all)
81100
```
82101

83-
> <img src="./assets/images/euler.png" width="75" height="19.5">
102+
> <img src="./assets/images/euler.png" width="293" height="80">
84103
85104
#### 🌄 Image Rendering Mode
86105

@@ -152,7 +171,7 @@ Input may contain HTML entities such as `&lt;` which will not be parsed by LaTeX
152171
LaTeX("$x^2&lt;1$")
153172
.errorMode(.error)
154173

155-
// Replace "lt;" with "<"
174+
// Replace "&lt;" with "<"
156175
LaTeX("$x^2&lt;1$")
157176
.unencoded()
158177
```

assets/images/euler.png

17.6 KB
Loading

0 commit comments

Comments
 (0)