Skip to content

Instantly share code, notes, and snippets.

@yano404
Created June 16, 2021 16:06
Show Gist options
  • Save yano404/b594a7f8db25012c1db91284e0537fb4 to your computer and use it in GitHub Desktop.
Save yano404/b594a7f8db25012c1db91284e0537fb4 to your computer and use it in GitHub Desktop.
LaTeX Snippets for VSCode
{
// 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"
// }
"upLaTeX-jsarticle-phys": {
"prefix": "article",
"body": [
"\\documentclass[uplatex,dvipdfmx]{jsarticle}",
"\\usepackage[top=20truemm,bottom=20truemm,left=20truemm,right=20truemm]{geometry} %余白設定",
"\\usepackage[dvipdfmx]{graphicx}",
"\\usepackage[dvipdfmx]{color}",
"\\usepackage[rgb]{xcolor}",
"\\usepackage{otf}",
"\\usepackage{okumacro}",
"\\usepackage{array}",
"\\usepackage{multicol} %段組み",
"\\usepackage{wrapfig}",
"\\usepackage{float}",
"\\usepackage{ascmac}",
"\\usepackage{multirow}",
"\\usepackage{fancybox}",
"\\usepackage{tcolorbox}",
"\\tcbuselibrary{xparse}",
"\\tcbuselibrary{breakable}",
"\\tcbuselibrary{skins}",
"\\usepackage[subrefformat=parens]{subcaption}",
"%math",
"\\usepackage{amsmath,amssymb,amsthm}",
"\\usepackage{newtxtext,newtxmath}",
"\\usepackage{bm}",
"\\usepackage{mathrsfs}",
"\\usepackage{cancel}",
"\\usepackage{ulem}",
"",
"\\usepackage{physics}",
"",
"\\usepackage{siunitx}",
"",
"%\\renewcommand{\\thesubsection}{{\\S}\\arabic{section}.\\arabic{subsection}}",
"%\\renewcommand{\\thesubsubsection}{\\arabic{subsubsection}.}",
"\\renewcommand{\\thefootnote}{\\arabic{footnote}}",
"",
"\\usepackage{comment}",
"",
"\\usepackage[dvipdfmx]{hyperref}",
"\\usepackage{pxjahyper}",
"",
"%\\usepackage[%",
"%backend=bibtex,%",
"%style=phys,%",
"%articletitle=false,biblabel=brackets,%",
"%chaptertitle=false,pageranges=false%",
"%]",
"%{biblatex}",
"",
"%\\addbibresource{references.bib}",
"\\newcommand{\\Ham}{\\mathcal{H}}",
"\\newcommand{\\Lag}{\\mathcal{L}}",
"\\newcommand{\\Const}{\\mathrm{Const.}}",
"",
"\\newcommand{\\figref}[1]{\\figurename\\ref{#1}}",
"",
"\\begin{document}",
"\\title{${1}}",
"\\author{${2}}",
"\\date{\\today}",
"\\maketitle",
"",
"",
"$0",
"",
"",
"%\\nocite{*}",
"%\\printbibliography[title=参考文献]",
"",
"\\end{document}"
],
"description": "upLaTeX jsarticle"
},
"customtcbox": {
"prefix": "customtcb",
"body": [
"\\definecolor{mtblue}{RGB}{62,126,248}",
"\\definecolor{mtlightblue}{RGB}{235,242,254}",
"\\definecolor{mtlime}{RGB}{96,215,58}",
"\\definecolor{mtlightlime}{RGB}{239,251,235}",
"\\definecolor{mtpurple}{RGB}{111,69,246}",
"\\definecolor{mtlightpurple}{RGB}{240,236,254}",
"\\definecolor{mtseagreen}{RGB}{32,182,156}",
"\\definecolor{mtlightseagreen}{RGB}{232,248,245}",
"\\definecolor{mtmarine}{RGB}{31,174,203}",
"\\definecolor{mtlightmarine}{RGB}{232,247,250}",
"\\definecolor{mtgreen}{RGB}{35,191,85}",
"\\definecolor{mtlightgreen}{RGB}{233,249,238}",
"\\definecolor{mtgray}{RGB}{148,148,148}",
"\\definecolor{mtlightgray}{RGB}{244,244,244}",
"\\newtcolorbox{exbox}[2][]{",
"\tenhanced,",
"\tbreakable,",
"\tcolframe=black!65!white,",
"\tcolbacktitle=black!65!white,",
"\tcolback=black!2!white,",
"\tcoltitle=white,",
"\ttitle={#2},",
"\tfonttitle=\\gtfamily\\sffamily\\large,",
"\tsubtitle style={",
"\t\tboxrule=0.4pt,",
"\t\tcolback=black!20!white,",
"\t\tcoltext=black!80!white",
"\t},",
"\tdrop fuzzy shadow=black!30!white,",
"\t#1",
"}",
"",
"\\newtcolorbox{note}[1][]{",
"\tenhanced,",
"\tbreakable,",
"\tbefore skip=2mm,",
"\tafter skip=3mm,",
"\t%fontupper=\\gtfamily\\sffamily,",
"\tcolframe=black!10!white,",
"\tboxrule=0.0pt,",
"\tleft=3mm,",
"\ttitle=\\hspace{1.6ex}Note,",
"\tfonttitle=\\bfseries\\gtfamily\\sffamily,",
"\tcoltitle=mtblue,",
"\tcolbacktitle=mtlightblue,",
"\ttoptitle=1mm,",
"\tbottomtitle=1mm,",
"\tcolback=white,",
"\tsharp corners,",
"\tunderlay unbroken={%",
"\t\t\\path[fill=mtlightblue,draw=none] ([xshift=2mm]title.south west) rectangle node[mtblue]{\\large\\bfseries !} ([xshift=7mm]title.north west);",
"\t\t\\path[fill=mtblue,draw=none] ([yshift=-2mm]title.south west) rectangle ([xshift=2mm]title.north west);",
"\t\t\\path[fill=mtblue,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tunderlay first={%",
"\t\t\\path[fill=mtlightblue,draw=none] ([xshift=2mm]title.south west) rectangle node[mtblue]{\\large\\bfseries !} ([xshift=7mm]title.north west);",
"\t\t\\path[fill=mtblue,draw=none] ([yshift=-2mm]title.south west) rectangle ([xshift=2mm]title.north west);",
"\t\t\\path[fill=mtblue,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tunderlay middle={%",
"\t\t\\path[fill=mtblue,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tunderlay last={%",
"\t\t\\path[fill=mtblue,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tdrop fuzzy shadow=black!30!white,",
"\t#1",
"}",
"",
"\\newtcolorbox{shortnote}[1][]{",
"\tenhanced,",
"\t%before skip=4mm,",
"\t%after skip=4mm,",
"\tfontupper=\\gtfamily\\sffamily,",
"\tboxrule=0.0pt,",
"\tleft=5mm,",
"\tright=2mm,",
"\ttop=2mm,",
"\tbottom=2mm,",
"\tcolback=mtlightblue,",
"\tcolframe=black!10!white,",
"\tsharp corners,",
"\tunderlay={%",
"\t\t\\path[fill=mtblue,draw=none] (interior.south west) rectangle node[white]{\\huge\\bfseries !} ([xshift=4mm]interior.north west);",
"\t},",
"\tdrop fuzzy shadow=black!30!white,",
"\t,#1",
"}",
"",
"\\newtcolorbox{question}[1][]{",
"\tenhanced,",
"\tbreakable,",
"\tbefore skip=2mm,",
"\tafter skip=3mm,",
"\t%fontupper=\\gtfamily\\sffamily,",
"\tcolframe=black!10!white,",
"\tboxrule=0.0pt,",
"\tleft=3mm,",
"\ttitle=\\hspace{1.6ex}Question,",
"\tfonttitle=\\bfseries\\gtfamily\\sffamily,",
"\tcoltitle=mtlime,",
"\tcolbacktitle=mtlightlime,",
"\ttoptitle=1mm,",
"\tbottomtitle=1mm,",
"\tcolback=white,",
"\tsharp corners,",
"\tunderlay unbroken={%",
"\t\t\\path[fill=mtlightlime,draw=none] ([xshift=2mm]title.south west) rectangle node[mtlime]{\\large\\bfseries ?} ([xshift=7mm]title.north west);",
"\t\t\\path[fill=mtlime,draw=none] ([yshift=-2mm]title.south west) rectangle ([xshift=2mm]title.north west);",
"\t\t\\path[fill=mtlime,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tunderlay first={%",
"\t\t\\path[fill=mtlightlime,draw=none] ([xshift=2mm]title.south west) rectangle node[mtlime]{\\large\\bfseries ?} ([xshift=7mm]title.north west);",
"\t\t\\path[fill=mtlime,draw=none] ([yshift=-2mm]title.south west) rectangle ([xshift=2mm]title.north west);",
"\t\t\\path[fill=mtlime,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tunderlay middle={%",
"\t\t\\path[fill=mtlime,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tunderlay last={%",
"\t\t\\path[fill=mtlime,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tdrop fuzzy shadow=black!30!white,",
"\t#1",
"}",
"",
"\\newtcolorbox{shortquestion}[1][]{",
"\tenhanced,",
"\t%before skip=4mm,",
"\t%after skip=4mm,",
"\tfontupper=\\gtfamily\\sffamily,",
"\tboxrule=0.0pt,",
"\tleft=5mm,",
"\tright=2mm,",
"\ttop=2mm,",
"\tbottom=2mm,",
"\tcolback=mtlightlime,",
"\tcolframe=black!10!white,",
"\tsharp corners,",
"\tunderlay={%",
"\t\t\\path[fill=mtlime,draw=none] (interior.south west) rectangle node[white]{\\huge\\bfseries ?} ([xshift=4mm]interior.north west);",
"\t},",
"\tdrop fuzzy shadow=black!30!white,",
"\t#1",
"}",
"",
"\\newtcolorbox{example}[1][]{",
"\tenhanced,",
"\tbreakable,",
"\tbefore skip=2mm,",
"\tafter skip=3mm,",
"\t%fontupper=\\gtfamily\\sffamily,",
"\tcolframe=black!10!white,",
"\tboxrule=0.0pt,",
"\tleft=3mm,",
"\ttitle=\\hspace{1.6ex}Example,",
"\tfonttitle=\\bfseries\\gtfamily\\sffamily,",
"\tcoltitle=mtpurple,",
"\tcolbacktitle=mtlightpurple,",
"\ttoptitle=1mm,",
"\tbottomtitle=1mm,",
"\tcolback=white,",
"\tsharp corners,",
"\tunderlay unbroken={%",
"\t\t\\path[fill=mtlightpurple,draw=none] ([xshift=2mm]title.south west) rectangle node[mtpurple]{\\large\\bfseries $\\equiv$} ([xshift=7mm]title.north west);",
"\t\t\\path[fill=mtpurple,draw=none] ([yshift=-2mm]title.south west) rectangle ([xshift=2mm]title.north west);",
"\t\t\\path[fill=mtpurple,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tunderlay first={%",
"\t\t\\path[fill=mtlightpurple,draw=none] ([xshift=2mm]title.south west) rectangle node[mtpurple]{\\large\\bfseries $\\equiv$} ([xshift=7mm]title.north west);",
"\t\t\\path[fill=mtpurple,draw=none] ([yshift=-2mm]title.south west) rectangle ([xshift=2mm]title.north west);",
"\t\t\\path[fill=mtpurple,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tunderlay middle={%",
"\t\t\\path[fill=mtpurple,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tunderlay last={%",
"\t\t\\path[fill=mtpurple,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tdrop fuzzy shadow=black!30!white,",
"\t#1",
"}",
"",
"\\newtcolorbox{hint}[1][]{",
"\tenhanced,",
"\tbreakable,",
"\tbefore skip=2mm,",
"\tafter skip=3mm,",
"\t%fontupper=\\gtfamily\\sffamily,",
"\tcolframe=black!10!white,",
"\tboxrule=0.0pt,",
"\tleft=3mm,",
"\ttitle=\\hspace{1.6ex}Hint,",
"\tfonttitle=\\bfseries\\gtfamily\\sffamily,",
"\tcoltitle=mtseagreen,",
"\tcolbacktitle=mtlightseagreen,",
"\ttoptitle=1mm,",
"\tbottomtitle=1mm,",
"\tcolback=white,",
"\tsharp corners,",
"\tunderlay unbroken={%",
"\t\t\\path[fill=mtlightseagreen,draw=none] ([xshift=2mm]title.south west) rectangle node[mtseagreen]{\\large\\bfseries $\\star$} ([xshift=7mm]title.north west);",
"\t\t\\path[fill=mtseagreen,draw=none] ([yshift=-2mm]title.south west) rectangle ([xshift=2mm]title.north west);",
"\t\t\\path[fill=mtseagreen,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tunderlay first={%",
"\t\t\\path[fill=mtlightseagreen,draw=none] ([xshift=2mm]title.south west) rectangle node[mtseagreen]{\\large\\bfseries $\\star$} ([xshift=7mm]title.north west);",
"\t\t\\path[fill=mtseagreen,draw=none] ([yshift=-2mm]title.south west) rectangle ([xshift=2mm]title.north west);",
"\t\t\\path[fill=mtseagreen,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tunderlay middle={%",
"\t\t\\path[fill=mtseagreen,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tunderlay last={%",
"\t\t\\path[fill=mtseagreen,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tdrop fuzzy shadow=black!30!white,",
"\t#1",
"}",
"",
"\\newtcolorbox{info}[1][]{",
"\tenhanced,",
"\tbreakable,",
"\tbefore skip=2mm,",
"\tafter skip=3mm,",
"\t%fontupper=\\gtfamily\\sffamily,",
"\tcolframe=black!10!white,",
"\tboxrule=0.0pt,",
"\tleft=3mm,",
"\ttitle=\\hspace{1.6ex}Info,",
"\tfonttitle=\\bfseries\\gtfamily\\sffamily,",
"\tcoltitle=mtmarine,",
"\tcolbacktitle=mtlightmarine,",
"\ttoptitle=1mm,",
"\tbottomtitle=1mm,",
"\tcolback=white,",
"\tsharp corners,",
"\tunderlay unbroken={%",
"\t\t\\path[fill=mtlightmarine,draw=none] ([xshift=2mm]title.south west) rectangle node[mtmarine]{\\large\\bfseries i} ([xshift=7mm]title.north west);",
"\t\t\\path[fill=mtmarine,draw=none] ([yshift=-2mm]title.south west) rectangle ([xshift=2mm]title.north west);",
"\t\t\\path[fill=mtmarine,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tunderlay first={%",
"\t\t\\path[fill=mtlightmarine,draw=none] ([xshift=2mm]title.south west) rectangle node[mtmarine]{\\large\\bfseries i} ([xshift=7mm]title.north west);",
"\t\t\\path[fill=mtmarine,draw=none] ([yshift=-2mm]title.south west) rectangle ([xshift=2mm]title.north west);",
"\t\t\\path[fill=mtmarine,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tunderlay middle={%",
"\t\t\\path[fill=mtmarine,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tunderlay last={%",
"\t\t\\path[fill=mtmarine,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tdrop fuzzy shadow=black!30!white,",
"\t#1",
"}",
"",
"\\newtcolorbox{checktcbox}[1][]{",
"\tenhanced,",
"\tbreakable,",
"\tbefore skip=2mm,",
"\tafter skip=3mm,",
"\t%fontupper=\\gtfamily\\sffamily,",
"\tcolframe=black!10!white,",
"\tboxrule=0.0pt,",
"\tleft=3mm,",
"\ttitle=\\hspace{1.6ex}Check,",
"\tfonttitle=\\bfseries\\gtfamily\\sffamily,",
"\tcoltitle=mtgreen,",
"\tcolbacktitle=mtlightgreen,",
"\ttoptitle=1mm,",
"\tbottomtitle=1mm,",
"\tcolback=white,",
"\tsharp corners,",
"\tunderlay unbroken={%",
"\t\t\\path[fill=mtlightgreen,draw=none] ([xshift=2mm]title.south west) rectangle node[mtgreen]{\\large\\bfseries $\\checkmark$} ([xshift=7mm]title.north west);",
"\t\t\\path[fill=mtgreen,draw=none] ([yshift=-2mm]title.south west) rectangle ([xshift=2mm]title.north west);",
"\t\t\\path[fill=mtgreen,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tunderlay first={%",
"\t\t\\path[fill=mtlightgreen,draw=none] ([xshift=2mm]title.south west) rectangle node[mtgreen]{\\large\\bfseries $\\checkmark$} ([xshift=7mm]title.north west);",
"\t\t\\path[fill=mtgreen,draw=none] ([yshift=-2mm]title.south west) rectangle ([xshift=2mm]title.north west);",
"\t\t\\path[fill=mtgreen,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tunderlay middle={%",
"\t\t\\path[fill=mtgreen,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tunderlay last={%",
"\t\t\\path[fill=mtgreen,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tdrop fuzzy shadow=black!30!white,",
"\t#1",
"}",
"",
"\\newtcolorbox{mttcbox}[2][]{",
"\tenhanced,",
"\tbreakable,",
"\tbefore skip=2mm,",
"\tafter skip=3mm,",
"\t%fontupper=\\gtfamily\\sffamily,",
"\tcolframe=black!10!white,",
"\tboxrule=0.0pt,",
"\tleft=3mm,",
"\ttitle={\\hspace{1.6ex}#2},",
"\tfonttitle=\\bfseries\\gtfamily\\sffamily,",
"\tcoltitle=mtgray,",
"\tcolbacktitle=mtlightgray,",
"\ttoptitle=1mm,",
"\tbottomtitle=1mm,",
"\tcolback=white,",
"\tsharp corners,",
"\tunderlay unbroken={%",
"\t\t\\path[fill=mtlightgray,draw=none] ([xshift=2mm]title.south west) rectangle node[mtgray]{\\large\\bfseries $\\Box$} ([xshift=7mm]title.north west);",
"\t\t\\path[fill=mtgray,draw=none] ([yshift=-2mm]title.south west) rectangle ([xshift=2mm]title.north west);",
"\t\t\\path[fill=mtgray,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tunderlay first={%",
"\t\t\\path[fill=mtlightgray,draw=none] ([xshift=2mm]title.south west) rectangle node[mtgray]{\\large\\bfseries $\\Box$} ([xshift=7mm]title.north west);",
"\t\t\\path[fill=mtgray,draw=none] ([yshift=-2mm]title.south west) rectangle ([xshift=2mm]title.north west);",
"\t\t\\path[fill=mtgray,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tunderlay middle={%",
"\t\t\\path[fill=mtgray,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tunderlay last={%",
"\t\t\\path[fill=mtgray,draw=none] (interior.south west) rectangle ([xshift=2mm]interior.north west);",
"\t},",
"\tdrop fuzzy shadow=black!30!white,",
"\t#1",
"}"
],
"description": "custom tcolorbox"
},
"table": {
"prefix": "tab",
"body": [
"\\begin{table}[htp]",
"\\caption{${1}}",
"\\begin{center}",
"\\begin{tabular}{c c} \\hline \\hline",
"\t$0",
"\\end{tabular}",
"\\end{center}",
"\\label{${2}}",
"\\end{table}",
],
"description": "table"
},
"figure": {
"prefix": "fig",
"body": [
"\\begin{figure}[htbp]",
"\\begin{center}",
"\t\\includegraphics[clip, width=${1}]{${2}}",
"\t\\caption{$0}",
"\t\\label{${3}}",
"\\end{center}",
"\\end{figure}"
],
"description": "figure"
},
"two-figure": {
"prefix": "2fig",
"body": [
"\\begin{figure}[htbp]",
"\\begin{minipage}{0.5\\hsize}",
"\t\\begin{center}",
"\t\t\\includegraphics[clip, width=85mm]{${1}}",
"\t\t\\caption{${2}}",
"\t\t\\label{${3}}",
"\t\\end{center}",
"\\end{minipage}",
"\\begin{minipage}{0.5\\hsize}",
"\t\\begin{center}",
"\t\t\\includegraphics[clip, width=85mm]{${4}}",
"\t\t\\caption{${5}}",
"\t\t\\label{${6}}",
"\t\\end{center}",
"\\end{minipage}",
"\\end{figure}"
],
"description": "two figures(horizontal layout)"
},
"align": {
"prefix": "eq",
"body": [
"\\begin{align}",
"\t$0",
"\\end{align}"
],
"description": "align"
},
"split": {
"prefix": "spl",
"body": [
"\\begin{split}",
"\t$0",
"\\end{split}"
],
"description": "split"
},
"notag": {
"prefix": "ntg",
"body": "\\notag",
"description": "notag"
},
"itemize": {
"prefix": "itm",
"body": [
"\\begin{itemize}",
"\t\\item $0",
"\\end{itemize}"
],
"description": "itemize"
},
"enumerate": {
"prefix": "enm",
"body": [
"\\begin{enumerate}",
"\t\\item $0",
"\\end{enumerate}"
],
"description": "enumerate"
},
"description": {
"prefix": "dsc",
"body": [
"\\begin{description}",
"\t\\item[${1}] $0",
"\\end{description}"
],
"description": "description"
},
"parenthqty": {
"prefix": "@(",
"body": [
"\\qty(",
"\t$0",
""
],
"description": "qty parenthesis"
},
"waveqty": {
"prefix": "@{",
"body": [
"\\qty{",
"\t$0",
""
],
"description": "qty wave bracket"
},
"boxqty": {
"prefix": "@[",
"body": [
"\\qty[",
"\t$0",
""
],
"description": "qty box bracket"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment