From 52cd974b95bb59f6500426fe020a2983dc0d37eb Mon Sep 17 00:00:00 2001 From: Nanderty Date: Mon, 12 Jun 2023 08:29:20 +0200 Subject: Snippets und Verbesserungen --- lua/Snippets/tex/figures.lua | 152 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 146 insertions(+), 6 deletions(-) (limited to 'lua/Snippets/tex/figures.lua') 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 } + ), } -- cgit v1.2.3