nvim

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 86304850e1306c8e769d3958dd6368d6dce77125
parent 7af6a169ff1b3bab184fd2b3370f6aa4fdab917e
Author: Andrew <andrewlaack1@gmail.com>
Date:   Tue, 10 Dec 2024 00:15:07 -0600

Added some snippets

Diffstat:
MLuaSnip/tex.lua | 142+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 136 insertions(+), 6 deletions(-)

diff --git a/LuaSnip/tex.lua b/LuaSnip/tex.lua @@ -1,3 +1,5 @@ +-- these don't seem necessary... + local ls = require("luasnip") local s = ls.snippet local sn = ls.snippet_node @@ -23,11 +25,29 @@ return { "\\documentclass[12pt, letterpaper]{article}", "\\usepackage{enumitem}", "\\usepackage{graphicx}", +"\\usepackage{amsthm}", +"\\usepackage{caption}", +"\\usepackage{tcolorbox}", +"\\newtcolorbox[]{alphaAnswer}[1][]{%", +" colframe=black, % Frame color", +" colback=white, % Background color", +" boxrule=0.2mm, % Thickness of the frame", +" sharpe corners,", +"}", "\\author{Andrew Laack}", "\\title{TITLE}", +"\\makeatletter", +"\\renewcommand{\\maketitle}{", +" \\begin{center}", +" {\\Large \\@title} \\\\[.5em]", +" {\\@author} \\\\[0.25em]", +" {\\small \\@date}", +" \\end{center}", +"}", +"\\makeatother", "\\begin{document}", "\\maketitle{}", -"\\section{FIRST SECTION}", +"\\section*{1.1 FIRST SECTION}", "\\end{document}", } ), @@ -36,6 +56,119 @@ return { require("luasnip").snippet( { + trig=";twoPhotos", + dscr="Autotriggered snippet to replace ;twoPhotos with side by side figures.", + snippetType="autosnippet", + regTrig=false, + priority=100, + }, + { + t({ +"\\begin{figure}[h]", +" \\centering", +" \\begin{minipage}{0.45\\textwidth}", +" \\centering", +" \\includegraphics[scale=.35]{images/PICTURE1}", +" \\caption{PICTURE 1}", +" \\end{minipage}", +" \\hfill", +" \\begin{minipage}{0.45\\textwidth}", +" \\centering", +" \\includegraphics[scale=.35]{images/PICTURE2}", +" \\caption{PICTURE 2}", +" \\end{minipage}", +"\\end{figure}", + } + ), + } + ), + + require("luasnip").snippet( + { + trig=";onePhoto", + dscr="Autotriggered snippet to replace ;twoPhotos with side by side figures.", + snippetType="autosnippet", + regTrig=false, + priority=100, + }, + { + t({ + +"\\begin{figure}[h]", +" \\centering", +" \\includegraphics[scale=1]{images/PICTURE}", +" \\caption{CAPTION}", +"\\end{figure}", + } + ), + } + ), + require("luasnip").snippet( + { + trig=";alphaQuestion", + dscr="Autotriggered snippet to replace ;alphaQuestion with a question with alpha ordered list", + snippetType="autosnippet", + regTrig=false, + priority=100, + }, + { + t({ + +"\\vspace{.5cm}", +"\\noindent \\textbf{N) QUESTION}", +"\\vspace{.5cm}", +"", +"\\begin{enumerate}[label=\\textbf{\\alph*)}]", +" \\item PART A", +" \\begin{alphaAnswer}", +" ANS A", +" \\end{alphaAnswer}", +"", +" \\item PART B", +" \\begin{alphaAnswer}", +" ANS B", +" \\end{alphaAnswer}", +"", +" \\item PART C", +" \\begin{alphaAnswer}", +" ANS C", +" \\end{alphaAnswer}", +"", +" \\item PART D", +" \\begin{alphaAnswer}", +" ANS D", +" \\end{alphaAnswer}", +"", +" \\item PART E", +" \\begin{alphaAnswer}", +" ANS E", +" \\end{alphaAnswer}", +"\\end{enumerate}" + } + ), + } + ), + + require("luasnip").snippet( + { + trig=";answer", + dscr="Autotriggered snippet to replace ;answer with answer area", + snippetType="autosnippet", + regTrig=false, + priority=100, + }, + { + t({ + "\\begin{alphaAnswer}", + "\\end{alphaAnswer}", + } + ), + } + ), + + + require("luasnip").snippet( + { trig=";alphaList", dscr="Autotriggered snippet to replace ;alphaList with a alphabetical list", snippetType="autosnippet", @@ -85,12 +218,9 @@ require("luasnip").snippet( }, { t({ + "\\vspace{.5cm}", "\\noindent\\textbf{}", - "\\begin{itemize}", - " \\item", - " \\item", - " \\item", - "\\end{itemize}", + "\\vspace{.5cm}", } ), }