Temp snippet document until I get a solution made with LuaSnip's snippet_list
. It may be a bit terse, so feel free to make an issue or reformat it.
⚠️ Warning: As mentioned in the README, most snippets require VimTeX for the condition/show-condition to work.
alab
: add label, of the form\label{${1:type}:${2:number}}$0
[acCer]ref
: add reference of the form\(auto|c|C|eqn)ref{${1:type}:${2:number}}$0
cref/Cref
requires thecleveref
package
All of them are of the form \COMMAND_NAME{$1}$0
, with those with *
also having labels of the form \label{type:${1:number}}
sec(*)
,ssec(*)
,sssec(*)
*: section, subsection, subsubsection respectively. Add*
for the starred commands.sq
,qq
: enquote* and enquote (single and double quotes). Requirescsquotes
package.bf
,it
,ttt
,sc
,tu
,tov
: Text modifications (bold, italic, typewriter, small caps, underline, and overline).
beg
creates a generic environment snippet.
\begin{$1}
$0
\end{$1}
-i
creates the itemize environment, and there's a choice of which bullet point to set (either default or custom bullets with \item []
notation).
\begin{itemize}
\item ${1:[$2]|}
\end{itemize}
-e
deals with the enumerate environment. This one is a bit more involved than the itemize environment snippet, as it allows you to choose which labels and provides two defaults, lowercase roman numerals and lowercase alphabetical characters.
\begin{enumerate}${1:|[label=${2:(\alph*)|(\roman*)|}]}
\item ${3:[$4]|}
\end{enumerate}
--
, !-
are the accompanying commands for bullet points, which map to \item
and \item []
respectively. These only work at the beginning of the line in itemize/enumerate environments.
mk
: inline math$$1$$0
dm
: display mathali
: align(|*|ed)gat
: gather(|*|ed)eqn
: equation(|*)
[bBpvV]mat(%d)x(%d)(a|r)
: creates a dxd matrix, either augmented or not.
ℹ️ Note: For the
a
(augmented) option, it requires this fix somewhere in your.tex
file or preamble.
For instance, bmat2x2r
creates:
\begin{bmatrix}
$1 & $2 \\
$3 & $4 \\
\end{bmatrix}
(%d)?cases
: creates a cases array with d rows; if no input is supplied it defaults to 2 rows.
For instance, 3cases
creates:
\begin{cases}
$1 & $2 \\
$3 & $4 \\
$5 & $6
\end{cases}
These are somewhat self-explanatory unless someone convinces me otherwise.
lr(aAbBcmp)
creates a snippet of the form \left[delim] $1 \right[delim] $0
; delimiters are created following this table:
-- brackets
local brackets = {
a = { "\\langle", "\\rangle" },
A = { "Angle", "Angle" },
b = { "brack", "brack" },
B = { "Brack", "Brack" },
c = { "brace", "brace" },
m = { "|", "|" },
p = { "(", ")" },
}