Schulkalendar generiert

This commit is contained in:
André Hilbig 2016-10-27 18:59:50 +02:00
parent c9b90c0dbe
commit f3537b469d
8 changed files with 385 additions and 4 deletions

70
calendar/calendar.tex Normal file
View file

@ -0,0 +1,70 @@
\renewcommand{\ferien}{%
% normal days are white
\tikzset{every day/.style={fill=white}}
% SOMMERFERIEN I
\ifdate{between=\jahrEins-08-1 and \jahrEins-08-29}{%
\tikzset{every day/.style={fill=gray!30}}}{}
% HERBST
\ifdate{between=\jahrEins-10-23 and \jahrEins-11-3}{%
\tikzset{every day/.style={fill=gray!30}}}{}
% WEIHNACHTEN
\ifdate{between=\jahrEins-12-27 and \jahrZwei-01-05}{%
\tikzset{every day/.style={fill=gray!30}}}{}
% OSTERN
\ifdate{between=\jahrZwei-03-26 and \jahrZwei-04-06}{%
\tikzset{every day/.style={fill=gray!30}}}{}
% PFINGSTEN
\ifdate{between=\jahrZwei-05-22 and \jahrZwei-05-25}{%
\tikzset{every day/.style={fill=gray!30}}}{}
% SOMMERFERIEN II
\ifdate{between=\jahrZwei-07-16 and \jahrZwei-08-28}{%
\tikzset{every day/.style={fill=gray!30}}}{}
}
\renewcommand{\feiertage}{%
% Saturdays and half holidays (Christma's and New year's eve)
\ifdate{equals=12-24}{\tikzset{every day/.style={fill=red!10}}}{}
\ifdate{equals=12-31}{\tikzset{every day/.style={fill=red!10}}}{}
% Sundays and full holidays
\ifdate{equals=01-01}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=01-06}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=05-01}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=10-03}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=11-01}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=12-25}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=12-26}{\tikzset{every day/.style={fill=red!20}}}{}
% Christian holidays
\ifdate{equals=\jahrZwei-03-30}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=\jahrZwei-04-02}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=\jahrZwei-05-20}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=\jahrZwei-05-21}{\tikzset{every day/.style={fill=red!20}}}{}
% \ifdate{equals=\jahrZwei-05-30}{\tikzset{every day/.style={fill=red!20}}}{}
}
\renewcommand{\termine}{%
\ifthenelse{\boolean{schulkalendarSeiteOne}}{%
% Print name of Holidays
\termin{\jahrEins-11-01}{Allerheiligen}
\termin{\jahrEins-12-24}{Heiligabend}
\termin{\jahrEins-12-25}{1.\,Weihnachtsfeiertag}
\termin{\jahrEins-12-26}{2.\,Weihnachtsfeiertag}
\termin{\jahrZwei-01-01}{Neujahr}
\termin{\jahrZwei-01-06}{Heilige Drei Könige}
}{%
\termin{\jahrZwei-05-01}{Tag der Arbeit}
\termin{\jahrZwei-03-30}{Karfreitag}
\termin{\jahrZwei-04-01}{Ostersonntag}
\termin{\jahrZwei-04-02}{Ostermontag}
%\termin{2013-05-09}{Christi Himmelfahrt}
\termin{\jahrZwei-05-20}{Pfingstsonntag}
\termin{\jahrZwei-05-21}{Pfingstmontag}
%\termin{2013-05-30}{Fronleichnam}
}
}
\begin{schulkalendar}{Schulkalendar}
\schulkal{\jahrEins-08-01 to \jahrZwei-01-31}{first}
\schulkal{\jahrZwei-02-01 to \jahrZwei-07-31}{second}
\end{schulkalendar}

View file

@ -1,7 +1,7 @@
% ALLGEMEINE OPTIONEN
% SPEZIFISCHE OPTIONEN
\schuljahr{2015/2016}
\schuljahr{2017}{2018}
\logoFront{ABB/logoFront.pdf}
% SEZIFISCHE DATEN SCHULE

Binary file not shown.

View file

@ -1,4 +1,4 @@
\documentclass[a4paper,11pt,titlepage]{scrbook}
\documentclass[a4paper,11pt,titlepage,ngerman]{scrbook}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
@ -46,7 +46,7 @@
\front
\maketitle
Terminplaner
\input{calendar/calendar.tex}
\tableofcontents

