From 72470ed634b2d3358cfad29b1faada5affa6bb28 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 30 Sep 2016 11:50:57 +0200 Subject: [PATCH] use custom dblatex style (add logo to pdf) --- Makefile | 6 ++-- asciidoc-dblatex-custom.sty | 58 +++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 asciidoc-dblatex-custom.sty diff --git a/Makefile b/Makefile index 5941a8e..c6bfcfe 100644 --- a/Makefile +++ b/Makefile @@ -224,8 +224,10 @@ pve-admin-guide.chunked: ${PVE_ADMIN_GUIDE_SOURCES} a2x -a docinfo -a docinfo1 -a icons -f chunked pve-admin-guide.adoc pve-admin-guide.pdf: ${PVE_ADMIN_GUIDE_SOURCES} docinfo.xml pve-admin-guide-docinfo.xml + inkscape -z -D --export-pdf=logo.pdf images/proxmox-logo.svg grep ">Release ${DOCRELEASE}<" pve-admin-guide-docinfo.xml || (echo "wrong release in pve-admin-guide-docinfo.xml" && false); - a2x -a docinfo -a docinfo1 -f pdf -L --dblatex-opts "-P latex.output.revhistory=0" --dblatex-opts "-P latex.class.options=12pt" --dblatex-opts "-P doc.section.depth=2 -P toc.section.depth=2" pve-admin-guide.adoc + a2x -a docinfo -a docinfo1 -f pdf -L --dblatex-opts "-P latex.output.revhistory=0" --dblatex-opts "-P latex.class.options=12pt" --dblatex-opts "-P doc.section.depth=2 -P toc.section.depth=2" --dblatex-opts "-P doc.publisher.show=0 -s asciidoc-dblatex-custom.sty" pve-admin-guide.adoc + rm logo.pdf pve-admin-guide.epub: ${PVE_ADMIN_GUIDE_SOURCES} a2x -f epub pve-admin-guide.adoc @@ -281,5 +283,5 @@ update: clean make all clean: - rm -rf *.tmp.xml *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build api-viewer/apidoc.js chapter-*.html chapter-*-plain.html chapter-*.html pve-admin-guide.chunked + rm -rf logo.pdf *.tmp.xml *.html *.pdf *.epub *.tmp *.1 *.5 *.8 *.deb *.changes build api-viewer/apidoc.js chapter-*.html chapter-*-plain.html chapter-*.html pve-admin-guide.chunked find . -name '*~' -exec rm {} ';' diff --git a/asciidoc-dblatex-custom.sty b/asciidoc-dblatex-custom.sty new file mode 100644 index 0000000..caa7bb7 --- /dev/null +++ b/asciidoc-dblatex-custom.sty @@ -0,0 +1,58 @@ +%% +%% This style is derived from the docbook one. +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{asciidoc-proxmox}[2016/10/30 AsciiDoc DocBook Style] + +% this will set letterpaper, because docbook.sty honors page layout +% made by geometry package +%\usepackage[letterpaper,total={7.25in,9.25in}, top=1in]{geometry} +%\usepackage[a4paper]{geometry} + +\usepackage[a4paper, left=2cm, right=1cm, top=2.5cm, bottom=2cm ]{geometry} + +%% Just use the original package and pass the options. +\RequirePackageWithOptions{docbook} + +% Sidebar is a boxed minipage that can contain verbatim. +% Changed shadow box to double box. +\renewenvironment{sidebar}[1][0.95\textwidth]{ + \hspace{0mm}\newline% + \noindent\begin{Sbox}\begin{minipage}{#1}% + \setlength\parskip{\medskipamount}% +}{ + \end{minipage}\end{Sbox}\doublebox{\TheSbox}% +} + +% For DocBook literallayout elements, see `./dblatex/dblatex-readme.txt`. +\usepackage{alltt} + +\definecolor{proxmoxred}{RGB}{229, 112, 0} + +\newlength\mylength +\def\redribbon{ + \setlength\mylength{0.3\paperheight} + \AddToShipoutPicture*{ + \put(0,\LenToUnit{\mylength}){% + {\color{proxmoxred}\rule{\paperwidth}{2cm}}} + } +} + +% custom cover page +\def\DBKcover{ + \thispagestyle{empty} + \begin{flushright} + \includegraphics[width=0.5\textwidth]{logo} \\ + \vspace*{1in} + \bfseries + \sffamily + {\Huge \DBKtitle \\[1ex]\large ~~~ \\} + {\Huge \DBKsubtitle \\[1ex]\large ~~~ \\} + \vspace*{4.1in} + {\Large \DBKdate \\} + \vfill + {\Large \bfseries \sffamily Proxmox Server Solutions Gmbh} + \end{flushright} + \redribbon + \pagebreak[4] +} -- 2.39.2