dotfiles/conf.d/lvim/luasnippets/tex.lua

253 lines
4.4 KiB
Lua
Raw Normal View History

2023-08-08 09:07:34 +00:00
--[[--
File : .config/lvim/luasnippets/tex.lua
Author : Jeff Lance <email@jefflance.me>
Date : 05.08.2023 00:54:18
Last Modified Date: 06.08.2023 12:55:15
Last Modified By : Jeff Lance <email@jefflance.me>
2023-08-09 22:26:35 +00:00
--]]
--
2023-08-08 09:07:34 +00:00
return {
2023-08-09 22:26:35 +00:00
-- maths commands
--
s({ trig = "lim", dscr = "Limit" },
fmta(
[[
$ \lim\limits_{ <> } <> $
]],
{
i(1),
i(2),
}
)
),
s({ trig = "xto", dscr = "Limit" },
fmta(
[[
x \to <>
]],
{
i(1),
}
)
),
s({ trig = "stack", dscr = "Limit" },
fmta(
[[
\substack{ <> \\ <> }
]],
{
i(1),
i(2),
}
)
),
--
2023-08-08 09:07:34 +00:00
-- environments
--
2023-08-09 22:26:35 +00:00
s({ trig = "env", dscr = "A LaTeX empty environment" },
2023-08-08 09:07:34 +00:00
fmt(
[[
\begin{<>}[<>]
<>
\end{<>}
]],
-- The insert node is placed in the <> angle brackets
{
i(1),
i(2),
i(3),
rep(1), -- This node repeat insert node 1
},
-- This is where I specify that angle brackets are used as node positions.
{ delimiters = "<>" }
)
),
2023-08-09 22:26:35 +00:00
s({ trig = "def", dscr = "My LaTeX class definition environment" },
2023-08-08 09:07:34 +00:00
fmt(
[[
\begin{definition}[<>]
<>
\end{definition}
]],
-- The insert node is placed in the <> angle brackets
{
i(1),
i(2)
},
-- This is where I specify that angle brackets are used as node positions.
{ delimiters = "<>" }
)
),
2023-08-09 22:26:35 +00:00
s({ trig = "ppt", dscr = "My LaTeX class property environment" },
2023-08-08 09:07:34 +00:00
fmt(
[[
\begin{propriete}[<>]
<>
\end{propriete}
]],
{
i(1),
i(2)
},
{ delimiters = "<>" }
)
),
2023-08-09 22:26:35 +00:00
s({ trig = "cor", dscr = "My LaTeX class corollair environment" },
2023-08-08 09:07:34 +00:00
fmt(
2023-08-09 22:26:35 +00:00
[[
2023-08-08 09:07:34 +00:00
\begin{corollaire}[<>]
<>
\end{corollaire}
]],
{
i(1),
i(2)
},
{ delimiters = "<>" }
)
),
2023-08-09 22:26:35 +00:00
s({ trig = "thm", dscr = "My LaTeX class theorem environment" },
2023-08-08 09:07:34 +00:00
fmt(
2023-08-09 22:26:35 +00:00
[[
2023-08-08 09:07:34 +00:00
\begin{theoreme}[<>]
<>
\end{theoreme}
]],
{
i(1),
i(2)
},
{ delimiters = "<>" }
)
),
2023-08-09 22:26:35 +00:00
s({ trig = "dem", dscr = "My LaTeX class proof environment" },
2023-08-08 09:07:34 +00:00
fmt(
[[
\begin{preuve}[<>]
<>
\end{preuve}
]],
{
i(1),
i(2)
},
{ delimiters = "<>" }
)
),
2023-08-09 22:26:35 +00:00
s({ trig = "csq", dscr = "My LaTeX class consequence environment" },
2023-08-08 09:07:34 +00:00
fmt(
[[
\begin{consequence}[<>]
<>
\end{consequence}
]],
{
i(1),
i(2)
},
{ delimiters = "<>" }
)
),
2023-08-09 22:26:35 +00:00
s({ trig = "rem", dscr = "My LaTeX class remark environment" },
2023-08-08 09:07:34 +00:00
fmt(
[[
\begin{remarque}[<>]
<>
\end{remarque}
]],
{
i(1),
i(2)
},
{ delimiters = "<>" }
)
),
2023-08-09 22:26:35 +00:00
s({ trig = "exp", dscr = "My LaTeX class example environment" },
2023-08-08 09:07:34 +00:00
fmt(
[[
\begin{exemple}[<>]
<>
\end{exemple}
]],
{
i(1),
i(2)
},
{ delimiters = "<>" }
)
),
2023-08-09 22:26:35 +00:00
s({ trig = "met", dscr = "My LaTeX class method environment" },
2023-08-08 09:07:34 +00:00
fmt(
[[
\begin{methode}[<>]
<>
\end{methode}
]],
{
i(1),
i(2)
},
{ delimiters = "<>" }
)
),
2023-08-09 22:26:35 +00:00
s({ trig = "app", dscr = "My LaTeX class application environment" },
2023-08-08 09:07:34 +00:00
fmt(
[[
\begin{application}[<>]
<>
\end{application}
]],
{
i(1),
i(2)
},
{ delimiters = "<>" }
)
),
2023-08-09 22:26:35 +00:00
s({ trig = "exe", dscr = "My LaTeX class exercise environment" },
2023-08-08 09:07:34 +00:00
fmt(
[[
\begin{exercice}[<>]
<>
\end{exercice}
]],
{
i(1),
i(2)
},
{ delimiters = "<>" }
)
),
2023-08-09 22:26:35 +00:00
s({ trig = "rap", dscr = "My LaTeX class recall environment" },
2023-08-08 09:07:34 +00:00
fmt(
[[
\begin{rappel}[<>]
<>
\end{rappel}
]],
{
i(1),
i(2)
},
{ delimiters = "<>" }
)
),
2023-08-09 22:26:35 +00:00
s({ trig = "aid", dscr = "My LaTeX class help environment" },
2023-08-08 09:07:34 +00:00
fmt(
[[
\begin{aide}[<>]
<>
\end{aide}
]],
{
i(1),
i(2)
},
{ delimiters = "<>" }
)
),
}