]> git.proxmox.com Git - pve-docs.git/commitdiff
use custom dblatex style (add logo to pdf)
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 30 Sep 2016 09:50:57 +0000 (11:50 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 30 Sep 2016 09:50:57 +0000 (11:50 +0200)
Makefile
asciidoc-dblatex-custom.sty [new file with mode: 0644]

index 5941a8ee954d1a004db043df13c206cb598fdd36..c6bfcfe5001ad39bfb12785958a50746396cc548 100644 (file)
--- 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 (file)
index 0000000..caa7bb7
--- /dev/null
@@ -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]
+}