Created
May 7, 2018 18:32
-
-
Save martinshaw/5616e311e81aff6bfbc22532ea573d20 to your computer and use it in GitHub Desktop.
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{article} | |
\usepackage{fancyhdr} | |
\pagestyle{fancy} | |
%% Define your header here. | |
%% See http://texblog.org/2007/11/07/headerfooter-in-latex-with-fancyhdr/ | |
\fancyhead[CO,CE]{John Doe, Class 123} | |
\usepackage[usenames,dvipsnames]{color} %% Allow color names | |
%% The listings package will format your source code | |
\usepackage{listings} | |
\lstdefinestyle{customasm}{ | |
belowcaptionskip=1\baselineskip, | |
xleftmargin=\parindent, | |
language=C++, | |
breaklines=true, %% Wrap long lines | |
basicstyle=\footnotesize\ttfamily, | |
commentstyle=\itshape\color{Gray}, | |
stringstyle=\color{Black}, | |
keywordstyle=\bfseries\color{OliveGreen}, | |
identifierstyle=\color{blue}, | |
xleftmargin=-8em, | |
showstringspaces=false | |
} | |
\begin{document} | |
\lstinputlisting[style=customasm]{/path/to/your/code.c} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment