diff --git a/config.toml b/config.toml index ea8847f..c2d7bb8 100644 --- a/config.toml +++ b/config.toml @@ -22,7 +22,7 @@ author = "Erik" highlight_code = true smart_punctuation = true bottom_footnotes = true -extra_syntaxes_and_themes = ["syntaxes/"] +extra_syntaxes_and_themes = ["syntaxes/"] # for typst support [extra] @@ -38,7 +38,7 @@ accent_color = "#ff7800" accent_color_dark = "#380891" # Ditto but for the dark theme. -fix_contrast_dark = true +fix_contrast_dark = false show_read_time = true diff --git a/content/blog/format-comparison.md b/content/blog/format-comparison.md deleted file mode 100644 index 4bda3a6..0000000 --- a/content/blog/format-comparison.md +++ /dev/null @@ -1,75 +0,0 @@ -+++ -title = "Comparison of some formats" -draft = true -insert_anchor_links = "left" - -[extra] -hot = true -katex = true -+++ - -- [ ] comparison table -- [ ] markdown - - [ ] math - - [ ] exportability - - [ ] programmability -- [ ] typst - - [ ] math - - [ ] exportability - - [ ] programmability -- [ ] latex - - [ ] math - - [ ] exportability - - [ ] programmability - -| | Markdown | Typst | Latex | -| :--- | :---| :--- | :--- | -| Math support | only using latex| great | great with an enormous community behind it -| Exportability | -| Programmability[^1] - -[^1]: like plotting, etc. - -## Markdown - -## Typst - -### Math support - -

Typst

- -In Typst we can plot using the `cetz` library like this: -```typst -#import "@preview/cetz:0.2.2" - -#cetz.canvas({ - import cetz.draw: * - import cetz.plot - plot.plot(size: (10, 4), x-tick-step: 2, y-tick-step: 50, - { - plot.add(domain: (-4, 4), - x => (x, calc.pow(x, 4) ), - label: $f(x)=x^4$ - ) - plot.add(domain: (-5, 6.34), - x => (x, calc.pow(x, 3)), - label: $f(x)=x^3$ - ) - plot.add(domain: (-10, 10), - x => (x, calc.pow(x, 2)), - label: $f(x) = x^2$ - ) - }) -}) -``` - -Which leads to this: - -
- {{image(url="https://files.catbox.moe/tplzsb.png")}} - -
some standard functions
-
- -## Latex - diff --git a/content/blog/format-comparison/index.md b/content/blog/format-comparison/index.md new file mode 100644 index 0000000..4af0fb2 --- /dev/null +++ b/content/blog/format-comparison/index.md @@ -0,0 +1,106 @@ ++++ +title = "Comparison of some formats" +draft = true +insert_anchor_links = "left" + +[extra] +hot = true +katex = true ++++ + +- [ ] comparison table +- [ ] markdown + - [ ] syntax + - [ ] programmability +- [ ] typst + - [ ] syntax + - [x] math + - [ ] programmability +- [ ] latex + - [ ] syntax + - [ ] math + - [ ] programmability +- [ ] tools + - [ ] pandoc + - [ ] excalidraw + - [ ] diagrams.net + +| | Markdown | Typst | Latex | +| :--- | :---| :--- | :--- | +| **Math support** | only using latex | great | great with an enormous community behind it +| **Exportability**[^2] | only `html` is supported | `pdf`, `svg` and `png` are directly supported | `pdf` is supported +| **Programmability**[^1] | can be programmed via `css`, `js` and `ts` | has many built in features a package store | has so many options, people are using it to write books! + +[^1]: like plotting, etc. +[^2]: many more are supported using pandoc + + + +## Typst + +### Math support + +Typst has pretty _neat_ Math support like this: + +
+ {{image(url="https://files.catbox.moe/ss9oo1.png")}} + +
$f_a(x)=a \cdot x^2$ and it's derivatives
+
+using this code: + +```typst , hide_lines=1-5 +#set page( + height: auto, + width: auto, +) + +$ +f_a (x)&=a dot x^2 \ +f_a ' (x)&=2a x\ +f_a '' (x)&=2a +$ +``` + +
+ +In Typst we can plot using the `cetz` library like this: +```typst +#import "@preview/cetz:0.2.2" + +#cetz.canvas({ + import cetz.draw: * + import cetz.plot + plot.plot(size: (10, 4), x-tick-step: 2, y-tick-step: 50, + { + plot.add(domain: (-4, 4), + x => (x, calc.pow(x, 4) ), + label: $f(x)=x^4$ + ) + plot.add(domain: (-5, 6.34), + x => (x, calc.pow(x, 3)), + label: $f(x)=x^3$ + ) + plot.add(domain: (-10, 10), + x => (x, calc.pow(x, 2)), + label: $f(x) = x^2$ + ) + }) +}) +``` + +Which leads to this: +
+ {{image(url="https://files.catbox.moe/tplzsb.png")}} + +
some standard functions
+
+ +### Exportability + +Typst can be exported to `pdf`, `svg` and `png` directly and many more using [pandoc](https://pandoc.org) + +### Programmability + + + diff --git a/content/blog/assets/cetz.typ b/content/blog/format-comparison/typst/cetz.typ similarity index 100% rename from content/blog/assets/cetz.typ rename to content/blog/format-comparison/typst/cetz.typ diff --git a/content/blog/format-comparison/typst/math.typ b/content/blog/format-comparison/typst/math.typ new file mode 100644 index 0000000..3acbc6f --- /dev/null +++ b/content/blog/format-comparison/typst/math.typ @@ -0,0 +1,11 @@ +#set page( + height: auto, + width: auto, + margin: .5cm +) + +$ +f_a (x)&=a dot x^2 \ +f_a ' (x)&=2a x\ +f_a '' (x)&=2a +$ \ No newline at end of file