Skip to content

Instantly share code, notes, and snippets.

@eddieantonio
Last active April 25, 2020 13:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eddieantonio/ce41bdd47aaff7292e17e181ec4d3f66 to your computer and use it in GitHub Desktop.
Save eddieantonio/ce41bdd47aaff7292e17e181ec4d3f66 to your computer and use it in GitHub Desktop.
Simple JavaScript definition for LaTeX's Listings package
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{javascript}[2017/04/13]
% Defines a Listings definition for JavaScript (ECMAscript 2016).
\RequirePackage{listings}
\lstdefinelanguage{JavaScript}{%
keywords={const, let, typeof, instanceof, new, true, false, catch, function, return, null, undefined, catch, switch, var, if, in, while, for, do, else, case, break},
keywordstyle=\bfseries,
ndkeywords={class, export, throw, import, this},
ndkeywordstyle=\bfseries,
sensitive=false,
comment=[l]{//},
morecomment=[s]{/*}{*/},
commentstyle=\ttfamily,
stringstyle=\color{blue}\ttfamily,
morestring=[b]',
morestring=[b]`,
morestring=[b]"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment