diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/pgf/contrib/tikz-kalender |
Initial commit
Diffstat (limited to 'graphics/pgf/contrib/tikz-kalender')
-rw-r--r-- | graphics/pgf/contrib/tikz-kalender/README.md | 87 | ||||
-rw-r--r-- | graphics/pgf/contrib/tikz-kalender/doc/Feiertage-2016.events | 18 | ||||
-rw-r--r-- | graphics/pgf/contrib/tikz-kalender/doc/Geburtstage.events | 8 | ||||
-rw-r--r-- | graphics/pgf/contrib/tikz-kalender/doc/Schulferien-2016.events | 9 | ||||
-rw-r--r-- | graphics/pgf/contrib/tikz-kalender/doc/Sonstiges.events | 4 | ||||
-rw-r--r-- | graphics/pgf/contrib/tikz-kalender/doc/Urlaub.events | 4 | ||||
-rw-r--r-- | graphics/pgf/contrib/tikz-kalender/doc/tikz-kalender-example1.pdf | bin | 0 -> 59519 bytes | |||
-rw-r--r-- | graphics/pgf/contrib/tikz-kalender/doc/tikz-kalender-example1.tex | 15 | ||||
-rw-r--r-- | graphics/pgf/contrib/tikz-kalender/doc/tikz-kalender-example2.pdf | bin | 0 -> 56787 bytes | |||
-rw-r--r-- | graphics/pgf/contrib/tikz-kalender/doc/tikz-kalender-example2.tex | 36 | ||||
-rw-r--r-- | graphics/pgf/contrib/tikz-kalender/tikz-kalender-translation.clo | 22 | ||||
-rw-r--r-- | graphics/pgf/contrib/tikz-kalender/tikz-kalender.cls | 384 |
12 files changed, 587 insertions, 0 deletions
diff --git a/graphics/pgf/contrib/tikz-kalender/README.md b/graphics/pgf/contrib/tikz-kalender/README.md new file mode 100644 index 0000000000..1d19e619b5 --- /dev/null +++ b/graphics/pgf/contrib/tikz-kalender/README.md @@ -0,0 +1,87 @@ +## A LaTeX based calendar using TikZ + +For usage see the example files »tikz-kalender-example1.tex«, +»tikz-kalender-example2.tex«, and »*.events«. 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 the package »tikz« and the tkiz libraries +»calc« and »calendar«. + +### Short Description + +#### Keys for the macro \setup + +`\setup[key1=value1,key2=value2,..]` + +##### General + +* `year=`_year of the calendar_ +* `yearText=`_text for the year_ (default: 4-digit current year) +* `title=`_title of the calendar_ +* `events=`_list of files with events or periods_ (without the ending `.events`) +* `showweeknumbers=`_true or empty or false_ (showing the number of the week) +* `lang=`_language for marking_ (option passed to package babel) +* `paper=`_papersize abbreviation_ (understandable by package geometry; +default: a4) +* `print=`_true or empty or false_ (printer-friendly orientation for +double-side printing; default: false) +* `xcoloroptions=`_options_ (passed to package xcolor; default: svgnames) + +##### Color definitions + +* `titleColor=...` (default: dark) +* `eventColor=...` (default: medium) +* `periodColor=...` (default: period) +* `monthBGcolor=...` (background; default: dark) +* `monthColor=...` (default: white) +* `workdayColor=...` +* `saturdayColor=...` (default: bright) +* `sundayColor=...` (default: medium) + +The default colors: + +* dark: `{HTML}{A57C00}` +* medium: `dark!35` +* bright: `dark!20` +* period: `gray!30` + +##### Font definitions + +* `titleFont=...` +* `yearFont=...` +* `monthFont=...` +* `dayFont=...` +* `dayNbFont=...` +* `weekNbFont=...` +* `eventFont=...` + +##### Examples + +* `titleFont={\fontsize{1.2em}{1.2em}}` +* `yearFont={\itshape}` +* `titleColor=IndianRed3` (required `xcoloroptions={x11names}`) + +#### Macros \event and \period inside of events files + +##### Examples + +* `\event{\year-10-09}{John Lennon (1940)}`; uncolored every year event + +* `\event*{2016-03-27}{Ostersonntag}`; event colored with the color defined +by the key `eventColor` (general holiday) + +* `\event*{2016-07-10}{Fußball-EM: Endspiel}[color=DarkTurquoise]`; +colored event with a special color + +* `\period{2016-12-23}{2017-01-03}`; period colored with the color defined +by the key `periodColor` + +* `\period{2016-02-01}{2016-02-06}[color=LightGreen]`; period colored with a +special color + +* `\period{2016-09-12}{2016-10-04}[color=red!30,name=Urlaub]`; named period +colored with a special color + +Rolf Niepraschk, 2018-04-01 diff --git a/graphics/pgf/contrib/tikz-kalender/doc/Feiertage-2016.events b/graphics/pgf/contrib/tikz-kalender/doc/Feiertage-2016.events new file mode 100644 index 0000000000..99be5b7aaa --- /dev/null +++ b/graphics/pgf/contrib/tikz-kalender/doc/Feiertage-2016.events @@ -0,0 +1,18 @@ + +% Jährlich wiederkehrende Termine sollten das Makro \year enthalten. +% Yearly events should contain the macro \year. + +\event*{\year-01-01}{Neujahr} +\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 deutschen Einheit} +\event{\year-12-24}{Heiligabend} +\event*{\year-12-25}{1. Weihnachtstag} +\event*{\year-12-26}{2. Weihnachtstag} + +\endinput diff --git a/graphics/pgf/contrib/tikz-kalender/doc/Geburtstage.events b/graphics/pgf/contrib/tikz-kalender/doc/Geburtstage.events new file mode 100644 index 0000000000..f15685f9fb --- /dev/null +++ b/graphics/pgf/contrib/tikz-kalender/doc/Geburtstage.events @@ -0,0 +1,8 @@ + +% Jährlich wiederkehrende Termine sollten das Makro \year enthalten. +% Yearly events should contain the macro \year. + +\event{\year-03-14}{Albert Einstein (1879)} +\event{\year-10-09}{John Lennon (1940)} + +\endinput diff --git a/graphics/pgf/contrib/tikz-kalender/doc/Schulferien-2016.events b/graphics/pgf/contrib/tikz-kalender/doc/Schulferien-2016.events new file mode 100644 index 0000000000..ba111846f2 --- /dev/null +++ b/graphics/pgf/contrib/tikz-kalender/doc/Schulferien-2016.events @@ -0,0 +1,9 @@ + +\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/graphics/pgf/contrib/tikz-kalender/doc/Sonstiges.events b/graphics/pgf/contrib/tikz-kalender/doc/Sonstiges.events new file mode 100644 index 0000000000..06f96d0f63 --- /dev/null +++ b/graphics/pgf/contrib/tikz-kalender/doc/Sonstiges.events @@ -0,0 +1,4 @@ + +\event*{2016-07-10}{Fußball-EM: Endspiel}[color=DarkTurquoise] + +\endinput diff --git a/graphics/pgf/contrib/tikz-kalender/doc/Urlaub.events b/graphics/pgf/contrib/tikz-kalender/doc/Urlaub.events new file mode 100644 index 0000000000..51fd4adbe4 --- /dev/null +++ b/graphics/pgf/contrib/tikz-kalender/doc/Urlaub.events @@ -0,0 +1,4 @@ + +\period{2016-09-12}{2016-10-04}[color=red!30,name=Urlaub] + +\endinput diff --git a/graphics/pgf/contrib/tikz-kalender/doc/tikz-kalender-example1.pdf b/graphics/pgf/contrib/tikz-kalender/doc/tikz-kalender-example1.pdf Binary files differnew file mode 100644 index 0000000000..67f3b893a1 --- /dev/null +++ b/graphics/pgf/contrib/tikz-kalender/doc/tikz-kalender-example1.pdf diff --git a/graphics/pgf/contrib/tikz-kalender/doc/tikz-kalender-example1.tex b/graphics/pgf/contrib/tikz-kalender/doc/tikz-kalender-example1.tex new file mode 100644 index 0000000000..9b3cd290eb --- /dev/null +++ b/graphics/pgf/contrib/tikz-kalender/doc/tikz-kalender-example1.tex @@ -0,0 +1,15 @@ +\listfiles +\documentclass{tikz-kalender} + +% a simple calender + +\setup{% +,year=2016 +,title={Termine} +,events={Schulferien-2016,Feiertage-2016,Geburtstage,Urlaub,Sonstiges} +} + +\begin{document} + \makeKalender +\end{document} + diff --git a/graphics/pgf/contrib/tikz-kalender/doc/tikz-kalender-example2.pdf b/graphics/pgf/contrib/tikz-kalender/doc/tikz-kalender-example2.pdf Binary files differnew file mode 100644 index 0000000000..6147347480 --- /dev/null +++ b/graphics/pgf/contrib/tikz-kalender/doc/tikz-kalender-example2.pdf diff --git a/graphics/pgf/contrib/tikz-kalender/doc/tikz-kalender-example2.tex b/graphics/pgf/contrib/tikz-kalender/doc/tikz-kalender-example2.tex new file mode 100644 index 0000000000..8b08e56618 --- /dev/null +++ b/graphics/pgf/contrib/tikz-kalender/doc/tikz-kalender-example2.tex @@ -0,0 +1,36 @@ +\listfiles + +\documentclass{tikz-kalender} + +% all options: +\setup{% +,lang=german% language for day names and month names; default: english +,paper=a0% papersize understandable by the geometry package; default: a4 +,year=2016% base of the calender calculation +,yearFont={\itshape}% additional font definition +,yearText={}%default: the content of the year option +,title={2016} +,titleFont={\fontsize{1.4em}{1.4em}}% ~140% of default +,titleColor=IndianRed3 +,showweeknumbers% default: false +,events={Geburtstage}% events and periods (files with ending ".events") +,print=true% printer-friendly orientation (double-side printing) +,xcoloroptions={x11names}% additional options; default: svgnames +%,monthFont% additional font definition +%,dayFont% additional font definition +%,dayNbFont% additional font definition +%,weekNbFont% additional font definition +%,eventFont% additional font definition +%,eventColor% additional font definition +%,periodColor% additional font definition +%,monthBGcolor% additional font definition +%,monthColor% additional font definition +%,workdayColor% additional font definition +%,saturdayColo% additional font definitionr +%,sundayColor% additional font definition +} + +\begin{document} + \makeKalender +\end{document} + diff --git a/graphics/pgf/contrib/tikz-kalender/tikz-kalender-translation.clo b/graphics/pgf/contrib/tikz-kalender/tikz-kalender-translation.clo new file mode 100644 index 0000000000..e119dfc6b1 --- /dev/null +++ b/graphics/pgf/contrib/tikz-kalender/tikz-kalender-translation.clo @@ -0,0 +1,22 @@ +\ProvidesFile{tikz-kalender-translation.clo}[2019/06/05 v1.0c + Calendar translations (RN)] + +% shorter strings than the default definitions + +\deftranslation[to=English]{Mon}{Mo}% Monday +\deftranslation[to=English]{Tue}{Tu}% Tuesday +\deftranslation[to=English]{Wed}{We}% Wednesday +\deftranslation[to=English]{Thu}{Th}% Thursday +\deftranslation[to=English]{Fri}{Fr}% Friday +\deftranslation[to=English]{Sat}{Sa}% Saturday +\deftranslation[to=English]{Sun}{Su}% Sunday + +\deftranslation[to=Polish]{Mon}{Po}% Poniedziałek +\deftranslation[to=Polish]{Tue}{Wt}% Wtorek +\deftranslation[to=Polish]{Wed}{\'{S}r}% Środa +\deftranslation[to=Polish]{Thu}{Cz}% Czwartek +\deftranslation[to=Polish]{Fri}{Pi}% Piątek +\deftranslation[to=Polish]{Sat}{So}% Sobota +\deftranslation[to=Polish]{Sun}{Ni}% Niedziela + +\endinput diff --git a/graphics/pgf/contrib/tikz-kalender/tikz-kalender.cls b/graphics/pgf/contrib/tikz-kalender/tikz-kalender.cls new file mode 100644 index 0000000000..cba4d247b1 --- /dev/null +++ b/graphics/pgf/contrib/tikz-kalender/tikz-kalender.cls @@ -0,0 +1,384 @@ +% +% 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{tikz-kalender}[2019/06/05 v0.4e Calendar class (RN)] + +\DeclareOption*{\OptionNotUsed} +\ProcessOptions\relax + +\newcommand*\RN@events@files{} +\newcommand*\RN@titleFont{} +\newcommand*\RN@yearFont{} +\newcommand*\RN@monthFont{} +\newcommand*\RN@dayFont{} +\newcommand*\RN@dayNbFont{} +\newcommand*\RN@weekNbFont{} +\newcommand*\RN@eventFont{} +\newcommand*\RN@normalFont{} +\newcommand*\RN@title{} +\newcommand*\RN@year{}\edef\RN@year{\the\numexpr\year} +\newcommand*\RN@yearText{\RN@year} +\newcommand*\RN@period@name{} +\newcommand*\RN@xcolorOptions{} +\newcommand*\RN@events@I{} +\newcommand*\RN@events@II{} +\newcommand*\RN@backgrounds{} +\newcommand*\RN@periods{} +\newcommand*\RN@tempa{} +\newcommand*\RN@tempb{} + +\newcommand*\RN@titleColor{dark} +\newcommand*\RN@eventColor{medium} +\newcommand*\RN@monthBGcolor{dark} +\newcommand*\RN@monthColor{white} +\newcommand*\RN@workdayColor{none} +\newcommand*\RN@saturdayColor{bright} +\newcommand*\RN@sundayColor{medium} +\newcommand*\RN@periodColor{period} + +\newcounter{weeknumber} +\newsavebox\RN@pageI +\newsavebox\RN@pageII +\newsavebox\RN@tempbox + +\newdimen\RN@xunit +\newdimen\RN@yunit +\newdimen\RN@calheight +\newdimen\RN@calwidth +\newdimen\RN@daywidth +\newdimen\RN@daysep +\newdimen\RN@dayheight +\newdimen\RN@eventwidthL +\newdimen\RN@eventwidthS + +\newif\ifRN@showweeknumbers \RN@showweeknumbersfalse +\newif\ifRN@print \RN@printfalse +\newif\ifRN@XeOrLua \RN@XeOrLuafalse +\RequirePackage{ifluatex,ifxetex} +\ifxetex\RN@XeOrLuatrue\else\ifluatex\RN@XeOrLuatrue\fi\fi + +\LoadClass{article} + +\RequirePackage{pgfkeys,etoolbox,ragged2e} + +\pgfkeys{ + /RN/.cd, + showweeknumbers/.is if = RN@showweeknumbers, + print/.is if = RN@print, + events/.store in=\RN@events@files, + titleFont/.store in=\RN@titleFont, + yearFont/.store in=\RN@yearFont, + monthFont/.store in=\RN@monthFont, + dayFont/.store in=\RN@dayFont, + dayNbFont/.store in=\RN@dayNbFont, + weekNbFont/.store in=\RN@weekNbFont, + eventFont/.store in=\RN@eventFont,% ??? + title/.store in=\RN@title, + year/.store in=\RN@year, + yearText/.store in=\RN@yearText, + titleColor/.store in=\RN@titleColor, + eventColor/.store in=\RN@eventColor, + periodColor/.store in=\RN@periodColor, + monthBGcolor/.store in=\RN@monthBGcolor, + monthColor/.store in=\RN@monthColor, + workdayColor/.store in=\RN@workdayColor, + saturdayColor/.store in=\RN@saturdayColor, + sundayColor/.store in=\RN@sundayColor, + xcoloroptions/.code={\PassOptionsToPackage{#1}{xcolor}}, + lang/.code={\PassOptionsToPackage{#1}{babel}% + \PassOptionsToPackage{#1}{translator}}, + paper/.code={\PassOptionsToPackage{#1paper}{geometry}} +} + +\newcommand*\setup[1]{\pgfqkeys{/RN}{#1}} + +\PassOptionsToPackage{a4paper}{geometry} +\PassOptionsToPackage{svgnames}{xcolor} + +\ifRN@XeOrLua + \RequirePackage{fontspec,unicode-math} + \setmathfont{latinmodern-math}[% + Extension=.otf,math-style=ISO,bold-style=ISO, + ] + \setsansfont{texgyreheros}[% + Extension=.otf,Ligatures=TeX, + UprightFont= *-regular, + BoldFont=*-bold, + ItalicFont=*-italic, + BoldItalicFont=*-bolditalic + ] +\else + \RequirePackage[T1]{fontenc} + \RequirePackage{textcomp} + \RequirePackage{lmodern} + \RequirePackage{tgheros} +\fi + +\renewcommand*\familydefault{\sfdefault} + +\AtEndPreamble{% "etoolbox" + \ifRN@print + \RequirePackage{graphicx} + \PassOptionsToPackage{portrait}{geometry} + \else + \PassOptionsToPackage{landscape}{geometry} + \fi + \RequirePackage[margin={0mm,0mm}]{geometry} + \ifRN@XeOrLua\else + \@ifpackageloaded{inputenc}{}{\RequirePackage[utf8]{inputenc}}% + \fi + \RequirePackage{babel,translator,tikz} + \@ifpackagelater{pgf}{2019/05/10}{}{% + \def\pgfutil@translate#1{\translate{#1}}% + % Correct the wrong definition in `pgfutil-latex.def' + }% + \input{tikz-kalender-translation.clo} + \usetikzlibrary{calendar} +} + +\AtBeginDocument{% + \definecolor{dark}{HTML}{A57C00} + \colorlet{medium}{dark!35} + \colorlet{bright}{dark!20} + \colorlet{period}{gray!30} + \RN@calwidth=\ifRN@print\paperheight\else\paperwidth\fi + \RN@calheight=\ifRN@print\paperwidth\else\paperheight\fi + \@tempcnta=\RN@calwidth + \divide\@tempcnta by \@M % + \RN@xunit=\@tempcnta sp % 0.0845pt (a4) + \@tempcnta=\RN@calheight + \divide\@tempcnta by \@M % + \RN@yunit=\@tempcnta sp % 0.05974pt (a4) + \RN@daywidth=1515\RN@xunit% 45mm (a4) + \RN@daysep=118\RN@xunit % 3.5mm (a4) + \RN@dayheight=192\RN@xunit% 5.7mm (a4) + \RN@setFont{RN@dayFont}{134}% 8pt (a4) + \RN@setFont{RN@dayNbFont}{167}% 10pt (a4) + \RN@setFont{RN@eventFont}{134}% 8pt (a4) + \RN@setFont[\normalfont]{RN@normalFont}{167}% 10pt (a4) + \RN@setFont{RN@weekNbFont}{134}% 8pt (a4) + \RN@setFont[\bfseries]{RN@monthFont}{167}% 10pt (a4) + \RN@setFont[\bfseries]{RN@titleFont}{666}% 40pt (a4) + \RN@setFont[\bfseries]{RN@yearFont}{1000}% 60pt (a4) + \RN@normalFont + \settowidth\@tempdima{\RN@formatDayNb{99}\RN@formatDay{0}}% + \RN@eventwidthL=\dimexpr\RN@daywidth-\@tempdima + \settowidth\@tempdima{\setcounter{weeknumber}{99}% + \RN@formatWeekNb{weeknumber}% + } + \RN@eventwidthS=\dimexpr\RN@eventwidthL-\@tempdima +} + +\pgfkeys{% + /RN/.is family, /RN, + period/.cd, + color/.estore in=\RN@periodColor, + name/.estore in=\RN@period@name +} +\pgfkeys{% + /RN/.is family, /RN, + event/.cd, + color/.estore in = \RN@eventColor +} + +\newcommand\RN@formatTitle[3]{% + \raisebox{-.3\height}{\parbox[b]{#1}{% + \color{\RN@titleColor}% + \makebox[0pt][l]{\RN@yearFont#2}\hfill + \RN@titleFont#3\hfill\mbox{}% + }}% +} +\newcommand*\RN@formatDayNb[1]{% + \RN@dayNbFont#1\hspace{50\RN@xunit}% +} +\newcommand*\RN@formatDay[1]{% + \RN@dayFont\pgfcalendarweekdayshortname{#1}% +} +\newcommand*\RN@formatWeekNb[1]{% + \hspace{30\RN@xunit}\RN@weekNbFont + \raisebox{.15ex}{[\raisebox{-.15ex}{\arabic{#1}}]}% + \hspace{20\RN@xunit}% +} +\newcommand*\RN@formatEvent[2]{% + \RN@eventFont + \def\RN@tempa{\strut#2}% + \settowidth\@tempdima{\mbox{\RN@tempa}}% + \ifdim\@tempdima>#1 % + \@tempdimb=\dimexpr\f@size pt % + \@tempdimb=.8\@tempdimb% + \def\RN@tempa{\fontsize{\@tempdimb}{1.1\@tempdimb}\selectfont#2}% + \fi + \makebox[-50\RN@xunit][r]{\raisebox{0.55\totalheight}[\totalheight]{% + \parbox[c]{#1}{\raggedleft\hskip\z@\RN@tempa}}}% \nointerlineskip +} + +\newcommand*\RN@setFont[3][]{% + \@tempdima=#3\RN@yunit \@tempdimb=1.2\@tempdima % + \expandafter\protected@edef\csname#2\endcsname{\noexpand\fontsize + {\the\@tempdima}{\the\@tempdimb}#1\csname#2\endcsname\noexpand\selectfont}% +} + +\newcommand*\period[2]{% + \@ifnextchar[{\RN@period@i{#1}{#2}}{\RN@period@i{#1}{#2}[]}% +} +\newcommand*\RN@period@i{} +\def\RN@period@i#1#2[#3]{% + \begingroup + \pgfkeys{/RN/period/.cd, #3}% + \edef\@tempa{% + \noexpand\ifdate{between=#1 and #2}{% + \noexpand\tikzset{every day/.style={fill=\RN@periodColor}}}{}% + }% + \expandafter\g@addto@macro\expandafter\RN@periods\expandafter{\@tempa}% + \ifx\RN@period@name\@empty\else + \pgfcalendar{}{#1}{#2}{% + \edef\RN@tempa{\pgfcalendarcurrentyear-\pgfcalendarcurrentmonth-% + \pgfcalendarcurrentday}% + \let\RN@event@ii=\RN@event@ii@orig% activate temporarily + % period name as event entry for event-less days + \event{\RN@tempa}{\RN@period@name}% + }% + \fi + \endgroup +} + +\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]{% + \begingroup + \pgfkeys{/RN/event/.cd, #3}% + \@tempdima=\RN@eventwidthL + \ifRN@showweeknumbers + \pgfcalendarifdate{#1}{Monday}{\@tempdima=\RN@eventwidthS}{}% + \fi + \@ifundefined{event@#1}{% + \expandafter\protected@xdef\csname event@#1\endcsname{#2}% + \protected@edef\@tempa{\noexpand\@ifundefined{pgf@sh@ns@cal-#1}{}{% + \noexpand\node[anchor=south west,inner sep=0pt] at (cal-#1.south east){% + \noexpand\RN@formatEvent{\the\@tempdima}{% + \noexpand\csname event@#1\endcsname}};% + } + }% + \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}}% + }{% + \expandafter\protected@xdef\csname event@#1\endcsname{% + #2, \csname event@#1\endcsname}% + } + \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 + \endgroup +} + +\let\RN@event@ii@orig=\RN@event@ii + +\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=\RN@dayheight,% + text width=\RN@daywidth,draw=black + ]{\RN@formatDayNb{\tikzdaytext}% + \RN@formatDay{\pgfcalendarcurrentweekday}% + \ifRN@showweeknumbers + \ifdate{Monday}{\stepcounter{weeknumber}% + \RN@formatWeekNb{weeknumber}}{}% + \fi}; + },% + execute before day scope={% + \ifdate{day of month=1}{% + \pgftransformxshift{\dimexpr\RN@daywidth+\RN@daysep}% + % Print month name + \draw (0,0)node [shape=rectangle,minimum height=\RN@dayheight,% + text width=\RN@daywidth,fill=\RN@monthBGcolor,% + draw=\RN@monthBGcolor,text=\RN@monthColor,text centered]{% + \RN@monthFont\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 + \RN@periods + %\RN@backgrounds + },% + execute at begin day scope={% + \pgftransformyshift{-\pgfcalendarcurrentday\RN@dayheight}% + }% + ];% + \pgfcalendarifdate{#1}{at most=06-last}{\RN@events@I}{\RN@events@II}% + \end{tikzpicture}% + }% + \parbox[c][\RN@calheight]{\RN@calwidth}{% + \vfill + \centering + \RN@formatTitle{\wd\RN@tempbox}{\RN@yearText}{\RN@title}% + \vfill + \usebox\RN@tempbox + \vfill + }% +} + +\newcommand*\makeKalender{% + \pgfcalendarifdate{\RN@year-01-01}{Tuesday,Wednesday,Thursday}{% + \setcounter{weeknumber}{1}}{\setcounter{weeknumber}{0}}% + \begingroup% + \let\year=\RN@year + \def\RN@event@ii##1##2[##3]{}% 1st loop: only the periods + \def\do##1{\InputIfFileExists{##1.events}{}{}}% + \expandafter\docsvlist\expandafter{\RN@events@files}% + \endgroup + \begingroup + \let\year=\RN@year + \def\RN@period@i##1##2[##3]{}% 2nd loop: only the events + \def\do##1{\InputIfFileExists{##1.events}{}{}}% + \expandafter\docsvlist\expandafter{\RN@events@files}% + \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 +%% +%% End of file `tikz-kalender.cls'. + + + + |