This commit is contained in:
sharings 2025-07-26 12:43:01 +00:00
commit 1e2ca5a6fc
71 changed files with 3330 additions and 0 deletions

View file

@ -0,0 +1,40 @@
-- https://github.com/L3MON4D3/LuaSnip/wiki/Cool-Snippets#tabular
table_node= function(args)
local tabs = {}
local count
table = args[1][1]:gsub("%s",""):gsub("|","")
count = table:len()
for j=1, count do
local iNode
iNode = i(j)
tabs[2*j-1] = iNode
if j~=count then
tabs[2*j] = t" & "
end
end
return sn(nil, tabs)
end
rec_table = function ()
return sn(nil, {
c(1, {
t({""}),
sn(nil, {t{"\\\\",""} ,d(1,table_node, {ai[1]}), d(2, rec_table, {ai[1]})})
}),
});
end
return {
s(";table", {
t"\\begin{tabular}{",
i(1,"0"),
t{"}",""},
d(2, table_node, {1}, {}),
d(3, rec_table, {1}),
t{"","\\end{tabular}"}
}),
}