From d41fcea986f3cc974c92e0e8be6497dd1ddbfd69 Mon Sep 17 00:00:00 2001 From: Antti H S Laaksonen Date: Sun, 12 Mar 2017 10:09:41 +0200 Subject: [PATCH] Add syntax highlighting [closes #19] --- book.tex | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/book.tex b/book.tex index 58a5c09..167758f 100644 --- a/book.tex +++ b/book.tex @@ -1,6 +1,6 @@ \documentclass[twoside,12pt,a4paper,english]{book} -%\includeonly{chapter01,list} +%\includeonly{chapter11,list} \usepackage[english]{babel} \usepackage[utf8]{inputenc} @@ -28,10 +28,16 @@ \usepackage{titlesec} \usepackage{skak} +\usepackage{inconsolata} + \usetikzlibrary{patterns,snakes} \pagestyle{plain} +\definecolor{keywords}{HTML}{44548A} +\definecolor{strings}{HTML}{00999A} +\definecolor{comments}{HTML}{990000} + \lstset{language=C++,frame=single,basicstyle=\ttfamily \small,showstringspaces=false,columns=flexible} \lstset{ literate={รถ}{{\"o}}1 @@ -41,6 +47,11 @@ \lstset{xleftmargin=20pt,xrightmargin=5pt} \lstset{aboveskip=12pt,belowskip=8pt} +\lstset{ + commentstyle=\color{comments}, + keywordstyle=\color{keywords}, + stringstyle=\color{strings} +} \date{Draft \today}