diff options
| author | Nanderty <psopka@sopka.ch> | 2023-06-12 08:29:20 +0200 |
|---|---|---|
| committer | Nanderty <psopka@sopka.ch> | 2023-06-12 08:29:20 +0200 |
| commit | 52cd974b95bb59f6500426fe020a2983dc0d37eb (patch) | |
| tree | c07b678734fb9827064990820a69c220f1fcdf82 /lua/Snippets/tex/figures.lua | |
| parent | cac321dd2ef6ca545fdca5545e26048ecff3dfa9 (diff) | |
| download | neovim-config-52cd974b95bb59f6500426fe020a2983dc0d37eb.tar.gz neovim-config-52cd974b95bb59f6500426fe020a2983dc0d37eb.tar.bz2 neovim-config-52cd974b95bb59f6500426fe020a2983dc0d37eb.zip | |
Snippets und Verbesserungen
Diffstat (limited to 'lua/Snippets/tex/figures.lua')
| -rw-r--r-- | lua/Snippets/tex/figures.lua | 152 |
1 files changed, 146 insertions, 6 deletions
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 } + ), } |
