Skip to content
Snippets Groups Projects
Commit b5381fda authored by HEME Clement's avatar HEME Clement Committed by STEVAN Antoine
Browse files

Added Latex support for doc (!197)

Added a html header files, an added metadata line in Cargo.toml and some formatting changes in the doc to have Latex formulas in docs.rs. It works locally, should work online
parent 3c8afac4
No related branches found
No related tags found
1 merge request!197Added Latex support for doc
Pipeline #8183 passed
......@@ -50,6 +50,7 @@ fs = []
[package.metadata.docs.rs]
features = ["kzg", "aplonk"]
rustdoc-args = [ "--html-in-header", "katex.html" ]
[[example]]
name = "kzg"
......
......@@ -63,7 +63,7 @@ show:
.PHONY: doc
doc:
cargo doc --document-private-items --no-deps --open
RUSTDOCFLAGS="--html-in-header katex.html" cargo doc --no-deps --open
.PHONY: build-examples
build-examples:
......
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/katex.min.css" integrity="sha384-9eLZqc9ds8eNjO3TmqPeYcDj8n+Qfa4nuSiGYa6DjLNcv9BtN69ZIulL9+8CqC9Y" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/katex.min.js" integrity="sha384-K3vbOmF2BtaVai+Qk37uypf7VrgBubhQreNQe9aGsz9lB63dIFiQVlJbr92dw2Lx" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/contrib/auto-render.min.js" integrity="sha384-kmZOZB5ObwgQnS/DuDg6TScgOiWWBiVt0plIRkZCmE6rDZGrEOQeHM5PcHi+nyqe" crossorigin="anonymous"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
renderMathInElement(document.body, {
delimiters: [
{left: "$$", right: "$$", display: true},
{left: "\\(", right: "\\)", display: false},
{left: "$", right: "$", display: false},
{left: "\\[", right: "\\]", display: true}
]
});
});
</script>
......@@ -17,7 +17,7 @@ pub struct Shard<F: PrimeField> {
///
/// this effectively allows support for _recoding_.
///
/// If we denote the $k$ source shards by $(s_i)_{0 \le i \lt k}$, the linear combination by $k$
/// If we denote the $k$ source shards by $(s\_i)\_\{0 \le i \lt k\}$, the linear combination by $k$
/// coefficients $(\alpha_i)_{0 \le i \lt k}$ and $s$ the shard itself, then
///
/// $$ s = \sum\limits_{i = 0}^{k - 1} \alpha_i s_i$$
......@@ -72,8 +72,8 @@ impl<F: PrimeField> Shard<F> {
/// > returns [`None`] if the number of shards is not the same as the number of
/// > coefficients or if no shards are provided.
///
/// if the shards are the $(s_i)_{1 \le i \le n}$ and the coefficients the
/// $(\alpha_i)_{0 \le i \le n}$, then the output will be
/// if the shards are the $(s \_i)\_\{1 \le i \le n\}$ and the coefficients the
/// $(\alpha\_i)\_\{0 \le i \le n\}$, then the output will be
///
/// $$ \sum\limits_{i = 1}^{n} \alpha_i s_i$$
pub fn recode_with_coeffs<F: PrimeField>(shards: &[Shard<F>], coeffs: &[F]) -> Option<Shard<F>> {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment