11 changed files with 758 additions and 349 deletions
-
108booklet_auto.tex
-
62combine.tex
-
36combine2.tex
-
82combine_a7.tex
-
137dates.py
-
101run_1week.py
-
144run_2weeks.py
-
6umlauts.py
-
24vorlagen/week_2pages.tex
-
335vorlagen/week_2pages_start.tex
-
72yearly_view.py
@ -0,0 +1,108 @@ |
|||||
|
\documentclass[a4paper,landscape]{article} |
||||
|
\usepackage{geometry} |
||||
|
|
||||
|
\pagestyle{empty} |
||||
|
|
||||
|
\usepackage{xparse} |
||||
|
\usepackage{graphicx} |
||||
|
\usepackage{tikz} |
||||
|
\usetikzlibrary{calc} |
||||
|
\tikzset{ |
||||
|
every node/.style = { |
||||
|
inner sep = 0pt, |
||||
|
anchor = north west, |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
\ExplSyntaxOn |
||||
|
|
||||
|
\int_new:N \l_impose_repetitions_int |
||||
|
\int_new:N \l_impose_counter_int |
||||
|
\dim_new:N \l_impose_creep_dim |
||||
|
\int_new:N \l_impose_total_pages_int |
||||
|
\int_new:N \l_impose_total_pages_to_four_int |
||||
|
|
||||
|
\cs_new:Npn \impose_get_page:nn #1#2 { |
||||
|
\int_compare:nT { ( #1 ) <= \l_impose_total_pages_int } { |
||||
|
\includegraphics [ |
||||
|
width = 0.5\paperwidth, |
||||
|
page = #1, |
||||
|
] { #2 } |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
\NewDocumentCommand { \MakeBooklet } { O{0mm} m } { |
||||
|
\int_zero:N \l_impose_counter_int |
||||
|
\dim_zero:N \l_impose_creep_dim |
||||
|
\pdfximage { #2 .pdf } |
||||
|
\int_set:Nn \l_impose_total_pages_int |
||||
|
{ \the \pdflastximagepages } |
||||
|
\int_compare:nTF { \int_mod:nn { \l_impose_total_pages_int } { 4 } != 0 } { |
||||
|
\int_set:Nn \l_impose_total_pages_to_four_int |
||||
|
{ \l_impose_total_pages_int + 4 - \int_mod:nn { \l_impose_total_pages_int } { 4 } } |
||||
|
} { |
||||
|
\int_set_eq:NN \l_impose_total_pages_to_four_int \l_impose_total_pages_int |
||||
|
} |
||||
|
\int_set:Nn \l_impose_repetitions_int |
||||
|
{ \l_impose_total_pages_to_four_int / 2 } |
||||
|
\int_do_while:nn { \l_impose_counter_int < \l_impose_repetitions_int } { |
||||
|
\clearpage |
||||
|
\int_incr:N \l_impose_counter_int |
||||
|
\begin{tikzpicture}[remember~picture, overlay] |
||||
|
\node at ($ |
||||
|
(current~page.north) |
||||
|
- |
||||
|
(\dim_use:N \l_impose_creep_dim, 0) |
||||
|
$) { |
||||
|
\impose_get_page:nn |
||||
|
{ \int_use:N \l_impose_counter_int } |
||||
|
{ #2 } |
||||
|
}; |
||||
|
\node at ($ |
||||
|
(current~page.north~west) |
||||
|
+ |
||||
|
(\dim_use:N \l_impose_creep_dim, 0) |
||||
|
$) { |
||||
|
\impose_get_page:nn |
||||
|
{ \int_eval:n { \l_impose_total_pages_to_four_int - \l_impose_counter_int + 1 } } |
||||
|
{ #2 } |
||||
|
}; |
||||
|
\end{tikzpicture} |
||||
|
\clearpage |
||||
|
\int_incr:N \l_impose_counter_int |
||||
|
\begin{tikzpicture}[remember~picture, overlay] |
||||
|
\node at ($ |
||||
|
(current~page.north~west) |
||||
|
+ |
||||
|
(\dim_use:N \l_impose_creep_dim, 0) |
||||
|
$) { |
||||
|
\impose_get_page:nn |
||||
|
{ \int_use:N \l_impose_counter_int } |
||||
|
{ #2 } |
||||
|
}; |
||||
|
\node at ($ |
||||
|
(current~page.north) |
||||
|
- |
||||
|
(\dim_use:N \l_impose_creep_dim, 0) |
||||
|
$) { |
||||
|
\impose_get_page:nn |
||||
|
{ \int_eval:n { \l_impose_total_pages_to_four_int - \l_impose_counter_int + 1 } } |
||||
|
{ #2 } |
||||
|
}; |
||||
|
\end{tikzpicture} |
||||
|
\dim_set:Nn \l_impose_creep_dim { |
||||
|
#1 * \l_impose_counter_int / 2 |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
\ExplSyntaxOff |
||||
|
|
||||
|
|
||||
|
\begin{document} |
||||
|
|
||||
|
% #1 = Verschiebung pro Bogen (optional) |
||||
|
% #2 = Dateiname (ohne Endung!). Datei muss eine PDF sein! |
||||
|
\MakeBooklet[0.24mm]{calender} |
||||
|
|
||||
|
\end{document} |
@ -0,0 +1,62 @@ |
|||||
|
|
||||
|
\documentclass{article} |
||||
|
\usepackage{pdfpages} % for \includepdf[pages=-] |
||||
|
|
||||
|
\begin{document} |
||||
|
\includepdf[pages={107,1}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={2,106}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={105,3}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={4,104}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={103,5}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={6,102}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={101,7}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={8,100}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={99,9}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={10,98}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={97,11}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={12,96}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={95,13}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={14,94}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={93,15}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={16,92}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={91,17}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={18,90}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={89,19}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={20,88}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={87,21}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={22,86}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={85,23}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={24,84}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={83,25}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={26,82}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={81,27}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={28,80}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={79,29}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={30,78}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={77,31}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={32,76}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={75,33}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={34,74}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={73,35}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={36,72}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={71,37}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={38,70}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={69,39}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={40,68}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={67,41}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={42,66}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={65,43}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={44,64}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={63,45}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={46,62}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={61,47}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={48,60}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={59,49}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={50,58}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={57,51}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={52,56}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={55,53}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
\includepdf[pages={54,54}, nup=1x2,landscape=true]{calender.pdf} |
||||
|
|
||||
|
\end{document} |
||||
|
|
@ -0,0 +1,36 @@ |
|||||
|
|
||||
|
\documentclass{article} |
||||
|
\usepackage{pdfpages} % for \includepdf[pages=-] |
||||
|
|
||||
|
\begin{document} |
||||
|
\includepdf[pages={1,3}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={2,4}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={5,7}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={6,8}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={9,11}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={10,12}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={13,15}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={14,16}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={17,19}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={18,20}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={21,23}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={22,24}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={25,27}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={26,28}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={29,31}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={30,32}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={33,35}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={34,36}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={37,39}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={38,40}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={41,43}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={42,44}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={45,47}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={46,48}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={49,51}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={50,52}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={53,54}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
\includepdf[pages={54,54}, nup=1x2,landscape=false]{combine.pdf} |
||||
|
|
||||
|
\end{document} |
||||
|
|
@ -0,0 +1,82 @@ |
|||||
|
\documentclass[a4paper]{article} |
||||
|
\usepackage{geometry} |
||||
|
|
||||
|
\pagestyle{empty} |
||||
|
\usepackage{pdfpages} % for \includepdf[pages=-] |
||||
|
\usepackage{xparse} |
||||
|
\usepackage{graphicx} |
||||
|
\usepackage{tikz} |
||||
|
\usetikzlibrary{calc} |
||||
|
\tikzset{ |
||||
|
every node/.style = { |
||||
|
inner sep = 0pt, |
||||
|
anchor = north west, |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
\ExplSyntaxOn |
||||
|
|
||||
|
\int_new:N \l_impose_repetitions_int |
||||
|
\int_new:N \l_impose_counter_int |
||||
|
\dim_new:N \l_impose_creep_dim |
||||
|
\int_new:N \l_impose_total_pages_int |
||||
|
\int_new:N \l_impose_total_pages_to_four_int |
||||
|
|
||||
|
\cs_new:Npn \impose_get_page:nn #1#2#3 { |
||||
|
\int_compare:nT { ( #1 ) <= \l_impose_total_pages_int} { |
||||
|
\int_compare:nT { ( #2 ) <= \l_impose_total_pages_int} { |
||||
|
\includepdf[pages={#1,#2 }, nup=1x2,landscape=false]{#3} |
||||
|
%#1 , #2 \newline |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
\NewDocumentCommand { \MakeBooklet } { O{0mm} m } { |
||||
|
\int_zero:N \l_impose_counter_int |
||||
|
\dim_zero:N \l_impose_creep_dim |
||||
|
\pdfximage { #2 .pdf } |
||||
|
\int_set:Nn \l_impose_total_pages_int |
||||
|
{ \the \pdflastximagepages } |
||||
|
\int_compare:nTF { \int_mod:nn { \l_impose_total_pages_int } { 4 } != 0 } { |
||||
|
\int_set:Nn \l_impose_total_pages_to_four_int |
||||
|
{ \l_impose_total_pages_int + 4 - \int_mod:nn { \l_impose_total_pages_int } { 4 } } |
||||
|
} { |
||||
|
\int_set_eq:NN \l_impose_total_pages_to_four_int \l_impose_total_pages_int |
||||
|
} |
||||
|
\int_set:Nn \l_impose_repetitions_int |
||||
|
{ \l_impose_total_pages_to_four_int / 4 } |
||||
|
\int_do_while:nn { \l_impose_counter_int < \l_impose_repetitions_int } { |
||||
|
\clearpage |
||||
|
\int_incr:N \l_impose_counter_int |
||||
|
|
||||
|
|
||||
|
\impose_get_page:nn |
||||
|
{ \int_eval:n {(\l_impose_counter_int-1)*4 + 1} } |
||||
|
{ \int_eval:n {(\l_impose_counter_int-1)*4 + 3} } |
||||
|
{ #2 }\newpage |
||||
|
|
||||
|
\impose_get_page:nn |
||||
|
{ \int_eval:n {(\l_impose_counter_int-1)*4 + 2} } |
||||
|
{ \int_eval:n {(\l_impose_counter_int-1)*4 + 4} } |
||||
|
{ #2 }\newpage |
||||
|
|
||||
|
%\includepdf[pages={1,3}, nup=1x2,landscape=false]{#2} |
||||
|
%\includepdf[pages={2,4}, nup=1x2,landscape=false]{#2} |
||||
|
|
||||
|
|
||||
|
\dim_set:Nn \l_impose_creep_dim { |
||||
|
#1 * \l_impose_counter_int / 2 |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
\ExplSyntaxOff |
||||
|
|
||||
|
|
||||
|
\begin{document} |
||||
|
|
||||
|
% #1 = Verschiebung pro Bogen (optional) |
||||
|
% #2 = Dateiname (ohne Endung!). Datei muss eine PDF sein! |
||||
|
\MakeBooklet[0.24mm]{booklet_auto} |
||||
|
|
||||
|
\end{document} |
@ -0,0 +1,137 @@ |
|||||
|
from datetime import timedelta |
||||
|
from datetime import date |
||||
|
|
||||
|
from umlauts import escape_german_umlauts |
||||
|
|
||||
|
dates_color = { |
||||
|
"birthdays": "green!50!black", |
||||
|
"specialdays": "green!50!white", |
||||
|
"freedays": "red!50!white", |
||||
|
"holidays": "blue!50!green", |
||||
|
} |
||||
|
|
||||
|
dates = { |
||||
|
"birthdays": [ |
||||
|
{ "date": "13.01", "title": "Astrid Schönberger" }, |
||||
|
{ "date": "23.01", "title": "David Geiser" }, |
||||
|
{ "date": "27.09", "title": "Monika Voigt"}, |
||||
|
{ "date": "05.10", "title": "Franziska Geiser"}, |
||||
|
{ "date": "18.10", "title": "Theresa Schönberger" }, |
||||
|
{ "date": "13.11", "title": "Winfried Voigt"}, |
||||
|
{ "date": "14.11", "title": "Philipp Schönberer" }, |
||||
|
{ "date": "18.12", "title": "Ursula Donn"}, |
||||
|
{ "date": "12.05", "title": "Felix Maximilian Schönberger"}, |
||||
|
], |
||||
|
"specialdays": [ |
||||
|
{ "date": "05.10", "title": "Obermegaknutztag" }, |
||||
|
{ "date": "10.05", "title": "Hochzeitstag" }, |
||||
|
], |
||||
|
"holidays": [ |
||||
|
{ "date-start": "23.12.2019", "date-end": "04.01.2020", "title": "Weihnachtsferien" }, |
||||
|
#ferien 2020 bw |
||||
|
{ "date-start": "06.04.2020", "date-end": "18.04.2020", "title": "Osterferien" }, |
||||
|
{ "date-start": "02.06.2020", "date-end": "13.06.2020", "title": "Pfingstferien"}, |
||||
|
{ "date-start": "30.07.2020", "date-end": "12.09.2020", "title": "Sommerferien"}, |
||||
|
{ "date-start": "26.10.2020", "date-end": "30.10.2020", "title": "Herbstferien"}, |
||||
|
{ "date-start": "23.12.2020", "date-end": "09.01.2021", "title": "Weihnachtsferien"}, |
||||
|
|
||||
|
#ferien 2021 bw |
||||
|
{ "date-start": "06.04.2021", "date-end": "10.04.2021", "title": "Osterferien" }, |
||||
|
{ "date-start": "25.05.2021", "date-end": "06.06.2021", "title": "Pfingstferien"}, |
||||
|
{ "date-start": "29.07.2021", "date-end": "12.09.2021", "title": "Sommerferien"}, |
||||
|
{ "date-start": "30.10.2021", "date-end": "07.11.2021", "title": "Herbstferien"}, |
||||
|
{ "date-start": "23.12.2021", "date-end": "09.01.2022", "title": "Weihnachtsferien"}, |
||||
|
|
||||
|
#ferien 2022 bw |
||||
|
{ "date-start": "14.04.2022", "date-end": "23.04.2022", "title": "Osterferien" }, |
||||
|
{ "date-start": "07.06.2022", "date-end": "18.06.2022", "title": "Pfingstferien"}, |
||||
|
{ "date-start": "28.07.2022", "date-end": "10.09.2022", "title": "Sommerferien"}, |
||||
|
{ "date-start": "31.10.2022", "date-end": "04.11.2022", "title": "Herbstferien"}, |
||||
|
{ "date-start": "21.12.2022", "date-end": "07.01.2022", "title": "Weihnachtsferien"}, |
||||
|
|
||||
|
#ferien 2023 bw |
||||
|
{ "date-start": "06.04.2022", "date-end": "15.04.2022", "title": "Osterferien" }, |
||||
|
{ "date-start": "30.05.2022", "date-end": "09.06.2022", "title": "Pfingstferien"}, |
||||
|
{ "date-start": "27.07.2022", "date-end": "09.09.2022", "title": "Sommerferien"}, |
||||
|
{ "date-start": "30.10.2022", "date-end": "03.11.2022", "title": "Herbstferien"}, |
||||
|
{ "date-start": "23.12.2022", "date-end": "05.01.2022", "title": "Weihnachtsferien"}, |
||||
|
], |
||||
|
"freedays": [ |
||||
|
{ "date": "01.01", "title": "Neujahr" }, |
||||
|
{ "date": "06.01", "title": "Heilige Drei Könige" }, |
||||
|
{ "date": "01.05", "title": "Tag der Arbeit" }, |
||||
|
{ "date": "03.10", "title": "Tag der Deutschen Einheit"}, |
||||
|
{ "date": "01.11", "title": "Allerheiligen" }, |
||||
|
{ "date": "24.12", "title": "Weihnachtten" }, |
||||
|
{ "date": "25.12", "title": "1. Weihnachtsfeiertag" }, |
||||
|
{ "date": "26.12", "title": "2. Weihnachtsfeiertag" }, |
||||
|
{ "date": "31.12", "title": "Silvester" }, |
||||
|
|
||||
|
#free 2021 bw |
||||
|
{ "date": "02.04.2021", "title": "Karfreitag" }, |
||||
|
{ "date": "05.04.2021", "title": "Ostermontag" }, |
||||
|
{ "date": "13.05.2021", "title": "Christi Himmelfahrt" }, |
||||
|
{ "date": "24.05.2021", "title": "Pfingstmontag" }, |
||||
|
{ "date": "03.06.2021", "title": "Fronleichnam" }, |
||||
|
|
||||
|
#free 2022 bw |
||||
|
{ "date": "15.04.2022", "title": "Karfreitag" }, |
||||
|
{ "date": "18.04.2022", "title": "Ostermontag" }, |
||||
|
{ "date": "26.05.2022", "title": "Christi Himmelfahrt" }, |
||||
|
{ "date": "06.06.2022", "title": "Pfingstmontag" }, |
||||
|
{ "date": "16.06.2022", "title": "Fronleichnam" }, |
||||
|
|
||||
|
#free 2023 bw |
||||
|
{ "date": "07.04.2022", "title": "Karfreitag" }, |
||||
|
{ "date": "10.04.2022", "title": "Ostermontag" }, |
||||
|
{ "date": "18.05.2022", "title": "Christi Himmelfahrt" }, |
||||
|
{ "date": "29.05.2022", "title": "Pfingstmontag" }, |
||||
|
{ "date": "08.06.2022", "title": "Fronleichnam" }, |
||||
|
], |
||||
|
} |
||||
|
|
||||
|
def get_special_text(date_to_check, divider): |
||||
|
return_str ="" |
||||
|
for b in dates: |
||||
|
print(b) |
||||
|
for d in dates[b]: |
||||
|
if "date" in d: |
||||
|
start_day = d["date"].split(".") |
||||
|
if len(start_day)<3: |
||||
|
s_year = date_to_check.year |
||||
|
else: |
||||
|
s_year = int(start_day[2]) |
||||
|
s_month = int(start_day[1]) |
||||
|
s_day = int(start_day[0]) |
||||
|
start_day = date(s_year, s_month, s_day) |
||||
|
if (start_day == date_to_check): |
||||
|
if return_str != "": |
||||
|
return_str += divider |
||||
|
return_str += "\\textcolor{"+dates_color[b]+"}{" + d["title"] + "}" |
||||
|
|
||||
|
|
||||
|
if "date-start" in d and "date-end" in d: |
||||
|
start_day = d["date-start"].split(".") |
||||
|
if len(start_day)<3: |
||||
|
s_year = date_to_check.year |
||||
|
else: |
||||
|
s_year = int(start_day[2]) |
||||
|
s_month = int(start_day[1]) |
||||
|
s_day = int(start_day[0]) |
||||
|
start_day = date(s_year, s_month, s_day) |
||||
|
|
||||
|
end_day = d["date-end"].split(".") |
||||
|
if len(end_day)<3: |
||||
|
e_year = date_to_check.year |
||||
|
else: |
||||
|
e_year = int(end_day[2]) |
||||
|
e_month = int(end_day[1]) |
||||
|
e_day = int(end_day[0]) |
||||
|
end_day = date(e_year, e_month, e_day) |
||||
|
|
||||
|
if date_to_check >= start_day and date_to_check <= end_day: |
||||
|
if return_str != "": |
||||
|
return_str += divider |
||||
|
return_str += "\\textcolor{"+dates_color[b]+"}{" + d["title"] + "}" |
||||
|
return_str = escape_german_umlauts(return_str) |
||||
|
return return_str |
@ -0,0 +1,6 @@ |
|||||
|
def escape_german_umlauts(return_str): |
||||
|
return_str = return_str.replace("ä","\\\"a") |
||||
|
return_str = return_str.replace("ö","\\\"o") |
||||
|
return_str = return_str.replace("ü","\\\"u") |
||||
|
return_str = return_str.replace("ß","\\ss{}") |
||||
|
return return_str |
@ -0,0 +1,72 @@ |
|||||
|
from datetime import timedelta |
||||
|
from datetime import date |
||||
|
import locale |
||||
|
|
||||
|
def tex_write_year_overview(fd,year): |
||||
|
fd.write(''' |
||||
|
|
||||
|
\\thispagestyle{empty} |
||||
|
\\vspace*{-4em} |
||||
|
\\begin{center} |
||||
|
\\Huge\\textbf{Jahres\\"ubersicht\\ ''') |
||||
|
fd.write(str(year)) |
||||
|
fd.write('''} |
||||
|
\\end{center} |
||||
|
\\vspace*{-8pt} |
||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%% |
||||
|
% begin overview calender''') |
||||
|
for month in range(1, 12 + 1): |
||||
|
m = date(year, month, 1) |
||||
|
|
||||
|
if (month - 1) % 2 == 0 and month != 1: |
||||
|
fd.write('\\newline') |
||||
|
|
||||
|
fd.write(''' |
||||
|
\\begin{minipage}[t]{0.5\\textwidth} |
||||
|
''') |
||||
|
fd.write(''' |
||||
|
\\begin{tabular}{ccccc|cc||} |
||||
|
''') |
||||
|
fd.write('\\multicolumn{6}{c}{\\textbf{ ' + m.strftime('%B') + '}}\\\\\n ') |
||||
|
|
||||
|
# print weeknames |
||||
|
for i in range(0, 6 + 1): |
||||
|
curr_date = date(year, month, 1) |
||||
|
curr_date = curr_date + timedelta(days=i - curr_date.weekday()) |
||||
|
|
||||
|
fd.write('\\textbf{' + curr_date.strftime('%a') + '} ') |
||||
|
if i == 6: |
||||
|
fd.write('\\\\\n\r') |
||||
|
fd.write(' \\hline\n\r') |
||||
|
else: |
||||
|
fd.write(' & ') |
||||
|
|
||||
|
|
||||
|
# monthly numbers |
||||
|
curr_date = date(year, month, 1) |
||||
|
weekline = " " + " &" * curr_date.weekday() |
||||
|
next_date = curr_date |
||||
|
while curr_date.month == next_date.month: |
||||
|
curr_date = next_date |
||||
|
next_date = curr_date + timedelta(days=1) |
||||
|
|
||||
|
weekline = weekline + " " + str(curr_date.day) |
||||
|
if (curr_date.weekday() == 6): # sunday |
||||
|
weekline = weekline + "\\\\\n " |
||||
|
else: |
||||
|
weekline = weekline + "&" |
||||
|
|
||||
|
weekline = weekline + (" &" * (5 - curr_date.weekday())) + "\\\\\n\r" |
||||
|
|
||||
|
fd.write(weekline) |
||||
|
|
||||
|
fd.write(''' |
||||
|
\\end{tabular} |
||||
|
\\end{minipage}''') |
||||
|
# if (month == 6): |
||||
|
# fd.write('\\newpage\n\r') |
||||
|
|
||||
|
fd.write(''' |
||||
|
% end overview calender |
||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%% |
||||
|
''') |
Write
Preview
Loading…
Cancel
Save
Reference in new issue