Skip to content

Commit

Permalink
Add MathJax to Doc
Browse files Browse the repository at this point in the history
  • Loading branch information
li3zhen1 committed Oct 22, 2023
1 parent a4ca999 commit d1bedb3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
13 changes: 13 additions & 0 deletions DocPostprocess.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ do {
font-variation-settings: 'wght' 600, 'opsz' 24!important;
}
</style>
<script>
MathJax = {
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']]
},
svg: {
fontCache: 'global'
}
};
</script>
<script type="text/javascript" id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js">
</script>
""")

try htmlString.write(toFile: indexPath, atomically: false, encoding: .utf8)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ The basic concepts of simulations and forces can be found here: [Force simulatio
* <doc:Creating2DAnd3DSimulations>
* ``Simulation2D``
* ``Simulation3D``

* ``Simulation``

### Creating forces in a simulation
Expand Down
2 changes: 1 addition & 1 deletion Sources/ForceSimulation/Simulation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public final class Simulation<NodeID, V> where NodeID: Hashable, V: VectorLike,
/// A 2D simulation running on `Double` and `simd_double2` types.
public typealias Simulation2D<NodeID> = Simulation<NodeID, Vector2d> where NodeID: Hashable

/// A 3D simulation running on `Double` and `simd_double2` types.
/// A 3D simulation running on `Double` and `simd_double3` types.
public typealias Simulation3D<NodeID> = Simulation<NodeID, Vector3d> where NodeID: Hashable

#endif
2 changes: 1 addition & 1 deletion Sources/ForceSimulation/forces/CenterForce.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import NDTree

/// A force that drives nodes towards the center.
/// Center force is relatively fast, the complexity is `O(n)`,
/// Center force is relatively fast, the complexity is $O(n)$,
/// where `n` is the number of nodes.
/// See [Collide Force - D3](https://d3js.org/d3-force/collide).
final public class CenterForce<NodeID, V>: ForceLike
Expand Down

0 comments on commit d1bedb3

Please sign in to comment.