Add styling to PDF manual

This uses the xelatex engine and a few style settings to make the PDF manual look more like the HTML manual.
This commit is contained in:
Simon Large 2020-07-23 15:39:23 +01:00
parent f11a089141
commit 60362ce8cd
2 changed files with 34 additions and 1 deletions

View File

@ -2,7 +2,8 @@
# To install required tools in debian:
# sudo apt-get install pandoc texlive-latex-base texlive-fonts-recommended texlive-latex-extra
pandoc manual.md -o manual.pdf -s --number-sections --toc --css manual.css
pandoc manual.md -o manual.pdf -s --number-sections --toc -f markdown --pdf-engine=xelatex --listings -V mainfont="Segoe UI" -V monofont="Consolas" -V geometry:a4paper -V geometry:margin=2.4cm -H manual-style.tex
pandoc manual.md -o manual.html -s --number-sections --toc --css manual.css
pandoc reference-cfg-format.md -o reference-cfg-format.pdf -s --number-sections --toc

32
man/manual-style.tex Normal file
View File

@ -0,0 +1,32 @@
\usepackage{titlesec}
\usepackage{fancyvrb,newverbs,xcolor}
\usepackage{xcolor}
\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing*{\chapter}{0pt}{-20pt}{20pt}
\definecolor{Light}{HTML}{EEEEEE}
\let\oldtexttt\texttt
\renewcommand{\texttt}[1]{
\colorbox{Light}{\oldtexttt{#1}}
}
\lstset{
basicstyle=\ttfamily,
backgroundcolor=\color{Light},
xleftmargin=10pt,
frame=lrtb,
framesep=10pt,
framerule=0pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2,
captionpos=b,
breaklines=true,
breakatwhitespace=true,
breakautoindent=true,
linewidth=\textwidth
}