summaryrefslogtreecommitdiffstats
path: root/lua/Snippets/tex
diff options
context:
space:
mode:
Diffstat (limited to 'lua/Snippets/tex')
-rw-r--r--lua/Snippets/tex/environments.lua1
-rw-r--r--lua/Snippets/tex/general.lua70
-rw-r--r--lua/Snippets/tex/german.lua13
-rw-r--r--lua/Snippets/tex/math.lua11
-rw-r--r--lua/Snippets/tex/postfix.lua33
-rw-r--r--lua/Snippets/tex/praeamble.lua4
-rw-r--r--lua/Snippets/tex/tables.lua12
-rw-r--r--lua/Snippets/tex/text.lua51
8 files changed, 121 insertions, 74 deletions
diff --git a/lua/Snippets/tex/environments.lua b/lua/Snippets/tex/environments.lua
index 1fa0301..89db7bc 100644
--- a/lua/Snippets/tex/environments.lua
+++ b/lua/Snippets/tex/environments.lua
@@ -1,5 +1,4 @@
local helper = require('Snippets.luasniphelpers')
-local helper = require('Snippets.luasniphelpers')
return {
diff --git a/lua/Snippets/tex/general.lua b/lua/Snippets/tex/general.lua
index f50e4c2..39025f4 100644
--- a/lua/Snippets/tex/general.lua
+++ b/lua/Snippets/tex/general.lua
@@ -3,22 +3,11 @@ local helper = require('Snippets.luasniphelpers')
return {
- s({ trig = 'vsp', snippetType = 'autosnippet' },
- fmta(
- '\\vspace{<>}',
- {
- i(1),
- }
- )
- ),
-
- s({ trig = 'hsp', snippetType = 'autosnippet' },
- fmta(
- '\\hspace{<>}',
- {
- i(1),
- }
- )
+ s({ trig = 'tbc', snippetType = 'autosnippet' },
+ {
+ t('\\tableofcontents'),
+ },
+ { condition = helper.line_begin }
),
s({ trig = 'nwp', snippetType = 'autosnippet' },
@@ -35,76 +24,57 @@ return {
{ condition = helper.line_begin }
),
- s({ trig = 'qnt', snippetType = 'autosnippet' },
- fmta(
- '\\qty{<>}{<>}',
- {
- i(1),
- i(2),
- }
- )
- ),
-
- s({ trig = 'qrt', snippetType = 'autosnippet' },
- fmta(
- '\\qtyrange{<>}{<>}{<>}',
- {
- i(1),
- i(2),
- i(3),
- }
- )
- ),
-
- s({ trig = 'snr', snippetType = 'autosnippet' },
+ s({ trig = 'vsp', snippetType = 'autosnippet' },
fmta(
- '\\num{<>}',
+ '\\vspace{<>}',
{
i(1),
}
)
),
- s({ trig = 'snt', snippetType = 'autosnippet' },
+ s({ trig = 'hsp', snippetType = 'autosnippet' },
fmta(
- '\\unit{<>}',
+ '\\hspace{<>}',
{
i(1),
}
)
),
- s({ trig = 'tbf', snippetType = 'autosnippet' },
+ s({ trig = 'qnt', snippetType = 'autosnippet' },
fmta(
- '\\textbf{<>}',
+ '\\qty{<>}{<>}',
{
i(1),
+ i(2),
}
)
),
- s({ trig = 'tlc', snippetType = 'autosnippet' },
+ s({ trig = 'qrt', snippetType = 'autosnippet' },
fmta(
- '\\textit{<>}',
+ '\\qtyrange{<>}{<>}{<>}',
{
i(1),
+ i(2),
+ i(3),
}
)
),
- s({ trig = 'tsp', snippetType = 'autosnippet' },
+ s({ trig = 'snr', snippetType = 'autosnippet' },
fmta(
- '\\textsuperscript{<>}',
+ '\\num{<>}',
{
i(1),
}
)
),
-
- s({ trig = 'tsb', snippetType = 'autosnippet' },
+ s({ trig = 'snt', snippetType = 'autosnippet' },
fmta(
- '\\textsubscript{<>}',
+ '\\unit{<>}',
{
i(1),
}
diff --git a/lua/Snippets/tex/german.lua b/lua/Snippets/tex/german.lua
deleted file mode 100644
index 70b12bf..0000000
--- a/lua/Snippets/tex/german.lua
+++ /dev/null
@@ -1,13 +0,0 @@
-local tex = require('Snippets.luasniphelperslatex')
-local helper = require('Snippets.luasniphelpers')
-
-return {
- s({ trig = 'enq', snippetType = 'autosnippet' },
- fmta(
- '\\enquote{<>}',
- {
- i(1),
- }
- )
- ),
-}
diff --git a/lua/Snippets/tex/math.lua b/lua/Snippets/tex/math.lua
index 25a7db9..ddaf2a2 100644
--- a/lua/Snippets/tex/math.lua
+++ b/lua/Snippets/tex/math.lua
@@ -174,6 +174,13 @@ return {
{ condition = tex.in_mathzone }
),
+ s({ trig = 'str', snippetType = 'autosnippet' },
+ {
+ t('\\star '),
+ },
+ { condition = tex.in_mathzone }
+ ),
+
s({ trig = 'df', snippetType = 'autosnippet' },
{ t('\\,d ') },
{ condition = tex.in_mathzone }
@@ -181,14 +188,14 @@ return {
s({ trig = 'bgg', snippetType = 'autosnippet' },
{
- t('\\bigg'),
+ t('\\bigg '),
},
{ condition = tex.in_mathzone }
),
s({ trig = 'rvr', snippetType = 'autosnippet' },
{
- t('\\rvert'),
+ t('\\rvert '),
},
{ condition = tex.in_mathzone }
),
diff --git a/lua/Snippets/tex/postfix.lua b/lua/Snippets/tex/postfix.lua
new file mode 100644
index 0000000..6cc071e
--- /dev/null
+++ b/lua/Snippets/tex/postfix.lua
@@ -0,0 +1,33 @@
+local helper = require('Snippets.luasniphelpers')
+
+return {
+
+ s({ trig = 'bgn', snippetType = 'autosnippet' },
+ fmta(
+ [[
+\lstinputlisting[
+ language = <>,
+ firstline = <>,
+ caption = {
+ <>
+ },
+]{<>}
+]],
+ {
+ i(1),
+ i(2),
+ i(3),
+ i(4),
+ }
+ ),
+ { condition = helper.line_begin }
+ ),
+
+ s({ trig = 'pbl', snippetType = 'autosnippet' },
+ {
+ t('\\printbibliography[heading=none]')
+ },
+ { condition = helper.line_begin }
+ ),
+
+}
diff --git a/lua/Snippets/tex/praeamble.lua b/lua/Snippets/tex/praeamble.lua
index e0daa28..d1f8c79 100644
--- a/lua/Snippets/tex/praeamble.lua
+++ b/lua/Snippets/tex/praeamble.lua
@@ -3,7 +3,7 @@ local helper = require('Snippets.luasniphelpers')
return {
- s({ trig = 'upa', snippetType = 'autosnippet' },
+ s({ trig = 'pkg', snippetType = 'autosnippet' },
fmta(
'\\usepackage{<>}',
{
@@ -13,7 +13,7 @@ return {
{ condition = helper.line_begin }
),
- s({ trig = 'opa', snippetType = 'autosnippet' },
+ s({ trig = 'pks', snippetType = 'autosnippet' },
fmta(
'\\usepackage[<>]{<>}',
{
diff --git a/lua/Snippets/tex/tables.lua b/lua/Snippets/tex/tables.lua
index b2f39b3..fb768f7 100644
--- a/lua/Snippets/tex/tables.lua
+++ b/lua/Snippets/tex/tables.lua
@@ -6,13 +6,13 @@ return {
fmta(
[[
\begin{table}[!h]
+ \caption{<>
+ }
+ \label{tbl:<>}
\centering
\begin{tabular}{ <> }
<>
\end{tabular}
- \caption{<>
- }
- \label{tbl:<>}
\end{table}
]],
{
@@ -29,13 +29,13 @@ return {
fmta(
[[
\begin{table}[!h]
+ \caption{<>
+ }
+ \label{tbl:<>}
\centering
\begin{tabularx}{\textwidth}{ <> }
<>
\end{tabularx}
- \caption{<>
- }
- \label{tbl:<>}
\end{table}
]],
{
diff --git a/lua/Snippets/tex/text.lua b/lua/Snippets/tex/text.lua
new file mode 100644
index 0000000..e933f7f
--- /dev/null
+++ b/lua/Snippets/tex/text.lua
@@ -0,0 +1,51 @@
+local tex = require('Snippets.luasniphelperslatex')
+local helper = require('Snippets.luasniphelpers')
+
+return {
+
+ s({ trig = 'enq', snippetType = 'autosnippet' },
+ fmta(
+ '\\enquote{<>}',
+ {
+ i(1),
+ }
+ )
+ ),
+
+ s({ trig = 'tbf', snippetType = 'autosnippet' },
+ fmta(
+ '\\textbf{<>}',
+ {
+ i(1),
+ }
+ )
+ ),
+
+ s({ trig = 'tlc', snippetType = 'autosnippet' },
+ fmta(
+ '\\textit{<>}',
+ {
+ i(1),
+ }
+ )
+ ),
+
+ s({ trig = 'tsp', snippetType = 'autosnippet' },
+ fmta(
+ '\\textsuperscript{<>}',
+ {
+ i(1),
+ }
+ )
+ ),
+
+
+ s({ trig = 'tsb', snippetType = 'autosnippet' },
+ fmta(
+ '\\textsubscript{<>}',
+ {
+ i(1),
+ }
+ )
+ ),
+}