From af572de26cb65f99d21da842737b86bc50b61ed4 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 30 Apr 2018 09:42:38 +0100 Subject: [PATCH] Add more titles and code examples --- build.sh | 2 +- packages.tex | 24 ++++++++++++++++++++ test/main.md | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 86 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 989aec1..d5f8a00 100755 --- a/build.sh +++ b/build.sh @@ -19,7 +19,7 @@ then INPUT_FILES="$INPUT_FILES $METADATA_FILE" fi -PANDOC_ARGS="$INPUT_FILES --lua-filter=$SCRIPTPATH/variables.lua --template $SCRIPTPATH/main.tex -o $OUTPUT_FILE $ADDITIONAL_ARGS" +PANDOC_ARGS="$INPUT_FILES --lua-filter=$SCRIPTPATH/variables.lua --template $SCRIPTPATH/main.tex --listings -o $OUTPUT_FILE $ADDITIONAL_ARGS" echo "> Building document..." cd $SCRIPTPATH && pandoc $PANDOC_ARGS diff --git a/packages.tex b/packages.tex index d2eeaa6..166efc7 100644 --- a/packages.tex +++ b/packages.tex @@ -11,6 +11,9 @@ \usepackage[margin=1in,includefoot]{geometry} \usepackage{graphicx} \usepackage{titlesec} +\usepackage{textcomp} +\usepackage{xcolor} +\usepackage{listings} \hypersetup{ hidelinks=true @@ -18,6 +21,27 @@ \usepackage{helvet} \renewcommand{\familydefault}{\sfdefault} +\newcommand{\passthrough}{} + \usepackage[document]{ragged2e} \usepackage{lastpage} + +\lstset{ + basicstyle=\ttfamily, + keywordstyle=\color[rgb]{0.13,0.29,0.53}\bfseries, + stringstyle=\color[rgb]{0.31,0.60,0.02}, + commentstyle=\color[rgb]{0.56,0.35,0.01}\itshape, + backgroundcolor=\color[RGB]{248,248,248}, + showspaces=false, + showstringspaces=false, + showtabs=false, + tabsize=2, + captionpos=b, + breaklines=true, + breakatwhitespace=true, + breakautoindent=true, + escapeinside={\%*}{*)}, + linewidth=\textwidth, + basewidth=0.5em, +} diff --git a/test/main.md b/test/main.md index 31dfacb..523d844 100644 --- a/test/main.md +++ b/test/main.md @@ -5,9 +5,69 @@ subtitle: Test Document --- # Hello world -\lipsum[3-15] +\lipsum[3-10] Foo is equal to \$foo\$. Input directory is at \$inputDir\$. \includegraphics[width=\textwidth]{test-image} + +# Test 1 +test 1 + +## Test 1a +test 1a + +### Test 1ai +test 1ai + +### Test 1aii +test 1aii + +#### Test 1aii inner +test 1aii inner + +##### Test 1aii inner inner +test 1aii inner inner + +### Test 1aiii +test 1aiii + +## Test 1b +test 1b + +## Test 1c +test 1c + +# Test 2 +test 2 + +# Test 3 +test 3 + +# Test 4 +test 4 + + +# Test code +```java +public class Test { + static Set updateThreads = new HashSet(); + + public static void main(String[] args) { + ConcurrentMap concurrentMap = new ConcurrentHashMap(); + for (int i = 0; i < 1000; i++) { + startUpdateThread(i, concurrentMap); + } + for (Map.Entry entry : concurrentMap.entrySet()) { + System.out.println("Key :" + entry.getKey() + " Value:" + entry.getValue()); + } + for (Thread thread : updateThreads) { + thread.interrupt(); + } + } +} +``` + +## Test Inline Code +Some `inline` code.