summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-01-22 22:38:00 +0000
committerKarl Berry <karl@freefriends.org>2017-01-22 22:38:00 +0000
commitbc46c8f4627710df445115626d25161dcb2df985 (patch)
tree9a575a36a18a5935f5eb7b94341555a31b135e2f /Master/texmf-dist
parentad3821ed7290fee350c07efd2373cd164d2db4f9 (diff)
tikz-kalender (22jan17)
git-svn-id: svn://tug.org/texlive/trunk@43023 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/tikz-kalender/Kalender2016.pdfbin0 -> 35999 bytes
-rw-r--r--Master/texmf-dist/doc/latex/tikz-kalender/Kalender2016.tex19
-rw-r--r--Master/texmf-dist/doc/latex/tikz-kalender/README.md7
-rw-r--r--Master/texmf-dist/doc/latex/tikz-kalender/events2016.tex31
-rw-r--r--Master/texmf-dist/tex/latex/tikz-kalender/tikz-kalender.cls263
5 files changed, 320 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/tikz-kalender/Kalender2016.pdf b/Master/texmf-dist/doc/latex/tikz-kalender/Kalender2016.pdf
new file mode 100644
index 00000000000..fc340082760
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/tikz-kalender/Kalender2016.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/tikz-kalender/Kalender2016.tex b/Master/texmf-dist/doc/latex/tikz-kalender/Kalender2016.tex
new file mode 100644
index 00000000000..adf3daeb8e4
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/tikz-kalender/Kalender2016.tex
@@ -0,0 +1,19 @@
+\listfiles
+\documentclass[svgnames,print]{tikz-kalender}
+% "print" means printer-fiendly twoside output
+
+\begin{document}
+ \makeKalender[%
+ year=2016, % default: current year
+ title=Termine,
+ showweeknumbers, % default: false
+ titleColor=dark, % default: dark
+ eventColor=medium, % default: medium
+ workdayColor=none, % default: none
+ saturdayColor=bright, % default: bright
+ sundayColor=medium, % default: medium
+ monthColor=white, % default: white
+ monthBGcolor=dark % default: dark
+ ]
+\end{document}
+
diff --git a/Master/texmf-dist/doc/latex/tikz-kalender/README.md b/Master/texmf-dist/doc/latex/tikz-kalender/README.md
new file mode 100644
index 00000000000..a144443250c
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/tikz-kalender/README.md
@@ -0,0 +1,7 @@
+## A LaTeX based calendar using TikZ
+
+For usage see the example files »Kalender2016.tex« and »events2016.tex«. See also my [Git repository](https://github.com/rolfn/kalenderRN). The Code is inspired by this [document](http://www.texample.net/tikz/examples/a-calender-for-doublesided-din-a4/) and has the »Creative Commons attribution license (CC-BY-SA)«.
+
+The class »tikz-kalender« requires »tikz« and the tkiz libraries »calc« and »calendar«.
+
+Rolf Niepraschk, 2017-01-22
diff --git a/Master/texmf-dist/doc/latex/tikz-kalender/events2016.tex b/Master/texmf-dist/doc/latex/tikz-kalender/events2016.tex
new file mode 100644
index 00000000000..5548c0c832b
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/tikz-kalender/events2016.tex
@@ -0,0 +1,31 @@
+
+% Jährlich wiederkehrende Termine sollten das Makro \year enthalten.
+% Yearly events should contain the macro \year.
+
+\event*{\year-01-01}{Neujahr}
+\event{\year-03-14}{Albert Einstein (1879)}
+\event*{2016-03-25}{Karfreitag}
+\event*{2016-03-27}{Ostersonntag}
+\event*{2016-03-28}{Ostermontag}
+\event*{\year-05-01}{Tag der Arbeit}
+\event*{2016-05-05}{Himmelfahrt}
+\event{2016-05-15}{Pfingstsonntag}
+\event*{2016-05-16}{Pfingstmontag}
+\event*{\year-10-03}{Tag der dt. Einheit}
+\event{\year-10-09}{John Lennon (1940)}
+\event{\year-12-24}{Heiligabend}
+\event*{\year-12-25}{1. Weihnachtstag}
+\event*{\year-12-26}{2. Weihnachtstag}
+
+\event*{2016-07-10}{Fußball-EM: Endspiel}[color=DarkTurquoise]
+
+\period{2016-09-12}{2016-10-04}[color=red!30,name=Urlaub]
+
+\period{2016-02-01}{2016-02-06}[color=LightGreen]% Winterferien in Berlin
+\period{2016-03-21}{2016-04-02}[color=LightGreen]% Osterferien in Berlin
+\period{2016-05-17}{2016-05-18}[color=LightGreen]% Pfingstferien in Berlin
+\period{2016-07-21}{2016-09-02}[color=LightGreen]% Sommerferien in Berlin
+\period{2016-10-17}{2016-10-28}[color=LightGreen]% Herbstferien in Berlin
+\period{2016-12-23}{2017-01-03}[color=LightGreen]% Weihnachtsferien in Berlin
+
+\endinput
diff --git a/Master/texmf-dist/tex/latex/tikz-kalender/tikz-kalender.cls b/Master/texmf-dist/tex/latex/tikz-kalender/tikz-kalender.cls
new file mode 100644
index 00000000000..46d9ff6b3fa
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/tikz-kalender/tikz-kalender.cls
@@ -0,0 +1,263 @@
+%
+% Author: Rolf Niepraschk, https://github.com/rolfn/kalenderRN
+%
+% inspired by http://www.texample.net/tikz/examples/a-calender-for-doublesided-din-a4/
+% Original author: Robert Krause
+% License: Creative Commons attribution license (CC-BY-SA)
+
+\setcounter{errorcontextlines}{100}
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesClass{kalenderRN}[2017/01/22 v0.3c Calendar class (RN)]
+
+\newif\ifRN@print \RN@printfalse
+
+\DeclareOption{print}{\RN@printtrue}
+
+\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{xcolor}}
+\ProcessOptions\relax
+\LoadClass[a4paper,ngerman,10pt]{article}
+\ifRN@print
+ \RequirePackage{graphicx}
+ \PassOptionsToPackage{portrait}{geometry}
+\else
+ \PassOptionsToPackage{landscape}{geometry}
+\fi
+\RequirePackage[a4paper,margin={0mm,0mm}]{geometry}
+
+\newif\ifRN@XeOrLua \RN@XeOrLuafalse
+\RequirePackage{ifluatex,ifxetex}
+\ifxetex\RN@XeOrLuatrue\else\ifluatex\RN@XeOrLuatrue\fi\fi
+
+\ifRN@XeOrLua
+ \RequirePackage{fontspec}
+ \setsansfont{TeX Gyre Heros}[Ligatures=TeX]
+\else
+ \RequirePackage[T1]{fontenc}
+ \RequirePackage{textcomp}
+ \RequirePackage{lmodern}
+ \RequirePackage{tgheros}
+\fi
+
+\renewcommand*\familydefault{\sfdefault}
+
+\RequirePackage{etoolbox}
+\AtEndPreamble{% "etoolbox"
+ \ifRN@XeOrLua\else
+ \@ifpackageloaded{inputenc}{}{%
+ \RequirePackage[utf8]{inputenc}%
+ }%
+ \fi
+}
+
+\RequirePackage[main=ngerman]{babel}
+
+\RequirePackage[ngerman]{translator}
+
+\deftranslation[to=ngerman]{January}{Januar}
+\deftranslation[to=ngerman]{February}{Februar}
+\deftranslation[to=ngerman]{March}{März}
+\deftranslation[to=ngerman]{April}{April}
+\deftranslation[to=ngerman]{May}{Mai}
+\deftranslation[to=ngerman]{June}{Juni}
+\deftranslation[to=ngerman]{July}{Juli}
+\deftranslation[to=ngerman]{August}{August}
+\deftranslation[to=ngerman]{September}{September}
+\deftranslation[to=ngerman]{October}{Oktober}
+\deftranslation[to=ngerman]{November}{November}
+\deftranslation[to=ngerman]{December}{Dezember}
+\deftranslation[to=ngerman]{Mon}{Mo}
+\deftranslation[to=ngerman]{Tue}{Di}
+\deftranslation[to=ngerman]{Wed}{Mi}
+\deftranslation[to=ngerman]{Thu}{Do}
+\deftranslation[to=ngerman]{Fri}{Fr}
+\deftranslation[to=ngerman]{Sat}{Sb}
+\deftranslation[to=ngerman]{Sun}{So}
+
+\RequirePackage{tikz}
+\usetikzlibrary{calc}
+\usetikzlibrary{calendar}
+
+\RequirePackage{varwidth}
+
+\newcommand*\RN@year{}
+\edef\RN@year{\the\numexpr\year}
+
+\newsavebox\RN@pageI
+\newsavebox\RN@pageII
+\newsavebox\RN@tempbox
+\newdimen\RN@tempdima
+\newdimen\RN@tempdimb
+\newcommand*\RN@events@I{}
+\newcommand*\RN@events@II{}
+\newcommand*\RN@backgrounds{}
+\newcommand*\RN@periods{}
+\newcommand*\RN@title{}
+\newcommand*\RN@tempa{}
+\newcommand*\RN@tempb{}
+\newcounter{weeknumber}
+\newif\ifRN@showweeknumbers \RN@showweeknumbersfalse
+
+\pgfkeys{%
+ /CAL/.is family, /CAL,
+ showweeknumbers/.is if = RN@showweeknumbers,
+ title/.estore in = \RN@title,
+ year/.estore in = \RN@year,
+ default/.style={eventColor=medium,monthBGcolor=dark,monthColor=white,%
+ workdayColor=none,saturdayColor=bright,sundayColor=medium,titleColor=dark},
+ titleColor/.estore in = \RN@titleColor,
+ eventColor/.estore in = \RN@eventColor,
+ monthBGcolor/.estore in = \RN@monthBGcolor,
+ monthColor/.estore in = \RN@monthColor,
+ workdayColor/.estore in = \RN@workdayColor,
+ saturdayColor/.estore in = \RN@saturdayColor,
+ sundayColor/.estore in = \RN@sundayColor
+}
+\pgfkeys{%
+ /CAL/.is family, /CAL,
+ period/.cd,
+ default/.style={color=period,name={}},
+ color/.estore in = \RN@period@color,
+ name/.estore in = \RN@period@name
+}
+\pgfkeys{%
+ /CAL/.is family, /CAL,
+ event/.cd,
+ color/.estore in = \RN@eventColor
+}
+
+\newcommand*\period[2]{%
+ \@ifnextchar[{\period@i{#1}{#2}}{\period@i{#1}{#2}[]}
+}
+\newcommand*\period@i{}
+\def\period@i#1#2[#3]{%
+ \pgfkeys{/CAL/period/.cd, default, #3}%
+ \edef\@tempa{%
+ \noexpand\ifdate{between=#1 and #2}{%
+ \noexpand\tikzset{every day/.style={fill=\RN@period@color}}}{}%
+ }%
+ \expandafter\g@addto@macro\expandafter\RN@periods\expandafter{\@tempa}%
+ \ifx\RN@period@name\@empty\else
+ \pgfcalendar{}{#1}{#2}{%
+ \edef\RN@tempa{\pgfcalendarcurrentyear-\pgfcalendarcurrentmonth-\pgfcalendarcurrentday}%
+ \@ifundefined{event@\RN@tempa}{%
+ \event{\RN@tempa}{\RN@period@name}%
+ \edef\RN@tempb{\noexpand\expandafter\noexpand\gdef
+ \noexpand\csname event@\RN@tempa\noexpand\endcsname{\RN@period@name}}%
+ \RN@tempb
+ }{}%
+ }%
+ \fi
+}
+\newcommand*\event{%
+ \@ifstar{\@tempswatrue\RN@event@i}{\@tempswafalse\RN@event@i}%
+}
+\newcommand*\RN@event@i[2]{%
+ \@ifnextchar[{\RN@event@ii{#1}{#2}}{\RN@event@ii{#1}{#2}[]}
+}
+\newcommand*\RN@event@ii{}%
+\def\RN@event@ii#1#2[#3]{%
+ \pgfkeys{/CAL/event/.cd, #3}%
+ \@ifundefined{event@#1}{%
+ \protected@edef\@tempa{\noexpand\@ifundefined{pgf@sh@ns@cal-#1}{}{%
+ \noexpand\node[anchor=north west] at ($(cal-#1.north east)-(.6em,0em)$){%
+ \noexpand\makebox[0pt][r]{\noexpand\resizebox{!}{1.15ex}{%
+ \noexpand\varwidth{4.6cm}#2\noexpand\strut\noexpand\endvarwidth}}};}%
+ }%
+ \@namedef{event@#1}{#2}%
+ \pgfcalendarifdate{#1}{at most=06-last}% first half-year?
+ {\expandafter\g@addto@macro\expandafter\RN@events@I\expandafter{\@tempa}}%
+ {\expandafter\g@addto@macro\expandafter\RN@events@II\expandafter{\@tempa}}%
+ }{}%
+ \if@tempswa
+ \edef\@tempa{%
+ \noexpand\ifdate{equals=#1}{\noexpand\tikzset{%
+ every day/.style={fill=\RN@eventColor}}}{}
+ }%
+ \expandafter\g@addto@macro\expandafter\RN@backgrounds\expandafter{\@tempa}%
+ \fi
+}
+
+\definecolor{dark}{HTML}{A57C00}
+\colorlet{medium}{dark!35}
+\colorlet{bright}{dark!20}
+\colorlet{period}{gray!30}
+
+\newcommand\RN@@title{%
+ \raisebox{-.3\height}{\parbox[b]{\wd\RN@tempbox}{%
+ \fontsize{60}{70}\selectfont\color{\RN@titleColor}%
+ \textbf{\RN@year}~\textbf{\Huge\RN@title}\hfill
+ }}%
+}
+
+\newcommand\RN@makeKalender[2]{%
+ \sbox\RN@tempbox{%
+ \begin{tikzpicture}[every day/.style={anchor=north}]%
+ \calendar[dates=#1 to #2,name=cal,day text={\%d=},day yshift=3em,%]%
+ day code={%
+ \node[name=\pgfcalendarsuggestedname,every day,shape=rectangle,%
+ minimum height=.53cm,text width=4.4cm,draw=black]{\tikzdaytext};%
+ \draw(-1.8cm,-.1ex) node[anchor=west]{\footnotesize
+ \pgfcalendarweekdayshortname{\pgfcalendarcurrentweekday}%
+ \ifRN@showweeknumbers
+ \ifdate{Monday}{~~\stepcounter{weeknumber}\normalsize[%
+ \mbox{\footnotesize\arabic{weeknumber}}]}{}%
+ \fi
+ };%
+ },%
+ execute before day scope={%
+ \ifdate{day of month=1}{%
+ \pgftransformxshift{4.8cm}%
+ % Print month name
+ \draw (0,0)node [shape=rectangle,minimum height=.53cm,%
+ text width=4.4cm,fill=\RN@monthBGcolor,draw=\RN@monthBGcolor,%
+ text=\RN@monthColor,text centered]{%
+ \textbf{\pgfcalendarmonthname{\pgfcalendarcurrentmonth}}};}{}%
+ \ifdate{workday}{\tikzset{every day/.style={fill=\RN@workdayColor}}}{}%
+ \RN@periods
+ \ifdate{Saturday}{\tikzset{every day/.style={fill=\RN@saturdayColor}}}{}%
+ \ifdate{Sunday}{\tikzset{every day/.style={fill=\RN@sundayColor}}}{}%
+ \RN@backgrounds
+ },%
+ execute at begin day scope={%
+ \pgftransformyshift{-.53*\pgfcalendarcurrentday cm}%
+ }%
+ ];%
+ \pgfcalendarifdate{#1}{at most=06-last}{\RN@events@I}{\RN@events@II}%
+ \end{tikzpicture}%
+ }%
+ \RN@tempdima=\ifRN@print\paperwidth\else\paperheight\fi
+ \RN@tempdimb=\ifRN@print\paperheight\else\paperwidth\fi
+ \parbox[c][\RN@tempdima]{\RN@tempdimb}{%
+ \vfill
+ \centering
+ \RN@@title\par
+ \vfill
+ \usebox\RN@tempbox\par
+ \vfill
+ }%
+}
+
+\newcommand*\makeKalender[1][]{%
+ \pgfkeys{/CAL/.cd, default, #1}%
+ \setcounter{weeknumber}{0}%
+ \begingroup
+ \let\year=\RN@year
+ \InputIfFileExists{events\RN@year.tex}{}{}%
+ \endgroup
+ \sbox{\RN@pageI}{\RN@makeKalender{\RN@year-01-01}{\RN@year-06-30}}%
+ \sbox{\RN@pageII}{\RN@makeKalender{\RN@year-07-01}{\RN@year-12-31}}%
+ \ifRN@print
+ \rotatebox[origin=c]{90}{\usebox\RN@pageI}%
+ \else
+ \usebox\RN@pageI
+ \fi
+ \newpage
+ \ifRN@print
+ \rotatebox[origin=c]{-90}{\usebox\RN@pageII}%
+ \else
+ \usebox\RN@pageII
+ \fi
+}
+\setlength\parindent{0pt}
+\pagestyle{empty}
+\endinput