Skip to content

Instantly share code, notes, and snippets.

@mstankie
Last active May 25, 2017 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mstankie/2bd3da2c7ecb12a39f967044519f1cfa to your computer and use it in GitHub Desktop.
Save mstankie/2bd3da2c7ecb12a39f967044519f1cfa to your computer and use it in GitHub Desktop.
Styles for listings package -different languages listings in LaTeX.
\definecolor{mygreen}{rgb}{0,0.6,0}
\definecolor{mygray}{rgb}{0.5,0.5,0.5}
\definecolor{mymauve}{rgb}{0.58,0,0.82}
\lstdefinestyle{customc}{
belowcaptionskip=1\baselineskip,
breaklines=true,
frame=L,
xleftmargin=\parindent,
language=C,
showstringspaces=false,
basicstyle=\footnotesize\ttfamily,
keywordstyle=\bfseries\color{mygray},
commentstyle=\itshape\color{mygreen},
identifierstyle=\color{blue},
stringstyle=\color{mymauve},
numbers=left,
numbersep=12pt,
numberstyle=\tiny\color{black},
}
\usepackage{listings}
% ...
\begin{lstlisting}[language=C, style=customc]
void test() {}
\end{lstlisting}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment