Created
March 1, 2018 22:57
-
-
Save vivngo/e37e1c7b79bf7e8b910c6566c59c46be to your computer and use it in GitHub Desktop.
SQL syntax highlighting in LaTeX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\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 | |
} |
@playerEric1 Haha I forgot about this! I'm glad. Your comment made my day :-)
Nice thank you, It got me into doing the same for Python too, thank you.
@mcarlosfr So glad to hear that! Best of luck on your project :-)
How can this be used? I'm new in LaTeX and I'm trying to include an SQL query in a document
@egeorg02 You put your SQL Code in a block like this
\begin{lstlisting}
SQL-Code
\end{lstlisting}
(If you haven't found out yourself by now :D)
Many thanks to the author, worked perfectly well!
Thanks you!
Thanks man it works great! My teacher def gonna like this more than the notepad lol
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you! It works perfectly!