Skip to content

Instantly share code, notes, and snippets.

@eiriktsarpalis
Created August 13, 2013 19:10
Show Gist options
  • Save eiriktsarpalis/6224587 to your computer and use it in GitHub Desktop.
Save eiriktsarpalis/6224587 to your computer and use it in GitHub Desktop.
LaTeX F# definition for Listings package
\usepackage{listings}
\usepackage{upquote}
\lstdefinelanguage{FSharp}%
{morekeywords={let, new, match, with, rec, open, module, namespace, type, of, member, %
and, for, while, true, false, in, do, begin, end, fun, function, return, yield, try, %
mutable, if, then, else, cloud, async, static, use, abstract, interface, inherit, finally },
otherkeywords={ let!, return!, do!, yield!, use!, var, from, select, where, order, by },
keywordstyle=\color{bluekeywords},
sensitive=true,
basicstyle=\ttfamily,
breaklines=true,
xleftmargin=\parindent,
aboveskip=\bigskipamount,
tabsize=4,
morecomment=[l][\color{greencomments}]{///},
morecomment=[l][\color{greencomments}]{//},
morecomment=[s][\color{greencomments}]{{(*}{*)}},
morestring=[b]",
showstringspaces=false,
literate={`}{\`}1,
stringstyle=\color{redstrings},
}
@NicolaiSoeborg
Copy link

\usepackage{color}
\definecolor{bluekeywords}{rgb}{0.13,0.13,1}
\definecolor{greencomments}{rgb}{0,0.5,0}
\definecolor{redstrings}{rgb}{0.9,0,0}

@benjaminsaljooghi
Copy link

You can color types with

\definecolor{cyantypes}{rgb}{0.18,0.56,0.72}

and by adding

% new keyword colors
classoffset=1,
morekeywords={int, string, MyNewType},
keywordstyle=\color{cyantypes},
classoffset=0,

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