From 4ccaccb6b9848380a9f888211e19a5794b7b4462 Mon Sep 17 00:00:00 2001 From: Nanderty Date: Mon, 23 Sep 2024 18:31:13 +0200 Subject: add additional snippets for math. --- lua/Snippets/tex/chemistry.lua | 2 +- lua/Snippets/tex/general.lua | 16 ++++++++++++++++ lua/Snippets/tex/math.lua | 14 ++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/lua/Snippets/tex/chemistry.lua b/lua/Snippets/tex/chemistry.lua index 4fd940e..de28c96 100644 --- a/lua/Snippets/tex/chemistry.lua +++ b/lua/Snippets/tex/chemistry.lua @@ -65,7 +65,7 @@ return { s({ trig = 'cpnd', snippetType = 'autosnippet' }, fmta( - '(\\cmpd{<>}, \\SI{<>}{\\gram}, \\SI{<>}{\\milli\\mol}, \\SI{<>}{\\equiv})', + '(\\cmpd{<>}, \\qty{<>}{\\gram}, \\qty{<>}{\\milli\\mol}, \\qty{<>}{\\equiv})', { i(1), i(2), diff --git a/lua/Snippets/tex/general.lua b/lua/Snippets/tex/general.lua index 3debd62..f50e4c2 100644 --- a/lua/Snippets/tex/general.lua +++ b/lua/Snippets/tex/general.lua @@ -28,6 +28,13 @@ return { { condition = helper.line_begin } ), + s({ trig = 'clp', snippetType = 'autosnippet' }, + { + t('\\clearpage'), + }, + { condition = helper.line_begin } + ), + s({ trig = 'qnt', snippetType = 'autosnippet' }, fmta( '\\qty{<>}{<>}', @@ -49,6 +56,15 @@ return { ) ), + s({ trig = 'snr', snippetType = 'autosnippet' }, + fmta( + '\\num{<>}', + { + i(1), + } + ) + ), + s({ trig = 'snt', snippetType = 'autosnippet' }, fmta( '\\unit{<>}', diff --git a/lua/Snippets/tex/math.lua b/lua/Snippets/tex/math.lua index 256ce10..25a7db9 100644 --- a/lua/Snippets/tex/math.lua +++ b/lua/Snippets/tex/math.lua @@ -179,6 +179,20 @@ return { { condition = tex.in_mathzone } ), + s({ trig = 'bgg', snippetType = 'autosnippet' }, + { + t('\\bigg'), + }, + { condition = tex.in_mathzone } + ), + + s({ trig = 'rvr', snippetType = 'autosnippet' }, + { + t('\\rvert'), + }, + { condition = tex.in_mathzone } + ), + s({ trig = "sin", snippetType = "autosnippet" }, fmta( '\\sin{\\left(<>\\right)}', -- cgit v1.2.3