summaryrefslogtreecommitdiffstats
path: root/lua/Snippets/tex
diff options
context:
space:
mode:
authorNanderty <psopka@sopka.ch>2023-05-19 17:08:13 +0200
committerNanderty <psopka@sopka.ch>2023-05-19 17:08:13 +0200
commit95686ce8c52cab5d43ec5cc031ce3758589a5f8f (patch)
treedd00f6c20d8bbfa4406e80512258aa60239b96b0 /lua/Snippets/tex
parent5b86f069582eaff5d360e62e28dcaba3aee9de47 (diff)
downloadneovim-config-95686ce8c52cab5d43ec5cc031ce3758589a5f8f.tar.gz
neovim-config-95686ce8c52cab5d43ec5cc031ce3758589a5f8f.tar.bz2
neovim-config-95686ce8c52cab5d43ec5cc031ce3758589a5f8f.zip
graphics
Diffstat (limited to 'lua/Snippets/tex')
-rw-r--r--lua/Snippets/tex/environments.lua6
-rw-r--r--lua/Snippets/tex/figures.lua71
-rw-r--r--lua/Snippets/tex/greek.lua4
-rw-r--r--lua/Snippets/tex/math.lua36
-rw-r--r--lua/Snippets/tex/symbols.lua14
5 files changed, 123 insertions, 8 deletions
diff --git a/lua/Snippets/tex/environments.lua b/lua/Snippets/tex/environments.lua
index c4bb38a..f2eb15a 100644
--- a/lua/Snippets/tex/environments.lua
+++ b/lua/Snippets/tex/environments.lua
@@ -2,7 +2,7 @@ local helper = require('Snippets.luasniphelpers')
local helper = require('Snippets.luasniphelpers')
return {
- -- variable environment
+
s({ trig = 'beg', snippetType = 'autosnippet' },
fmta(
[[
@@ -18,7 +18,7 @@ return {
),
{ condition = helper.line_begin }
),
- -- enumerate environment
+
s({ trig = 'enu', snippetType = 'autosnippet' },
fmta(
[[
@@ -32,7 +32,7 @@ return {
),
{ condition = helper.line_begin }
),
- -- align environment
+
s({ trig = 'ali', snippetType = 'autosnippet' },
fmta(
[[
diff --git a/lua/Snippets/tex/figures.lua b/lua/Snippets/tex/figures.lua
new file mode 100644
index 0000000..f95d874
--- /dev/null
+++ b/lua/Snippets/tex/figures.lua
@@ -0,0 +1,71 @@
+local tex = require('Snippets.luasniphelperslatex')
+local helper = require('Snippets.luasniphelpers')
+
+return {
+
+ s({ trig = 'chfig', snippetType = 'autosnippet' },
+ fmta(
+ [[
+\begin{figure}[h]
+ \centering
+ \chemfig {
+ <>
+ }
+ \caption{<>}
+ \label{fig:<>}
+\end{figure}
+]],
+ {
+ i(1),
+ i(2),
+ i(3),
+ }
+ ),
+ { condition = helper.line_begin }
+ ),
+
+ s({ trig = 'imfig', snippetType = 'autosnippet' },
+ fmta(
+ [[
+\begin{figure}[h]
+ \centering
+ \includegraphics
+ [<>]
+ {<>}
+ \caption{<>}
+ \label{fig:<>}
+\end{figure}
+]],
+ {
+ i(1),
+ i(2),
+ i(3),
+ i(4),
+ }
+ ),
+ { condition = helper.line_begin }
+ ),
+
+ s({ trig = 'pdfig', snippetType = 'autosnippet' },
+ fmta(
+ [[
+\begin{figure}[h]
+ \centering
+ \resizebox
+ {<>}
+ {!}
+ {\input{<>}}
+ \caption{<>}
+ \label{fig:<>}
+\end{figure}
+]],
+ {
+ i(1),
+ i(2),
+ i(3),
+ i(4),
+ }
+ ),
+ { condition = helper.line_begin }
+ ),
+}
diff --git a/lua/Snippets/tex/greek.lua b/lua/Snippets/tex/greek.lua
index 7431adc..b2d076e 100644
--- a/lua/Snippets/tex/greek.lua
+++ b/lua/Snippets/tex/greek.lua
@@ -131,14 +131,14 @@ return {
s({ trig = 'lam', snippetType = 'autosnippet' },
{
- t('\\lam '),
+ t('\\lambda '),
},
{ condition = tex.in_mathzone }
),
s({ trig = 'Lam', snippetType = 'autosnippet' },
{
- t('\\Lam '),
+ t('\\Lambda '),
},
{ condition = tex.in_mathzone }
),
diff --git a/lua/Snippets/tex/math.lua b/lua/Snippets/tex/math.lua
index 882231a..47c21a8 100644
--- a/lua/Snippets/tex/math.lua
+++ b/lua/Snippets/tex/math.lua
@@ -44,6 +44,16 @@ return {
{ condition = tex.in_mathzone }
),
+ s({ trig = "lim", snippetType = "autosnippet" },
+ fmta(
+ '\\lim_{<>}',
+ {
+ i(1),
+ }
+ ),
+ { condition = tex.in_mathzone }
+ ),
+
s({ trig = "int", snippetType = "autosnippet" },
fmta(
'\\int_{<>}^{<>}',
@@ -150,7 +160,7 @@ return {
s({ trig = "sin", snippetType = "autosnippet" },
fmta(
- '\\sin{<>}',
+ '\\sin{(<>)}',
{
i(1),
}
@@ -160,7 +170,7 @@ return {
s({ trig = "cos", snippetType = "autosnippet" },
fmta(
- '\\cos{<>}',
+ '\\cos{(<>)}',
{
i(1),
}
@@ -170,7 +180,27 @@ return {
s({ trig = "tan", snippetType = "autosnippet" },
fmta(
- '\\tan{<>}',
+ '\\tan{(<>)}',
+ {
+ i(1),
+ }
+ ),
+ { condition = tex.in_mathzone }
+ ),
+
+ s({ trig = "det", snippetType = "autosnippet" },
+ fmta(
+ '\\det{(<>)}',
+ {
+ i(1),
+ }
+ ),
+ { condition = tex.in_mathzone }
+ ),
+
+ s({ trig = "ln", snippetType = "autosnippet" },
+ fmta(
+ '\\ln{(<>)}',
{
i(1),
}
diff --git a/lua/Snippets/tex/symbols.lua b/lua/Snippets/tex/symbols.lua
index 76fc3c2..ef57ca4 100644
--- a/lua/Snippets/tex/symbols.lua
+++ b/lua/Snippets/tex/symbols.lua
@@ -59,10 +59,24 @@ return {
{ condition = tex.in_mathzone }
),
+ s({ trig = 'perp', snippetType = 'autosnippet' },
+ {
+ t('\\perp '),
+ },
+ { condition = tex.in_mathzone }
+ ),
+
s({ trig = 'Ria', snippetType = 'autosnippet' },
{
t('\\Rightarrow '),
},
{ condition = tex.in_mathzone }
),
+
+ s({ trig = 'to', snippetType = 'autosnippet' },
+ {
+ t('\\to '),
+ },
+ { condition = tex.in_mathzone }
+ ),
}