In meinem Kalender erzeuge ich Monatsseiten per foreach-Schleife. Dummerweise wird pro Monat eine Leerseite eingefügt. €dit: Es liegt wohl an dem €dit 2: Es liegt wohl an den Maßen des Kalenders. Dieser soll genau den Textkörper einnehmen. Weiß jmd. evtl. wie ich das richtig einstelle? PS: Es fehlt ohnehin noch eine Unterscheidungsmethode, ob der Kalendermonat 4, 5 oder 6 Wochenzeilen einnimmt. Dafür habe ich gerade noch keine Lösung. Vollständiger Code: Öffne in Overleaf
\documentclass[landscape,ngerman]{scrartcl} % Inputs: \def\Margin{1.75cm} \def\Year{2010} \def\Month{11} \def\CalendarNumbersFont{\Huge\sffamily}%\bfseries \def\WeekDayNamesFont{\bfseries\sffamily}%\bfseries \usepackage{lmodern} \renewcommand*{\familydefault}{\sfdefault} \setparsizes{0pt}{0pt}{0pt plus 1fil} \usepackage[showframe=true, %headsep=0mm, includehead, %margin=\Margin ]{geometry} \newcommand\changehead[1]{ \newgeometry{headheight=#1, % local margin=\Margin, includehead, headsep=0mm, nofoot, % global }} \usepackage{scrlayer-scrpage} \setkomafont{pagehead}{\normalfont} \cfoot{}% 'show no foot' \usepackage{calc} % for '\settototalheight' \usepackage{tikz} \usepackage[]{babel} \usepackage{translator} \usetikzlibrary{calendar} % Inhalt Test \newcommand\Inhalt{% %$\text{\tikzdaytext\hspace{0.75pt}}% %\overset% %%{\parbox{2em}{\tiny Tag der Deutschen}}% %{\text{\tiny Tag der Deutschen\:Einheit}}% %{\text{ \tiny (schulfrei) }\hfill}% %$% %M% {\tikzdaytext}% %\begin{tabular}[b]{>{\tiny}p{1cm}} %aa aa aaa\\[-3pt] %bbb %\end{tabular} M } \begin{document} \newlength\HeadHeight% \newlength\DayLetterHeight% %\CalendarNumbersFont% \settototalheight\DayLetterHeight{\vbox{\CalendarNumbersFont 1 2 3 4 5 6 7 8 9 0 M}}% %\settototalheight\DayLetterHeight{\parbox[b]{\linewidth}{\strut 1 2 3 4 5 6 7 8 9 0 M \strut}}% %\pgfmathsetlengthmacro{\DayLetterHeight}{height("1 2 3 4 5 6 7 8 9 0 M")}% 'same result' %\normalsize\normalfont% DayLetterHeight: \the\DayLetterHeight \\ % \newlength\weekdaynamesheight %\WeekDayNamesFont% \settototalheight\weekdaynamesheight{\vbox{\WeekDayNamesFont\pgfcalendarweekdayname{0}}}% \pgfmathsetlengthmacro{\WeekDayNamesHeight}{\weekdaynamesheight}% %\normalsize\normalfont% WeekDayNamesHeight (from \pgfcalendarweekdayname{0}): \the\weekdaynamesheight / \WeekDayNamesHeight Titelseite \newpage % Calendar % 01,02,03,04,05,06,07,08,09,10,11,12 \foreach \Month in {01,02,03,04,05,06,07,08,09,10,11,12}{%%%%%%%%%%%%%%%%%%% \def\Head{\parbox[b]{\linewidth}{\strut {\Huge\bfseries \pgfcalendarmonthname{\Month} \Year}\\ head \strut}}% \settototalheight\HeadHeight{\vbox{\Head}} % Kopfhöhe messen \changehead{\HeadHeight} %\newgeometry{headheight=\HeadHeight, %headsep=0mm, includehead, %margin=\Margin}% \ihead{\Head}% %HeadHeight \the\HeadHeight %\centering Inhalt \Month \\ % % Number of week rows: =============== \newcount\JulianDateNo \pgfcalendardatetojulian{\Year-\Month-last}{\JulianDateNo} %Julianische Tage: \the\JulianDateNo % \pgfcalendarjuliantodate{\JulianDateNo}{\theyear}{\themonth}{\DaysOfMonth} %Datum letzter Monatstag: \theyear-\themonth-\DaysOfMonth~ %Anzahl Monatstage: \DaysOfMonth % \pgfcalendardatetojulian{\Year-\Month-01}{\JulianDateNo} %Julianische Tage: \the\JulianDate \newcount\WeekDayNo \pgfcalendarjuliantoweekday{\JulianDateNo}{\WeekDayNo} %Wochentagnummer Monatserster: \the\WeekDayNo % \pgfmathsetmacro\WeekRowsNo{ \DaysOfMonth == 31 && \WeekDayNo >= 5 ? 6 : ( \DaysOfMonth == 30 && \WeekDayNo == 6 ? 6 : ( \DaysOfMonth == 28 && \WeekDayNo == 0 ? 4 : 5)) } %Wochenzeilen: \WeekRowsNo % ============================= % Measures ======================= \pgfkeys{tikz/.cd, InnerSep/.store in =\InnerSep, InnerSep=3pt, DayCellWidth/.store in =\DayCellWidth, DayCellWidth=(\textwidth-\pgflinewidth)/7, DayCellHeight/.store in =\DayCellHeight, DayCellHeight=(\textheight-2\pgflinewidth/\WeekRowsNo-\WeekDayNamesHeight-1\InnerSep)/\WeekRowsNo, } % ============================= \begin{tikzpicture}[ % ultra thick, red, opacity=0.5, % for 'showframes' every day/.append style={ text=black, font=\CalendarNumbersFont, draw, anchor=north west, inner sep=\InnerSep, text width=\DayCellWidth-2*\InnerSep, %<-geändert text depth=\DayCellHeight-\DayLetterHeight-2*\InnerSep,%<-geändert minimum width=\DayCellWidth, minimum height=\DayCellHeight,%<-geändert name=\pgfcalendarsuggestedname, }, ] \newcount\daynocount \calendar (cal) [ day xshift=\DayCellWidth,% <- eingefügt day yshift=\DayCellHeight,% <- eingefügt dates=\Year-\Month-01 to \Year-\Month-last, week list, %day code={ %\node[name=\pgfcalendarsuggestedname,every day]{\Huge \tikzdaytext}; %} ] if (Sunday) [nodes={red, fill=pink}] if (equals=\Year-\Month-02) [ %nodes={red, fill=pink}, %day code={\node[every day]{ \Tabelle };} day code={ \node[every day]{\Inhalt}; } ] % if (equals=\Year-\Month-07) [ %nodes={red, fill=pink}, %day code={\node[every day]{ };} ] ; % Weekdaynames \foreach \i in {1,...,7} {% \node[anchor=south, inner sep=\InnerSep, %text width=\DayCellWidth-2*\InnerSep, %ruiniert Zentrierung text depth=\WeekDayNamesHeight-2*\InnerSep,%<-geändert minimum width=\DayCellWidth, minimum height=\WeekDayNamesHeight,%<-geändert draw,fill=gray, text=white, font=\WeekDayNamesFont, ] at ([yshift=0ex]cal-\Year-\Month-0\i.north |- cal-\Year-\Month-01.north) {%\vphantom{g}% \pgfcalendardatetojulian{\Year-\Month-0\i}{\daynocount}% \pgfcalendarjuliantoweekday{\the\daynocount}{\daynocount}% \pgfcalendarweekdayname{\the\daynocount}%,\the\daynocount,\i% }; }% \fill[red, thick] (cal-\Year-\Month-21) circle (2pt); \node[red, draw, align =left, anchor=south, yshift=\InnerSep, text width=\DayCellWidth-2*\InnerSep, inner sep=0pt ] (Termin) at (cal-\Year-\Month-21.south) {Das ist ein langer Text. Das ist ein langer Text. \\Termin\\ Termin}; %\input{SeitengeometrieZeigen.tex} \end{tikzpicture} \newpage }%%%%%%%%%%%%%%%%%%%%%%% % \end{document} gefragt 07 Dez '18, 21:09 cis |
Die Kalenderseiten sind etwas zu groß:
Overfull \vbox (1.0041pt too high) has occurred while \output is active
.Oh verdammt! Das ist ja nicht gerade gut! Ich habe da ewig rumgefrimelt!
Es fehlt ohnehin noch eine Unterscheidungsmethode, ob der Kalendermonat 4, 5 oder 6 Wochenzeilen einnimmt. Dafür habe ich gerade noch keine Lösung.