diff options
Diffstat (limited to 'lua/Snippets/tex')
| -rw-r--r-- | lua/Snippets/tex/chemistry.lua | 10 | ||||
| -rw-r--r-- | lua/Snippets/tex/environments.lua | 4 | ||||
| -rw-r--r-- | lua/Snippets/tex/figures.lua | 152 | ||||
| -rw-r--r-- | lua/Snippets/tex/general.lua | 11 | ||||
| -rw-r--r-- | lua/Snippets/tex/math.lua | 2 | ||||
| -rw-r--r-- | lua/Snippets/tex/sections.lua | 12 |
6 files changed, 165 insertions, 26 deletions
diff --git a/lua/Snippets/tex/chemistry.lua b/lua/Snippets/tex/chemistry.lua index a75536f..3ae0e9d 100644 --- a/lua/Snippets/tex/chemistry.lua +++ b/lua/Snippets/tex/chemistry.lua @@ -22,14 +22,4 @@ return { } ) ), - - s({ trig = 'chrg', snippetType = 'autosnippet' }, - fmta( - '\\charge{<>}{<>}', - { - i(1), - i(2), - } - ) - ), } diff --git a/lua/Snippets/tex/environments.lua b/lua/Snippets/tex/environments.lua index 3e8b543..46e5ee5 100644 --- a/lua/Snippets/tex/environments.lua +++ b/lua/Snippets/tex/environments.lua @@ -3,7 +3,7 @@ local helper = require('Snippets.luasniphelpers') return { - s({ trig = 'beg', snippetType = 'autosnippet' }, + s({ trig = 'bgn', snippetType = 'autosnippet' }, fmta( [[ \begin{<>} @@ -19,7 +19,7 @@ return { { condition = helper.line_begin } ), - s({ trig = 'ali', snippetType = 'autosnippet' }, + s({ trig = 'lgn', snippetType = 'autosnippet' }, fmta( [[ \begin{align*} diff --git a/lua/Snippets/tex/figures.lua b/lua/Snippets/tex/figures.lua index 4adc1b4..3cbed87 100644 --- a/lua/Snippets/tex/figures.lua +++ b/lua/Snippets/tex/figures.lua @@ -6,12 +6,39 @@ return { s({ trig = 'chfig', snippetType = 'autosnippet' }, fmta( [[ -\begin{figure}[h] +\begin{figure}[!h] \centering \chemfig { <> } - \caption{<>} + \caption{ + <> + } + \label{fig:<>} +\end{figure} +]], + { + i(1), + i(2), + i(3), + } + ), + { condition = helper.line_begin } + ), + + s({ trig = 'chsch', snippetType = 'autosnippet' }, + fmta( + [[ +\begin{figure}[!h] + \centering + \schemestart + \chemfig { + <> + } + \schemestop + \caption{ + <> + } \label{fig:<>} \end{figure} ]], @@ -27,12 +54,14 @@ return { s({ trig = 'imfig', snippetType = 'autosnippet' }, fmta( [[ -\begin{figure}[h] +\begin{figure}[!h] \centering \includegraphics [<>] {<>} - \caption{<>} + \caption{ + <> + } \label{fig:<>} \end{figure} ]], @@ -49,13 +78,15 @@ return { s({ trig = 'pdfig', snippetType = 'autosnippet' }, fmta( [[ -\begin{figure}[h] +\begin{figure}[!h] \centering \resizebox {<>} {!} {\input{<>}} - \caption{<>} + \caption{ + <> + } \label{fig:<>} \end{figure} ]], @@ -68,4 +99,113 @@ return { ), { condition = helper.line_begin } ), + + s({ trig = 'sch', snippetType = 'autosnippet' }, + fmta( + [[ +\schemestart +<> +\schemestop +]], + { + i(1), + } + ), + { condition = tex.in_figure } + ), + + s({ trig = 'sus', snippetType = 'autosnippet' }, + fmta( + [[ +\subscheme { + <> +} +]], + { + i(1), + } + ), + { condition = tex.in_figure } + ), + + s({ trig = 'chf', snippetType = 'autosnippet' }, + fmta( + [[ +\chemfig { + <> +} + ]], + { + i(1), + } + ), + { condition = tex.in_figure } + ), + + s({ trig = 'arr', snippetType = 'autosnippet' }, + fmta( + '\\arrow(<>){<>}[<>]', + { + i(1), + i(2), + i(3), + } + ), + { condition = tex.in_figure } + ), + + s({ trig = 'move', snippetType = 'autosnippet' }, + fmta( + [[ +\chemmove[shorten <<=<>,shorten >>=<>]{ + \draw(<>).. controls +(<>) and +(<>).. (<>); +} + ]], + { + i(1), + i(2), + i(3), + i(4), + i(5), + i(6), + } + ), + { condition = tex.in_figure } + ), + + s({ trig = 'chr', snippetType = 'autosnippet' }, + fmta( + '\\charge{<>}{<>}', + { + i(1), + i(2), + } + ), + { condition = tex.in_figure } + ), + + s({ trig = 'nme', snippetType = 'autosnippet' }, + fmta( + [[ +\chemname{ + <> +}{<>} +]], + { + i(1), + i(2), + } + ), + { condition = tex.in_figure } + ), + + s({ trig = 'omi', snippetType = 'autosnippet' }, + { t('\\ominus') }, + { condition = tex.in_figure } + ), + + s({ trig = 'opl', snippetType = 'autosnippet' }, + { t('\\oplus') }, + { condition = tex.in_figure } + ), } diff --git a/lua/Snippets/tex/general.lua b/lua/Snippets/tex/general.lua index b53f80c..23d2e60 100644 --- a/lua/Snippets/tex/general.lua +++ b/lua/Snippets/tex/general.lua @@ -38,7 +38,7 @@ return { ) ), - s({ trig = 'bf', snippetType = 'autosnippet' }, + s({ trig = 'bft', snippetType = 'autosnippet' }, fmta( '\\textbf{<>}', { @@ -47,6 +47,15 @@ return { ) ), + s({ trig = 'tlc', snippetType = 'autosnippet' }, + fmta( + '\\textit{<>}', + { + i(1), + } + ) + ), + s({ trig = 'cte', snippetType = 'autosnippet' }, fmta( '\\supercite{<>}', diff --git a/lua/Snippets/tex/math.lua b/lua/Snippets/tex/math.lua index 47c21a8..53a2807 100644 --- a/lua/Snippets/tex/math.lua +++ b/lua/Snippets/tex/math.lua @@ -65,7 +65,7 @@ return { { condition = tex.in_mathzone } ), - s({ trig = 'nn', snippetType = 'autosnippet' }, + s({ trig = 'hhn', snippetType = 'autosnippet' }, fmta( '\\num{<>}', { diff --git a/lua/Snippets/tex/sections.lua b/lua/Snippets/tex/sections.lua index 432a424..582201e 100644 --- a/lua/Snippets/tex/sections.lua +++ b/lua/Snippets/tex/sections.lua @@ -3,7 +3,7 @@ local helper = require('Snippets.luasniphelpers') return { - s({ trig = 'sec', snippetType = 'autosnippet' }, + s({ trig = 'sct', snippetType = 'autosnippet' }, fmta( '\\section{<>}', { @@ -13,7 +13,7 @@ return { { condition = helper.line_begin } ), - s({ trig = 'nsec', snippetType = 'autosnippet' }, + s({ trig = 'nsc', snippetType = 'autosnippet' }, fmta( '\\newpage\\section{<>}', { @@ -23,7 +23,7 @@ return { { condition = helper.line_begin } ), - s({ trig = 'ssec', snippetType = 'autosnippet' }, + s({ trig = 'ssc', snippetType = 'autosnippet' }, fmta( '\\subsection{<>}', { @@ -33,7 +33,7 @@ return { { condition = helper.line_begin } ), - s({ trig = 'nssec', snippetType = 'autosnippet' }, + s({ trig = 'nssc', snippetType = 'autosnippet' }, fmta( '\\newpage\\subsection{<>}', { @@ -43,7 +43,7 @@ return { { condition = helper.line_begin } ), - s({ trig = 'ssec', snippetType = 'autosnippet' }, + s({ trig = 'sss', snippetType = 'autosnippet' }, fmta( '\\newpage\\subsubsection{<>}', { @@ -53,7 +53,7 @@ return { { condition = helper.line_begin } ), - s({ trig = 'nsssec', snippetType = 'autosnippet' }, + s({ trig = 'nsss', snippetType = 'autosnippet' }, fmta( '\\newpage\\subsubsection{<>}', { |
