Revert "Revert "Merge pull request #36 from krono/krono/draft-enhanchement""
authorTobias Pape <tobias@netshed.de>
Tue, 7 Jan 2014 14:21:56 +0000 (15:21 +0100)
committerTobias Pape <tobias@netshed.de>
Tue, 7 Jan 2014 14:21:56 +0000 (15:21 +0100)
This reverts commit be7a9f46ca468be59644fc770ed01015f4c2042c.

src/common/style.tex
src/common/system.tex
src/img/draft.png [new file with mode: 0644]

index 17cefa5..cce0075 100644 (file)
 \definecolor{CadetBlue}{cmyk}{0.62,0.57,0.23,0}
 \definecolor{lightlightgray}{gray}{0.9}
 
+% Draft stuff
+\ifdraft{
+  % Ensure that everything is neatly set up for us
+  \AtBeginDocument{
+    \def\draftInfo{%
+      Draft revision\gitVtags: \gitAbbrevHash{} %
+      (\gitCommitterIsoDate) \gitCommitterName}
+    \sbox{\draftWatermark}{%
+      \includegraphics[width=\paperwidth]{img/draft}}
+    \sbox{\draftPageLine}{%
+      \colorbox{black!10}{%
+        % enlarge box vertically by 2/3 lines
+        \raisebox{0pt}%
+        [\dimexpr .33\baselineskip + \height]%
+        [\dimexpr .33\baselineskip + \depth]{%
+          \makebox[\paperwidth]{\color{black!50}\draftInfo}}}}
+  }
+}{}
+
+
 %%% Fonts
 % Fonts are loaded, now is the right time for mictorype.
 \microtypesetup{stretch=9,shrink=15,step=3,tracking=smallcaps,letterspace=75}
 % Section headers
 \addtokomafont{disposition}{\color{darkblue}\bfseries}
 
-
 % Page foot
 \setkomafont{pagefoot}{\normalfont\sffamily\footnotesize}
 \ifoot%
-[Applied Crypto Hardening \textbullet{} Draft revision\gitVtags: \gitAbbrevHash{} (\gitCommitterIsoDate) \gitCommitterName]%
-{Applied Crypto Hardening \textbullet{} Draft revision\gitVtags: \gitAbbrevHash{} (\gitCommitterIsoDate) \gitCommitterName}
+[Applied Crypto Hardening\ifdraft{ % Space!
+  \textbullet{} \draftInfo}{}]%
+{Applied Crypto Hardening \ifdraft{ % Space!
+    \textbullet{} \draftInfo}{}}
 \cfoot[]{}
 \ofoot%
 [page \thepage\ of \pageref{LastPage}]%
index f1f996c..17b044d 100644 (file)
@@ -64,7 +64,6 @@
 \usepackage{lastpage}
 
 % Misc
-%\usepackage{draftwatermark}
 \usepackage{gitinfo}
 \usepackage{catchfile}
 \usepackage{hyperref}
   %% Heavy debugging
   %\usepackage{showframe}
   \usepackage{blindtext}
-  \usepackage{draftwatermark}
-  \SetWatermarkLightness{0.95}
-  %\AtEndDocument{\listoftodos}
+  \usepackage{eso-pic}
+  \newsavebox{\draftPageLine}
+  \newsavebox{\draftWatermark}
+  \AddToShipoutPicture{%
+    \AtPageLowerLeft{\usebox{\draftWatermark}}
+    \AtPageUpperLeft{%
+      \raisebox{-\height}[\height][0pt]{\usebox{\draftPageLine}}}%
+    \AtPageLowerLeft{%
+      \raisebox{\depth}[\height][0pt]{\usebox{\draftPageLine}}}%
+  }
+  % \AtEndDocument{\listoftodos}
 }{
   \let\blindtext\relax
   \let\Blindtext\relax
diff --git a/src/img/draft.png b/src/img/draft.png
new file mode 100644 (file)
index 0000000..3c3ea61
Binary files /dev/null and b/src/img/draft.png differ