Merge branch 'main' into dev

This commit is contained in:
arne314
2025-01-10 16:48:09 +01:00
committed by GitHub
2 changed files with 15 additions and 5 deletions

View File

@@ -20,6 +20,8 @@ return {
-- boolean logic
snip('no', 'not ', {}, math),
snip('ip', '==>> ', {}, math),
snip('ib', '<<== ', {}, math),
snip('iff', '<<=>> ', {}, math),
-- relations
@@ -42,7 +44,8 @@ return {
snip('bxx', 'times.square ', {}, math),
-- sets
snip('set', '{<>}', { i(1) }, math),
-- 'st' to '{<>} in ./visual.lua
snip('set', '{<>|<>}', { i(1), i(2) }, math),
snip('es', 'emptyset ', {}, math),
snip('ses', '{emptyset} ', {}, math),
snip('sp', 'supset ', {}, math),
@@ -70,10 +73,15 @@ return {
snip('(.*)kk', '<>^(<>)', { cap(1), i(1, 'n') }, math),
snip('ddx', '(d <>)(d <>)', { i(1, 'f'), i(2, 'x') }, math),
snip('it', 'integral_(<>)^(<>)', { i(1, 'a'), i(2, 'b') }, math),
snip('oit', 'integral_(Omega}', {}, math),
snip('dit', 'integral_{<>}', { i(1, 'Omega') }, math),
snip('sm', 'sum_(<>)^(<>)', { i(1, 'i=0'), i(2, 'oo') }, math),
snip('it', 'integral', {}, math),
snip('int', 'integral_(<>)^(<>)', { i(1, 'a'), i(2, 'b') }, math),
snip('oit', 'integral_Omega', {}, math),
snip('dit', 'integral_(<>)', { i(1, 'Omega') }, math),
snip('sm', 'sum ', {}, math),
snip('sum', 'sum_(<>)^(<>)', { i(1, 'i=0'), i(2, 'oo') }, math),
snip('osm', 'sum_Omega', {}, math),
snip('dsm', 'sum_(<>)', { i(1, 'I') }, math),
snip('lm', 'lim <>', { i(1, 'a_n') }, math),
snip('lim', 'lim_(<> ->> <>) <>', { i(1, 'n'), i(2, 'oo'), i(3, 'a_n') }, math),

View File

@@ -11,10 +11,12 @@ local math = helper.in_math
local snip = helper.snip
local snippets = {}
local operations = { -- first boolean: existing brackets should be kept; second boolean: brackets should be added
{ 'vi', '1/', '', true, false },
{ 'bb', '(', ')', true, false }, -- add round brackets
{ 'sq', '[', ']', true, false }, -- add square brackets
{ 'st', '{', '}', true, false }, -- add curly brackets
{ 'bB', '(', ')', false, false }, -- replace with round brackets
{ 'sQ', '[', ']', false, false }, -- replace with square brackets
{ 'BB', '', '', false, false }, -- remove brackets