global !p texMathZones = ['texMathZone'+x for x in ['A', 'AS', 'B', 'BS', 'C', 'CS', 'D', 'DS', 'E', 'ES', 'F', 'FS', 'G', 'GS', 'H', 'HS', 'I', 'IS', 'J', 'JS', 'K', 'KS', 'L', 'LS', 'DS', 'V', 'W', 'X', 'Y', 'Z']] texIgnoreMathZones = ['texMathText'] texMathZoneIds = vim.eval('map('+str(texMathZones)+", 'hlID(v:val)')") texIgnoreMathZoneIds = vim.eval('map('+str(texIgnoreMathZones)+", 'hlID(v:val)')") ignore = texIgnoreMathZoneIds[0] def smart_space(next_str, auto_str=" "): if next_str and next_str[0] in [",", ".", "-", "!", "?", " "]: snip.rv = auto_str else: snip.rv = "" endglobal snippet template "Main template (that should work without relying with style files)" bi \documentclass[class=memoir, crop=false, oneside, 14pt]{standalone} % all of the packages to be used \usepackage[nocomments]{standalone} \usepackage{chngcntr} \usepackage{import} \usepackage[utf8]{inputenc} \usepackage{fontawesome} \usepackage[english]{babel} \usepackage[rgb]{xcolor} \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsthm} \usepackage{tikz} \usepackage{pgfplots} \usepackage{fancyhdr} \usepackage{minted} \usepackage[most]{tcolorbox} \usepackage[colorlinks=true, linkcolor=., urlcolor=blue]{hyperref} \usepackage{kpfonts} % using the fancy header package % http://linorg.usp.br/CTAN/macros/latex/contrib/fancyhdr/fancyhdr.pdf \pagestyle{fancy} % fill the header with the format \fancyhead[L]{\doctitle} \fancyhead[R]{\nouppercase{\rightmark}} % fill the footer with the format \fancyfoot[C]{\nouppercase{\leftmark}} \fancyfoot[R]{\thepage} % set the width of the horizontal bars in the header \renewcommand{\headrulewidth}{2pt} \renewcommand{\footrulewidth}{1pt} % set the paragraph formatting \renewcommand{\baselinestretch}{1.35} % set chapter style \chapterstyle{bianchi} % set chapter spacing for easier reading on digital screen \setlength{\beforechapskip}{-\beforechapskip} % document metadata \author{${1:"Gabriel Arazas"}} \title{${2:"New Title"}} \date{`!p `} \begin{document} % Frontmatter of the class note if it's compiled standalone \renewcommand{\abstractname}{Summary} \maketitle \newpage \frontmatter \chapter{Preface} $3 \newpage \tableofcontents \newpage \listoffigures \newpage \mainmatter % Core content (HINT: always start with chapter LaTeX tag) $0 \end{document} endsnippet # Document structure tags snippet chapter "Chapter element" bi \chapter{$1} \label{ch:$1} $0 endsnippet snippet section "Section tag" bi \section{$1} \label{sec:$1} $0 endsnippet snippet subsec "Subsection tag" bi \subsection{$1} \label{subsec:$1} $0 endsnippet # Common commands snippet pack "Use package command" i \usepackage`!p smart_space(t[2], "[")`$2`!p smart_space(t[2], "]")`{$1} $0 endsnippet snippet letter "Make at letter block" i \makeatletter $1 \makeatother $0 endsnippet snippet label "Create a label" i \label{$1} $0 endsnippet snippet ref "Create a reference for a label" i \ref{${1: