Last active
February 6, 2017 18:13
-
-
Save svenwltr/28e5c7856bb18b446557 to your computer and use it in GitHub Desktop.
LaTeX draft corner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% vim: sts=3:ts=3:sw=3 : | |
\documentclass[ | |
12pt, | |
a4paper, | |
twoside, | |
%openright | |
]{scrreprt} | |
\usepackage{tikz} | |
\usepackage[all]{background} | |
\usepackage{blindtext} % lorem ipsum generator | |
\providecommand{\MyGitRevision}{Unbekannte Revision} | |
\newcommand{\MyDraftCorner}{ | |
\ifthispageodd{ % different picture for left and right pages | |
% right corner | |
\begin{tikzpicture}[remember picture,overlay,x=-4mm, y=-4mm, xshift=15cm] | |
\draw [black] (12, 0) -- (0, 12); | |
\node[text=black,rotate=-45] at (3,3) {Entwurf}; | |
\node[text=black,rotate=-45] at (4,4) {\today}; | |
\node[text=black,rotate=-45] at (5,5) {\MyGitRevision}; | |
\end{tikzpicture} | |
}{ | |
% left corner | |
\begin{tikzpicture}[remember picture,overlay,x=-4mm, y=-4mm, xshift=-10.3cm] | |
\draw [black] (12, 12) -- (0, 0); | |
\node[text=black,rotate=45] at (9,3) {Entwurf}; | |
\node[text=black,rotate=45] at (8,4) {\today}; | |
\node[text=black,rotate=45] at (7,5) {\MyGitRevision}; | |
\end{tikzpicture} | |
} | |
} | |
% define background for each page | |
\SetBgContents{\MyDraftCorner} | |
\SetBgPosition{current page.north} | |
\SetBgOpacity{1.0} | |
\SetBgAngle{0.0} | |
\SetBgScale{0.7} | |
\begin{document} | |
\blinddocument | |
\end{document} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MASTER=document.tex | |
DESCRIBE=$(shell git describe --tags --dirty) | |
SOURCE="\def\MyGitRevision{$(DESCRIBE)}\input{$(MASTER)}" | |
full: | |
make pdf | |
make pdf | |
pdf: | |
pdflatex "\def\MyGitRevision{$(DESCRIBE)}\input{$(MASTER)}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment