Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4beee51

Browse files
committed
Update ebooks and fix code overflowing in PDF (fixes #96)
1 parent d6503bc commit 4beee51

2 files changed

Lines changed: 27 additions & 2 deletions

File tree

build_ebook.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def repl(m):
8383
# Building PDF
8484
print('building pdf...')
8585

86-
subprocess.check_output(['pandoc', 'ebook.md', '-V', 'documentclass=report', '-t', 'latex', '-s', '--toc', '-o', 'ebook/Vulkan Tutorial.pdf'])
86+
subprocess.check_output(['pandoc', 'ebook.md', '-V', 'documentclass=report', '-t', 'latex', '-s', '--toc', '--listings', '-H', 'ebook/listings-setup.tex', '-o', 'ebook/Vulkan Tutorial.pdf'])
8787

8888
print('building epub...')
8989

@@ -93,4 +93,4 @@ def repl(m):
9393
os.remove('ebook.md')
9494

9595
for fn in generatedPngs:
96-
os.remove(fn)
96+
os.remove(fn)

ebook/listings-setup.tex

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
% Contents of listings-setup.tex
2+
\usepackage{xcolor}
3+
4+
\lstset{
5+
basicstyle=\ttfamily,
6+
numbers=left,
7+
keywordstyle=\color[rgb]{0.13,0.29,0.53}\bfseries,
8+
stringstyle=\color[rgb]{0.31,0.60,0.02},
9+
commentstyle=\color[rgb]{0.56,0.35,0.01}\itshape,
10+
numberstyle=\footnotesize,
11+
stepnumber=1,
12+
numbersep=5pt,
13+
backgroundcolor=\color[RGB]{248,248,248},
14+
showspaces=false,
15+
showstringspaces=false,
16+
showtabs=false,
17+
tabsize=2,
18+
captionpos=b,
19+
breaklines=true,
20+
breakatwhitespace=true,
21+
breakautoindent=true,
22+
escapeinside={\%*}{*)},
23+
linewidth=\textwidth,
24+
basewidth=0.5em,
25+
}

0 commit comments

Comments
 (0)