summaryrefslogtreecommitdiff
path: root/snippets/latex.lua
diff options
context:
space:
mode:
authorMohammad Reza Karimi <m.r.karimi.j@gmail.com>2026-01-20 15:55:27 -0500
committerMohammad Reza Karimi <m.r.karimi.j@gmail.com>2026-01-20 15:55:27 -0500
commitaa5717f00fd14430c80939a68d7107c26de6e554 (patch)
tree784e99d9b018e0554369c41cb33e2e195e28d3c6 /snippets/latex.lua
first commit
Diffstat (limited to 'snippets/latex.lua')
-rw-r--r--snippets/latex.lua39
1 files changed, 39 insertions, 0 deletions
diff --git a/snippets/latex.lua b/snippets/latex.lua
new file mode 100644
index 0000000..7d95987
--- /dev/null
+++ b/snippets/latex.lua
@@ -0,0 +1,39 @@
+return {
+ env = {
+ prefix = "beg",
+ body = { "\\begin{${1:env}}", "\t$0", "\\end{${1:env}}", "" },
+ },
+ paragraph = {
+ prefix = "para",
+ body = {
+ "\\paragraph{${1:paragraph name}} % (fold)",
+ "${0:$TM_SELECTED_TEXT}",
+ "% paragraph $1 (end)",
+ },
+ },
+
+ itemize = {
+ prefix = "item",
+ body = { "\\begin{itemize}", "\t\\item $0", "\\end{itemize}", "" },
+ },
+ enumerate = {
+ prefix = "enum",
+ body = { "\\begin{enumerate}", "\t\\item $0", "\\end{enumerate}", "" },
+ },
+ item = { prefix = "++", body = "\\item $0" },
+
+ inlinemath = { prefix = "mk", body = "\\$${1:$TM_SELECTED_TEXT}\\$$0" },
+ displaymath = { prefix = "dm", body = { "\\[", "\t$1", "\\]", "$0" } },
+ equation_labeled = {
+ prefix = "eqn",
+ body = {
+ "\\begin{equation}\\label{eq:$2}",
+ "\t$1",
+ "\\end{equation}",
+ "$0",
+ },
+ },
+
+ bold = { prefix = "**", body = "\\textbf{${1:$TM_SELECTED_TEXT}}$0" },
+ italic = { prefix = "__", body = "\\emph{${1:$TM_SELECTED_TEXT}}$0" },
+}