diff --git a/package.json b/package.json index c254ebec..3ffaef96 100644 --- a/package.json +++ b/package.json @@ -437,6 +437,10 @@ "language": ["bibtex", "bib"], "path": "./snippets/latex/bibtex.json" }, + { + "language": ["latex-tikz"], + "path": "./snippets/latex/tikz.json" + }, { "language": "twig", "path": "./snippets/frameworks/twig.json" diff --git a/snippets/latex/latex-snippets.json b/snippets/latex/latex-snippets.json index 04c7ee87..b3acc342 100644 --- a/snippets/latex/latex-snippets.json +++ b/snippets/latex/latex-snippets.json @@ -279,9 +279,8 @@ "prefix": "figure", "body": [ "\\begin{figure}", - "\t\\begin{center}", - "\t\t\\includegraphics[width=0.95\\textwidth]{figures/$1}", - "\t\\end{center}", + "\t\\centering", + "\t\\includegraphics[width=0.95\\textwidth]{figures/$1}", "\t\\caption{$3}\\label{fig:$4}", "\\end{figure}", "$0" diff --git a/snippets/latex/tikz.json b/snippets/latex/tikz.json new file mode 100644 index 00000000..1a8e2d73 --- /dev/null +++ b/snippets/latex/tikz.json @@ -0,0 +1,29 @@ +{ + "TikZ picture": { + "prefix": "tikzpicture", + "body": [ + "\\begin{tikzpicture}", + "\t$0", + "\\end{tikzpicture}" + ], + "description": "Add a TikZ picture" + }, + "Figure with TikZ picture": { + "prefix": "figuretikz", + "body": [ + "\\begin{figure}", + "\t\\centering", + "\t\\begin{tikzpicture}", + "\t\t$0", + "\t\\end{tikzpicture}", + "\t\\caption{$3}\\label{fig:$4}", + "\\end{figure}" + ], + "description": "Add a figure with a TikZ picture" + }, + "Scope": { + "prefix": "scope", + "body": ["\\begin{scope}", "\t$0", "\\end{scope}"], + "description": "TikZ scope" + } +}