summaryrefslogtreecommitdiffstats
path: root/lua/Snippets/tex/figures.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/Snippets/tex/figures.lua')
-rw-r--r--lua/Snippets/tex/figures.lua152
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 }
+ ),
}