blog/content/blog/format-comparison/index.md

106 lines
2.2 KiB
Markdown

+++
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
<!-- ## Markdown -->
## Typst
### Math support
Typst has pretty _neat_ Math support like this:
<figure>
{{image(url="https://files.catbox.moe/ss9oo1.png")}}
<!-- created using `math.typ` -->
<figcaption>$f_a(x)=a \cdot x^2$ and it's derivatives</figcaption>
</figure>
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
$
```
<br>
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:
<figure>
{{image(url="https://files.catbox.moe/tplzsb.png")}}
<!-- using `cetz.typ` -->
<figcaption>some standard functions</figcaption>
</figure>
### Exportability
Typst can be exported to `pdf`, `svg` and `png` directly and many more using [pandoc](https://pandoc.org)
### Programmability
<!-- ## Latex -->