View file

@ -61,3 +61,84 @@
\addcontentsline{toc}{chapter}{Wochenübersichten}
\input{#2}
}
% User defined
\providecommand{\ferien}{}
\providecommand{\feiertage}{}
\providecommand{\termine}{}
\newenvironment{schulkalendar}[2][top=0.5cm,bottom=0.5cm,outer=1.5cm]{%
\newgeometry{#1}
\pagestyle{empty}
\addcontentsline{toc}{chapter}{#2}
\newboolean{schulkalendarSeiteOne}
\setboolean{schulkalendarSeiteOne}{true}
\newcommand{\calName}{}
}{%
\restoregeometry
\pagestyle{scrheadings}
}
\providecommand{\schulkal}[3][0.96]{%
\rotatebox{90}{%
\scalebox{#1}{%
\begin{tikzpicture}[every day/.style={anchor = north}]
\ifthenelse{\boolean{schulkalendarSeiteOne}}{%
\renewcommand{\calName}{first}
}{%
\renewcommand{\calName}{scnd}
}
\calendar[%
dates=#2,
name=\calName,
day yshift = 3em,
day code=
{
\node[name=\pgfcalendarsuggestedname,every day,shape=rectangle,
minimum height= .53cm, text width = 4.4cm, draw = gray]{\tikzdaytext};
\draw (-1.8cm, -.1ex) node[anchor = west]{\footnotesize%
\pgfcalendarweekdayshortname{\pgfcalendarcurrentweekday}};
},
execute before day scope=
{
\ifdate{day of month=1}
{
% Shift right
\pgftransformxshift{4.8cm}
% Print month name
\draw (0,0)node [shape=rectangle, minimum height= .53cm,
text width = 4.4cm, fill = red, text= white, draw = red, text centered]
{\textbf{\pgfcalendarmonthname{\pgfcalendarcurrentmonth}}};
}{}
\ifdate{workday}
{
\ferien
}{}
\ifdate{Saturday}{\tikzset{every day/.style={fill=red!10}}}{}
\ifdate{Sunday}{\tikzset{every day/.style={fill=red!20}}}{}
\feiertage
},
execute at begin day scope=
{
% each day is shifted down according to the day of month
\pgftransformyshift{-.53*\pgfcalendarcurrentday cm}
}
];
\termine
\end{tikzpicture}
}
}
\setboolean{schulkalendarSeiteOne}{false}
\clearpage
}
% Names of Holidays are inserted by employing this macro
\providecommand{\termin}[3][]{
\ifthenelse{\boolean{schulkalendarSeiteOne}}{%
\node [anchor=north west, text width= 3.4cm] at
($(first-#2.north west)+(3em, 0em)$) {\tiny{#3}};
}{%
\node [anchor=north west, text width= 3.4cm] at
($(scnd-#2.north west)+(3em, 0em)$) {\tiny{#3}};
}
}

View file

@ -9,7 +9,13 @@
% SPEZIFISCHE OPTIONEN
\providecommand{\Schuljahr}{--}
\providecommand{\schuljahr}[1]{\renewcommand{\Schuljahr}{#1}}
\providecommand{\jahrEins}{2015}
\providecommand{\jahrZwei}{2016}
\providecommand{\schuljahr}[2]{%
\renewcommand{\Schuljahr}{#1/#2}
\renewcommand{\jahrEins}{#1}
\renewcommand{\jahrZwei}{#2}
}
\providecommand{\LogoFront}{ABB/logoFront.pdf}
\providecommand{\logoFront}[1]{\renewcommand{\LogoFront}{#1}}

View file

@ -1,8 +1,14 @@
\RequirePackage{tcolorbox}
\tcbuselibrary{skins,breakable}
\RequirePackage{translator} % German Month and Day names
\usetikzlibrary{calc}
\usetikzlibrary{calendar}
\RequirePackage[nolinks]{qrcode}
\RequirePackage{eurosym}
\RequirePackage{pdflscape}
% wegen listings
\RequirePackage{scrhack}

View file

@ -0,0 +1,218 @@
% DIN-A4 doublesided year calendar
% Author: Robert Krause
% License : Creative Commons attribution license
% Submitted to TeXample.net on 13 July 2012
\documentclass[landscape,a4paper, ngerman, 10pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{tikz} % Use the calendar.sty style
\usepackage{translator} % German Month and Day names
\usepackage{fancyhdr} % header and footer
\usepackage{fix-cm} % Large year in header
\usepackage[landscape, headheight = 2cm, margin=.5cm,
top = 3.2cm, nofoot]{geometry}
\usetikzlibrary{calc}
\usetikzlibrary{calendar}
%%%<
\usepackage{verbatim}
\usepackage[tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{5pt}%
%%%>
\begin{comment}
:Title: A calender for doublesided DIN-A4
Tags: Calendar library;Calendars
:Author: Robert Krause
An example how the calendar package can be used to provide
an doublesided calendar for the whole year.
\end{comment}
\renewcommand*\familydefault{\sfdefault}
% User defined
\def\year{2013}
% Names of Holidays are inserted by employing this macro
\def\termin#1#2{
\node [anchor=north west, text width= 3.4cm] at
($(cal-#1.north west)+(3em, 0em)$) {\tiny{#2}};
}
%Header
\renewcommand{\headrulewidth}{0.0pt}
\setlength{\headheight}{10ex}
\chead{
\fontsize{60}{70}\selectfont\textbf{\year}
\Large\textbf{Ferienkalender}\hfill
}
%Footer
\cfoot{\footnotesize\texttt{http://www.texample.net/}}
\begin{document}
\pagestyle{fancy}
\begin{center}
\begin{tikzpicture}[every day/.style={anchor = north}]
\calendar[
dates=\year-01-01 to \year-06-30,
name=cal,
day yshift = 3em,
day code=
{
\node[name=\pgfcalendarsuggestedname,every day,shape=rectangle,
minimum height= .53cm, text width = 4.4cm, draw = gray]{\tikzdaytext};
\draw (-1.8cm, -.1ex) node[anchor = west]{\footnotesize%
\pgfcalendarweekdayshortname{\pgfcalendarcurrentweekday}};
},
execute before day scope=
{
\ifdate{day of month=1}
{
% Shift right
\pgftransformxshift{4.8cm}
% Print month name
\draw (0,0)node [shape=rectangle, minimum height= .53cm,
text width = 4.4cm, fill = red, text= white, draw = red, text centered]
{\textbf{\pgfcalendarmonthname{\pgfcalendarcurrentmonth}}};
}{}
\ifdate{workday}
{
% normal days are white
\tikzset{every day/.style={fill=white}}
% Vacation (Germany, Baden-Wuerrtemberg) gray background
\ifdate{between=2012-12-24 and 2013-01-05}{%
\tikzset{every day/.style={fill=gray!30}}}{}
\ifdate{between=2013-03-25 and 2013-04-05}{%
\tikzset{every day/.style={fill=gray!30}}}{}
\ifdate{between=2013-05-21 and 2013-06-01}{%
\tikzset{every day/.style={fill=gray!30}}}{}
\ifdate{between=2013-07-25 and 2013-09-07}{%
\tikzset{every day/.style={fill=gray!30}}}{}
\ifdate{between=2013-10-28 and 2013-10-30}{%
\tikzset{every day/.style={fill=gray!30}}}{}
\ifdate{between=2013-12-23 and 2014-01-04}{%
\tikzset{every day/.style={fill=gray!30}}}{}
}{}
% Saturdays and half holidays (Christma's and New year's eve)
\ifdate{Saturday}{\tikzset{every day/.style={fill=red!10}}}{}
\ifdate{equals=12-24}{\tikzset{every day/.style={fill=red!10}}}{}
\ifdate{equals=12-31}{\tikzset{every day/.style={fill=red!10}}}{}
% Sundays and full holidays
\ifdate{Sunday}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=01-01}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=01-06}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=05-01}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=10-03}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=11-01}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=12-25}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=12-26}{\tikzset{every day/.style={fill=red!20}}}{}
% Christian holidays
\ifdate{equals=2013-03-29}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=2013-04-01}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=2013-05-09}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=2013-05-20}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=2013-05-30}{\tikzset{every day/.style={fill=red!20}}}{}
},
execute at begin day scope=
{
% each day is shifted down according to the day of month
\pgftransformyshift{-.53*\pgfcalendarcurrentday cm}
}
];
% Print name of Holidays
\termin{\year-01-01}{Neujahr}
\termin{\year-01-06}{Heilige Drei Könige}
\termin{2013-03-29}{Karfreitag}
\termin{2013-03-31}{Ostersonntag}
\termin{2013-04-01}{Ostermontag}
\termin{\year-05-01}{Tag der Arbeit}
\termin{2013-05-09}{Christi Himmelfahrt}
\termin{2013-05-19}{Pfingstsonntag}
\termin{2013-05-20}{Pfingstmontag}
\termin{2013-05-30}{Fronleichnam}
\end{tikzpicture}
% Repeat the whole thing for the second page
\pagebreak
\begin{tikzpicture}[every day/.style={anchor = north}]
\calendar[dates=\year-07-01 to \year-12-31,
name=cal,
day yshift = 3em,
day code=
{
\node[name=\pgfcalendarsuggestedname,every day,shape=rectangle,
minimum height= .53cm, text width = 4.4cm, draw = gray]{\tikzdaytext};
\draw (-1.8cm, -.1ex) node[anchor = west]
{
\footnotesize\pgfcalendarweekdayshortname{\pgfcalendarcurrentweekday}
};
},
execute before day scope=
{
\ifdate{day of month=1} {
% Shift right
\pgftransformxshift{4.8cm}
% Print month name
\draw (0,0)node [shape=rectangle, minimum height= .53cm,
text width = 4.4cm, fill = red, text= white, draw = red, text centered]
{
\textbf{\pgfcalendarmonthname{\pgfcalendarcurrentmonth}}
};
}{}
\ifdate{workday}
{
\tikzset{every day/.style={fill=white}}
% Vacation (Germany Baden-Wuerrtemberg)
\ifdate{between=2012-12-24 and 2013-01-05}{%
\tikzset{every day/.style={fill=gray!30}}}{}
\ifdate{between=2013-03-25 and 2013-04-05}{%
\tikzset{every day/.style={fill=gray!30}}}{}
\ifdate{between=2013-05-21 and 2013-06-01}{%
\tikzset{every day/.style={fill=gray!30}}}{}
\ifdate{between=2013-07-25 and 2013-09-07}{%
\tikzset{every day/.style={fill=gray!30}}}{}
\ifdate{between=2013-10-28 and 2013-10-30}{%
\tikzset{every day/.style={fill=gray!30}}}{}
\ifdate{between=2013-12-23 and 2014-01-04}{%
\tikzset{every day/.style={fill=gray!30}}}{}
}{}
% Saturdays and half holidays (Christma's and New year's eve)
\ifdate{Saturday}{\tikzset{every day/.style={fill=red!10}}}{}
\ifdate{equals=12-24}{\tikzset{every day/.style={fill=red!10}}}{}
\ifdate{equals=12-31}{\tikzset{every day/.style={fill=red!10}}}{}
% Sundays and full holidays
\ifdate{Sunday}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=01-01}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=01-06}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=05-01}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=10-03}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=11-01}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=12-25}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=12-26}{\tikzset{every day/.style={fill=red!20}}}{}
% Christian holidays
\ifdate{equals=2013-03-29}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=2013-04-01}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=2013-05-09}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=2013-05-20}{\tikzset{every day/.style={fill=red!20}}}{}
\ifdate{equals=2013-05-30}{\tikzset{every day/.style={fill=red!20}}}{}
},
execute at begin day scope=
{
% Each day is shifted down according to the day of month
\pgftransformyshift{-.53*\pgfcalendarcurrentday cm}
}
];
% Holidaynames
\termin{\year-10-03}{Tag der deutschen Einheit}
\termin{\year-11-01}{Allerheiligen}
\termin{\year-12-24}{Heilig Abend}
\termin{\year-12-25}{1.\ Weihnachtsfeiertag}
\termin{\year-12-26}{2.\ Weihnachtsfeiertag}
\termin{\year-12-31}{Silvester}
\end{tikzpicture}
\end{center}
\end{document}