From b7c2b8475afc2d44e63995ddeb3365f9dae4de19 Mon Sep 17 00:00:00 2001 From: mo khan Date: Mon, 8 Feb 2016 11:24:22 -0700 Subject: add external code listings. --- report/script.pl | 2 ++ report/script.rb | 2 ++ report/script.sh | 3 +++ report/template.tex | 12 ++++++++---- 4 files changed, 15 insertions(+), 4 deletions(-) create mode 100755 report/script.pl create mode 100644 report/script.rb create mode 100644 report/script.sh diff --git a/report/script.pl b/report/script.pl new file mode 100755 index 0000000..6f2b764 --- /dev/null +++ b/report/script.pl @@ -0,0 +1,2 @@ +#!/usr/bin/perl +print S(@ARGV);sub S{$r=(@_[0]%4==0&&@_[0]%100!=0)||@_[0]%400=0;} diff --git a/report/script.rb b/report/script.rb new file mode 100644 index 0000000..cf24b1d --- /dev/null +++ b/report/script.rb @@ -0,0 +1,2 @@ +#!/usr/bin/env ruby +puts "Hello World" diff --git a/report/script.sh b/report/script.sh new file mode 100644 index 0000000..8997733 --- /dev/null +++ b/report/script.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "hello world" diff --git a/report/template.tex b/report/template.tex index 6d1f129..d2a730c 100644 --- a/report/template.tex +++ b/report/template.tex @@ -169,10 +169,14 @@ I'm referring to footnote~\ref{myfootnote}. \end{figure} \newpage -\begin{lstlisting} -#!/usr/bin/perl -print S(@ARGV);sub S{$r=(@_[0]%4==0&&@_[0]%100!=0)||@_[0]%400=0;} -\end{lstlisting} +Perl code +\lstinputlisting[language=Perl]{script.pl} + +Ruby code +\lstinputlisting[language=Ruby]{script.rb} + +Bash script +\lstinputlisting[language=Bash]{script.sh} \newpage \begin{appendix} -- cgit v1.2.3