Skip to content

Instantly share code, notes, and snippets.

@vivngo
Created March 1, 2018 22:57
Show Gist options
  • Save vivngo/e37e1c7b79bf7e8b910c6566c59c46be to your computer and use it in GitHub Desktop.
Save vivngo/e37e1c7b79bf7e8b910c6566c59c46be to your computer and use it in GitHub Desktop.
SQL syntax highlighting in LaTeX
\usepackage{listings}
\usepackage{color}
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}
\lstset{language=SQL,
basicstyle={\small\ttfamily},
belowskip=3mm,
breakatwhitespace=true,
breaklines=true,
classoffset=0,
columns=flexible,
commentstyle=\color{dkgreen},
framexleftmargin=0.25em,
frameshape={}{yy}{}{}, %To remove to vertical lines on left, set `frameshape={}{}{}{}`
keywordstyle=\color{blue},
numbers=none, %If you want line numbers, set `numbers=left`
numberstyle=\tiny\color{gray},
showstringspaces=false,
stringstyle=\color{mauve},
tabsize=3,
xleftmargin =1em
}
@abutoameh
Copy link

Thanks you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment