🔧 Added piecewise function latex alias

This commit is contained in:
z3rOR0ne 2025-03-06 17:05:38 -08:00
parent aa1fea2f0a
commit 5391a73d45
2 changed files with 21 additions and 0 deletions

View file

@ -175,6 +175,16 @@ matches:
force_clipboard: true
replace: "$$ x = \\frac{-(b) \\pm \\sqrt{(b)^2 - 4(a)(c)}}{2(a)} $$"
# prints out latex piecewise function
- trigger: ";piece"
force_clipboard: true
replace: "{{output}}"
vars:
- name: output
type: shell
params:
cmd: "~/scripts/piecewise ; echo ''"
- trigger: ";<h1"
force_clipboard: true
replace: "<h1> </h1>"

11
scripts/piecewise Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
# Utilize in conjunction with espanso, call ;html5
cat <<EOM
\$$
f(x) =
\begin{cases}
x - 3 & \text{if } x \geq 3 \\
-(x - 3) & \text{if } x < 3
\end{cases}
\$$
EOM