Skip to content

Commit

Permalink
#6 added margins and improved blueprint box issues
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonMcCallum committed May 1, 2018
1 parent 2e48a69 commit 2fe4082
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions inc/implementation.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ \chapter{Implementation}

For code listing we have decided to use the lstlisting package. There are several ways to use the package. The basic use is a code listing inline see Listing~\ref{lst:HelloWorldC++} for a \CPP example and Listing~\ref{lst:Python} for a Python example. The listings package does the work of colourizing cose so that you can easily include formatted code. For more documentation on listings on wikibooks \footnote{\url{https://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings}}

%these are the default setup for code blocks
\lstset{frameround=tttt}
\lstset{frame=single}
\lstset{xleftmargin=.05\textwidth, xrightmargin=.05\textwidth}


\begin{lstlisting}[language=C++, caption= {Hello World C++ The code listing for Hello World in C++, with colour syntax highlighting.}, label={lst:HelloWorldC++}]
#include<stdio.h>
Expand Down Expand Up @@ -73,14 +76,17 @@ \chapter{Implementation}
escapeinside={(*@}{@*)}, % if you want to add LaTeX within your code
}

% define blueprint as a programming language with no real text keywords or syntax
\lstdefinelanguage{blueprint}
{morekeywords={visual},
sensitive=false,
% define blueprint as a programming language with no real text keywords or syntax and no margins
\lstdefinelanguage{blueprint}{
morekeywords={visual},
sensitive=false,
frame=none,
xleftmargin=0pt,
xrightmargin=0pt
}

\begin{lstlisting}[language=blueprint, caption={Blueprint from Unreal Engine}, label={lst:blue1}]
(*@ \centering \includegraphics[width=.90\textwidth]{images/blueprint} @*)
(*@ \includegraphics[width=.90\textwidth]{images/blueprint} @*)
\end{lstlisting}


Expand Down

0 comments on commit 2fe4082

Please sign in to comment.