Skip to content

Instantly share code, notes, and snippets.

@f-ttok
Last active November 9, 2020 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save f-ttok/39496526e46a6aef466ab11ad13ba9bb to your computer and use it in GitHub Desktop.
Save f-ttok/39496526e46a6aef466ab11ad13ba9bb to your computer and use it in GitHub Desktop.
latex.json (snippets for VS code)
{
// Place your snippets for latex here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"vspace": {
"prefix": "vspace",
"body": [
"\\vspace{$1em}",
]
},
"hspace": {
"prefix": "hspace",
"body": [
"\\hspace{$1em}",
]
},
"General environment": {
"prefix": "begin",
"body": [
"\\begin{$1}",
"\t",
"\\end{$1}"
]
},
"align environment": {
"prefix": "align",
"body": [
"\\begin{align}",
"\t",
"\\end{align}"
]
},
"algorithm environment": {
"prefix": "algorithm",
"body": [
"\\begin{algorithm}",
"\t\\caption{$1}",
"\t\\begin{algorithmic}",
"\t\t",
"\t\\end{algorithmic}",
"\\end{algorithm}"
]
},
"figure environment": {
"prefix": "figure",
"body": [
"\\begin{figure}[htbp]",
"\t\\centering",
"\t\\includegraphics[width=\\linewidth]{$1}",
"\t\\caption{}",
"\t\\label{fig:}",
"\\end{figure}"
]
},
"table environment": {
"prefix": "table",
"body": [
"\\begin{table}[htbp]",
"\t\\centering",
"\t\\caption{}",
"\t\\begin{tabular}{$1}",
"\t\t",
"\t\\end{tabular}",
"\t\\label{fig:}",
"\\end{table}"
]
},
"center environment": {
"prefix": "center",
"body": [
"\\begin{center}",
"\t",
"\\end{center}"
]
},
"itemize environment": {
"prefix": "itemize",
"body": [
"\\begin{itemize}",
"\t\\item $1",
"\\end{itemize}"
]
},
"enumerate environment": {
"prefix": "enumerate",
"body": [
"\\begin{enumerate}",
"\t\\item $1",
"\\end{enumerate}"
]
},
"description environment": {
"prefix": "description",
"body": [
"\\begin{description}",
"\t\\item $1",
"\\end{description}"
]
},
"Beamer frame": {
"prefix": "frame",
"body": [
"\\begin{frame}{$1}",
"\t",
"\\end{frame}"
]
},
"Beamer block": {
"prefix": "block",
"body": [
"\\begin{block}{$1}",
"\t",
"\\end{block}"
]
},
"Beamer alertblock": {
"prefix": "alert",
"body": [
"\\begin{alertblock}{$1}",
"\t",
"\\end{alertblock}"
]
},
"Beamer exampleblock": {
"prefix": "example",
"body": [
"\\begin{exampleblock}{$1}",
"\t",
"\\end{exampleblock}"
]
},
"Beamer columns": {
"prefix": "column",
"body": [
"\\begin{columns}[T,onlytextwidth]",
"\t\\begin{column}{0.48\\linewidth}",
"\t\t",
"\t\\end{column}",
"\t\\vrule\\hfill",
"\t\\begin{column}{0.48\\linewidth}",
"\t\t",
"\t\\end{column}",
"\\end{columns}"
]
},
"bibtex": {
"prefix": "bibtex",
"body": [
"\\bibliography{reference}",
"\\bibliographystyle{abbrv}"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment