Hier ist der Kalender für 2024. Ich hätte gerne das in jede Tageszelle 5 quadratische Kästchen nebeneinander drin sind.

Hat jemand eine Idee?

Zusatz: Wie kann ich die Bezeichnung der Tage auf Deutsch umstellen? Also statt Mon, Tue, Wed, Thu, Fri, Sat und Sun hätte ich gerne Mo, Di, Mi, Do, Fr, Sa, So.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Welcome to Overleaf --- just edit your LaTeX on the left,
% and we'll compile it for you on the right. If you open the
% 'Share' menu, you can invite other users to edit at the same
% time. See www.overleaf.com/learn for more info. Enjoy!
%
% Note: you can export the pdf to see the result at full
% resolution.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% 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}
\renewcommand*\familydefault{\sfdefault}

% User defined
\def\year{2024}
% 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{1\% Kalender}\hfill
}
%Footer
\cfoot{\footnotesize\texttt{}}



\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, Rheinland Pfalz) white background
      \ifdate{between=2023-12-27 and 2024-01-05}{%
        \tikzset{every day/.style={fill=white}}}{}
      \ifdate{between=2024-03-25 and 2024-04-02}{%
        \tikzset{every day/.style={fill=white}}}{}
      \ifdate{between=2024-05-21 and 2024-05-29}{%
        \tikzset{every day/.style={fill=white}}}{}
      \ifdate{between=2024-07-15 and 2024-08-23}{%
        \tikzset{every day/.style={fill=white}}}{}
      \ifdate{between=2024-10-14 and 2024-10-25}{%
        \tikzset{every day/.style={fill=white}}}{}
      \ifdate{between=2024-12-23 and 2025-01-08}{%
        \tikzset{every day/.style={fill=white}}}{}
    }{}
    % 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=2024-03-29}{\tikzset{every day/.style={fill=red!20}}}{}
    \ifdate{equals=2024-04-01}{\tikzset{every day/.style={fill=red!20}}}{}
    \ifdate{equals=2024-05-09}{\tikzset{every day/.style={fill=red!20}}}{}
    \ifdate{equals=2024-05-20}{\tikzset{every day/.style={fill=red!20}}}{}
    \ifdate{equals=2024-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

\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=2023-12-24 and 2023-01-05}{%
      \tikzset{every day/.style={fill=white}}}{}
    \ifdate{between=2024-03-25 and 2024-04-05}{%
      \tikzset{every day/.style={fill=white}}}{}
    \ifdate{between=2024-05-21 and 2024-06-01}{%
      \tikzset{every day/.style={fill=white}}}{}
    \ifdate{between=2024-07-25 and 2024-09-07}{%
      \tikzset{every day/.style={fill=white}}}{}
    \ifdate{between=2024-10-28 and 2024-10-30}{%
      \tikzset{every day/.style={fill=white}}}{}
    \ifdate{between=2024-12-23 and 2025-01-04}{%
      \tikzset{every day/.style={fill=white}}}{}
  }{}
  % 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=2024-03-29}{\tikzset{every day/.style={fill=red!20}}}{}
  \ifdate{equals=2024-04-01}{\tikzset{every day/.style={fill=red!20}}}{}
  \ifdate{equals=2024-05-09}{\tikzset{every day/.style={fill=red!20}}}{}
  \ifdate{equals=2024-05-20}{\tikzset{every day/.style={fill=red!20}}}{}
  \ifdate{equals=2024-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
\end{tikzpicture}
\end{center}
\end{document}

gefragt 04 Feb, 12:48

runix's gravatar image

runix
1.0k217384
Akzeptiert-Rate: 0%

bearbeitet 04 Feb, 14:37


Die Kästchen kannst du im daycode ergänzen, beispielsweise

  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}};
    \foreach \i [evaluate=\i as \x using -.8+\i*.6] in {0,...,4}{%
      \draw (\x cm,0pt)node[anchor=west,draw,minimum size=.35cm]{};} <- Kästchen in Tageszellen
  },

Damit die Wochentage auf Deutsch sind, musst du translator vor tikz laden.

% 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[ngerman]{babel}
\usepackage[T1]{fontenc}

\usepackage{translator} % German Month and Day names
\usepackage{tikz} % Use the calendar.sty style
\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}
\renewcommand*\familydefault{\sfdefault}

% User defined
\def\year{2024}
% 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{1\% Kalender}\hfill
}
%Footer
\cfoot{\footnotesize\texttt{}}

\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}};
    \foreach \i [evaluate=\i as \x using -.8+\i*.6] in {0,...,4}{%
      \draw (\x cm,0pt)node[anchor=west,draw,minimum size=.35cm]{};}%<- Kästchen in Tageszellen
  },
  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, Rheinland Pfalz) white background
      \ifdate{between=2023-12-27 and 2024-01-05}{%
        \tikzset{every day/.style={fill=white}}}{}
      \ifdate{between=2024-03-25 and 2024-04-02}{%
        \tikzset{every day/.style={fill=white}}}{}
      \ifdate{between=2024-05-21 and 2024-05-29}{%
        \tikzset{every day/.style={fill=white}}}{}
      \ifdate{between=2024-07-15 and 2024-08-23}{%
        \tikzset{every day/.style={fill=white}}}{}
      \ifdate{between=2024-10-14 and 2024-10-25}{%
        \tikzset{every day/.style={fill=white}}}{}
      \ifdate{between=2024-12-23 and 2025-01-08}{%
        \tikzset{every day/.style={fill=white}}}{}
    }{}
    % 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=2024-03-29}{\tikzset{every day/.style={fill=red!20}}}{}
    \ifdate{equals=2024-04-01}{\tikzset{every day/.style={fill=red!20}}}{}
    \ifdate{equals=2024-05-09}{\tikzset{every day/.style={fill=red!20}}}{}
    \ifdate{equals=2024-05-20}{\tikzset{every day/.style={fill=red!20}}}{}
    \ifdate{equals=2024-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

\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=2023-12-24 and 2023-01-05}{%
      \tikzset{every day/.style={fill=white}}}{}
    \ifdate{between=2024-03-25 and 2024-04-05}{%
      \tikzset{every day/.style={fill=white}}}{}
    \ifdate{between=2024-05-21 and 2024-06-01}{%
      \tikzset{every day/.style={fill=white}}}{}
    \ifdate{between=2024-07-25 and 2024-09-07}{%
      \tikzset{every day/.style={fill=white}}}{}
    \ifdate{between=2024-10-28 and 2024-10-30}{%
      \tikzset{every day/.style={fill=white}}}{}
    \ifdate{between=2024-12-23 and 2025-01-04}{%
      \tikzset{every day/.style={fill=white}}}{}
  }{}
  % 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=2024-03-29}{\tikzset{every day/.style={fill=red!20}}}{}
  \ifdate{equals=2024-04-01}{\tikzset{every day/.style={fill=red!20}}}{}
  \ifdate{equals=2024-05-09}{\tikzset{every day/.style={fill=red!20}}}{}
  \ifdate{equals=2024-05-20}{\tikzset{every day/.style={fill=red!20}}}{}
  \ifdate{equals=2024-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
\end{tikzpicture}
\end{center}
\end{document}
Permanenter link

beantwortet 04 Feb, 23:42

esdd's gravatar image

esdd
17.7k264256
Akzeptiert-Rate: 62%

Deine Antwort
Vorschau umschalten

Folgen dieser Frage

Per E-Mail:

Wenn sie sich anmelden, kommen Sie für alle Updates hier in Frage

Per RSS:

Antworten

Antworten und Kommentare

Markdown-Grundlagen

  • *kursiv* oder _kursiv_
  • **Fett** oder __Fett__
  • Link:[Text](http://url.com/ "Titel")
  • Bild?![alt Text](/path/img.jpg "Titel")
  • nummerierte Liste: 1. Foo 2. Bar
  • zum Hinzufügen ein Zeilenumbruchs fügen Sie einfach zwei Leerzeichen an die Stelle an der die neue Linie sein soll.
  • grundlegende HTML-Tags werden ebenfalls unterstützt

Frage-Themen:

×728
×14

gestellte Frage: 04 Feb, 12:48

Frage wurde gesehen: 732 Mal

zuletzt geändert: 05 Feb, 13:50