add pdf version
This commit is contained in:
parent
489b0b1a7a
commit
d3e2dc749f
20
makefile
20
makefile
@ -1,12 +1,26 @@
|
||||
title = 'category-theory-for-programmers'
|
||||
title = category-theory-for-programmers
|
||||
|
||||
root = $(shell pwd)
|
||||
src = $(root)/src
|
||||
|
||||
chapters = $(shell find $(src)/part-* -name '*.html' | sort -V)
|
||||
|
||||
book:
|
||||
cd $(src)/init; \
|
||||
all: $(title).epub $(title).pdf
|
||||
|
||||
$(title).pdf:
|
||||
@ cd $(src)/init; \
|
||||
pandoc \
|
||||
$(src)/init/preface.html \
|
||||
$(chapters) \
|
||||
--smart \
|
||||
--toc \
|
||||
--number-section \
|
||||
--latex-engine=xelatex \
|
||||
-H $(root)/pandoc/options.tex \
|
||||
-o $(root)/$(title).pdf
|
||||
|
||||
$(title).epub:
|
||||
@ cd $(src)/init; \
|
||||
pandoc \
|
||||
$(src)/init/preface.html \
|
||||
$(chapters) \
|
||||
|
15
pandoc/options.tex
Normal file
15
pandoc/options.tex
Normal file
@ -0,0 +1,15 @@
|
||||
% center images
|
||||
\usepackage[export]{adjustbox}
|
||||
\LetLtxMacro{\OldIncludegraphics}{\includegraphics}
|
||||
\renewcommand{\includegraphics}[2][]{
|
||||
\begin{center}
|
||||
\OldIncludegraphics[max width=8cm,max height=4cm,#1]{#2}
|
||||
\end{center}
|
||||
}
|
||||
|
||||
% avoid that figures get a whole page
|
||||
\renewcommand{\floatpagefraction}{.8}%
|
||||
|
||||
% start new page with each section
|
||||
\usepackage{etoolbox}
|
||||
\pretocmd{\section}{\clearpage}{}{}
|
Loading…
Reference in New Issue
Block a user