-
-
Save zeroby0/a88aa2101672184f8a21e17e355f627b to your computer and use it in GitHub Desktop.
Simple LaTeX template to print beautiful black&white Javascript source code
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
| \documentclass[a4paper, 12pt]{article} | |
| \usepackage[letterpaper, margin=2cm]{geometry} | |
| \usepackage[T1]{fontenc} | |
| \usepackage{beramono} | |
| \usepackage{listings} | |
| \usepackage{xcolor} | |
| \newcommand\realnumberstyle[1]{} | |
| \makeatletter | |
| \makeatother | |
| \lstset{ | |
| aboveskip=0cm, | |
| stringstyle=\ttfamily, | |
| showstringspaces = false, | |
| basicstyle=\scriptsize\ttfamily, | |
| commentstyle=\color{gray!45}, | |
| keywordstyle=\bfseries, | |
| ndkeywordstyle=\bfseries, | |
| identifierstyle=\ttfamily, | |
| numbers=left, | |
| numbersep=15pt, | |
| numberstyle=\tiny, | |
| numberfirstline = false, | |
| breaklines=true | |
| } | |
| \lstdefinelanguage{JavaScript}{ | |
| keywords={typeof, new, true, false, catch, function, return, null, catch, switch, var, const, let, async, await, if, in, while, do, else, case, break, from}, | |
| ndkeywords={class, export, boolean, throw, implements, import, this}, | |
| sensitive=false, | |
| comment=[l]{//}, | |
| morecomment=[s]{/*}{*/}, | |
| morestring=[b]', | |
| morestring=[b]" | |
| } | |
| \begin{document} | |
| \begin{lstlisting}[language=JavaScript,numbers=left] | |
| Paste your code here | |
| \end{lstlisting} | |
| \end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment