update
This commit is contained in:
@@ -101,5 +101,13 @@ return {
|
||||
}
|
||||
),
|
||||
{ condition = line_begin }
|
||||
)
|
||||
),
|
||||
s(
|
||||
{ trig = "defop" },
|
||||
fmta("#let <> = math.op(\"<>\")", {
|
||||
i(1),
|
||||
rep(1),
|
||||
}),
|
||||
{ condition = tex.in_mathzone }
|
||||
),
|
||||
}
|
||||
|
||||
@@ -72,9 +72,6 @@ return {
|
||||
s({ trig = "get", wordTrig = false, snippetType = "autosnippet" }, {
|
||||
t("gets"),
|
||||
}, { condition = tex.in_mathzone }),
|
||||
s({ trig = "to", wordTrig = false, snippetType = "autosnippet" }, {
|
||||
t("to"),
|
||||
}, { condition = tex.in_mathzone }),
|
||||
s({ trig = "mto", wordTrig = false, snippetType = "autosnippet", priority = 1001 }, {
|
||||
t("mapsto"),
|
||||
}, { condition = tex.in_mathzone }),
|
||||
@@ -123,17 +120,20 @@ return {
|
||||
s({ trig = "subset=", wordTrig = false, snippetType = "autosnippet" }, {
|
||||
t("subset.eq"),
|
||||
}, { condition = tex.in_mathzone }),
|
||||
s({ trig = "subset!=", wordTrig = false, snippetType = "autosnippet" }, {
|
||||
t("subset.neq"),
|
||||
}, { condition = tex.in_mathzone }),
|
||||
s({ trig = "supp", wordTrig = false, snippetType = "autosnippet" }, {
|
||||
t("supset"),
|
||||
}, { condition = tex.in_mathzone }),
|
||||
s({ trig = "supset=", wordTrig = false, snippetType = "autosnippet" }, {
|
||||
t("supset.eq"),
|
||||
}, { condition = tex.in_mathzone }),
|
||||
s({ trig = "tp", wordTrig = false, snippetType = "autosnippet" }, {
|
||||
t("^top"),
|
||||
s({ trig = "supp", wordTrig = false, snippetType = "autosnippet" }, {
|
||||
t("supset"),
|
||||
}, { condition = tex.in_mathzone }),
|
||||
s({ trig = "dr", wordTrig = false, snippetType = "autosnippet" }, {
|
||||
t("^dagger"),
|
||||
s({ trig = "supset!=", wordTrig = false, snippetType = "autosnippet" }, {
|
||||
t("supset.neq"),
|
||||
}, { condition = tex.in_mathzone }),
|
||||
s({ trig = "perp", wordTrig = false, snippetType = "autosnippet" }, {
|
||||
t("perp"),
|
||||
@@ -144,17 +144,8 @@ return {
|
||||
s({ trig = "xx", wordTrig = false, snippetType = "autosnippet" }, {
|
||||
t("times"),
|
||||
}, { condition = tex.in_mathzone }),
|
||||
s({ trig = "llr", wordTrig = false, snippetType = "autosnippet" }, {
|
||||
t("longleftrightarrow"),
|
||||
}, { condition = tex.in_mathzone }),
|
||||
s({ trig = "up", wordTrig = false, snippetType = "autosnippet" }, {
|
||||
t("uparrow"),
|
||||
}, { condition = tex.in_mathzone }),
|
||||
s({ trig = "down", wordTrig = false, snippetType = "autosnippet" }, {
|
||||
t("downarrow"),
|
||||
}, { condition = tex.in_mathzone }),
|
||||
s({ trig = "cir", wordTrig = false, snippetType = "autosnippet" }, {
|
||||
t("circ"),
|
||||
t("compose"),
|
||||
}, { condition = tex.in_mathzone }),
|
||||
s({ trig = "iso", wordTrig = false, snippetType = "autosnippet" }, {
|
||||
t("cong"),
|
||||
|
||||
40
LuaSnip/typst/template.lua
Normal file
40
LuaSnip/typst/template.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
local ls = require("luasnip")
|
||||
local c = ls.choice_node
|
||||
local s = ls.snippet
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local fmta = require("luasnip.extras.fmt").fmta
|
||||
local tex = require("util.latex")
|
||||
local rep = require("luasnip.extras").rep
|
||||
local line_begin = require("luasnip.extras.expand_conditions").line_begin
|
||||
|
||||
return {
|
||||
s(
|
||||
{ trig = "assignment" },
|
||||
fmta(
|
||||
[[
|
||||
#import "@preview/sleek-university-assignment:0.1.0": assignment
|
||||
#import "@preview/theorion:0.4.0": *
|
||||
#show: assignment.with(
|
||||
title: "Assignment 3",
|
||||
authors: (
|
||||
(
|
||||
name: "Zelong Kuang",
|
||||
email: "zelongk@student.unimelb.edu.au",
|
||||
student-no: "1610081",
|
||||
),
|
||||
),
|
||||
course: "<>",
|
||||
)
|
||||
|
||||
<>
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
i(0),
|
||||
}
|
||||
),
|
||||
{ condition = tex.in_text * line_begin }
|
||||
),
|
||||
}
|
||||
Reference in New Issue
Block a user