From 60362ce8cdf7551486b897822f83a48622fa3082 Mon Sep 17 00:00:00 2001 From: Simon Large Date: Thu, 23 Jul 2020 15:39:23 +0100 Subject: [PATCH] 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. --- man/buildman.sh | 3 ++- man/manual-style.tex | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 man/manual-style.tex diff --git a/man/buildman.sh b/man/buildman.sh index f1ff96f31..4c91e0ed6 100755 --- a/man/buildman.sh +++ b/man/buildman.sh @@ -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 diff --git a/man/manual-style.tex b/man/manual-style.tex new file mode 100644 index 000000000..72187c11b --- /dev/null +++ b/man/manual-style.tex @@ -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 +}