日历模板帮助

日历模板帮助

汤姆·邦巴迪尔帮忙使用模板。但我得到很多错误。我做错了什么?

% 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[english]{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{2015}
% 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{Cleaning Plan}\hfill
}
%Footer
%\cfoot{\footnotesize\texttt{http://www.texample.net/}}
\pagenumbering{gobble}


% === Macro that returns a name if given a number from 0 to 29, "Error!" otherwise
\newcommand{\Person}[1]{%
\ifcase#1
Bryant Romans \or
Latricia Stoneman \or
Wilmer Lytton \or 
Tommie Lenahan \or 
Antonio Hoggard \or 
Edward Lanctot \or 
Chassidy Hyndman \or 
Marianela Wojciechowski \or 
Edna Kreitzer \or 
Harrison Cruze \or 
Marna Meloy \or 
Georgene Joly \or 
Ken Denley \or 
William Loeffler \or 
Young Spinelli \or 
Glendora Bruss \or 
Kraig Calloway \or 
Chantal Callejas \or 
Eleni Graziani \or 
Ilene Crumpler \or 
Ali Valliere \or 
Sonya Barlett \or 
Frederick Delacruz \or 
Kayce Foti \or 
Orval Kirchner \or 
Corrinne Cahoon \or 
Modesto Mulloy \or 
Alessandra Rodenberger \or 
Bernita Redman \or 
Iola Eudy \else
Error! \fi
}



\begin{document}
\pagestyle{fancy}
\begin{center}

\xdef\cleanerID{0}

 day code=
  { %=== Define macro that holds cleaners name on cleaning days, empty otherwise
    \ifdate{Monday,Wednesday,Saturday}%
    {   \xdef\InsertName{\Person{\cleanerID}}
        \pgfmathtruncatemacro{\newCleanerID}{mod(\cleanerID+1,30)}
            \xdef\cleanerID{\newCleanerID}
    }
    {   \xdef\InsertName{}
    }   
    \node[name=\pgfcalendarsuggestedname,every day,shape=rectangle,
    minimum height= .53cm, text width = 4.4cm, draw = gray]{\tikzdaytext};
    %=== Insert the  cleaners name here
    \draw (-1.8cm, -.1ex) node[anchor = west]{\footnotesize%
      \pgfcalendarweekdayshortname{\pgfcalendarcurrentweekday} \InsertName
      };
  },

\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 = black, text= white, draw = black, text centered]
        {\textbf{\pgfcalendarmonthname{\pgfcalendarcurrentmonth}}};
    }{}
    \ifdate{workday}
    {
      % normal days are white
      \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}}}{}
    % Sundays and full holidays
    \ifdate{Sunday}{\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}
  }
];
\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 = black, text= white, draw = black, text centered]
    {
      \textbf{\pgfcalendarmonthname{\pgfcalendarcurrentmonth}}
    };
  }{}
  \ifdate{workday}
  {
    \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}}}{}
  % Sundays and full holidays
  \ifdate{Sunday}{\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}
  }
];
\end{tikzpicture}
\end{center}
\end{document}

错误代码如下:

! Undefined control sequence.
l.87 \ifdate
{Monday,Wednesday,Saturday}%
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
l.94 \node
[name=\pgfcalendarsuggestedname,every day,shape=rectangle,
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\pgfcalendarsuggestedname ...e \pgfcalendarprefix
-\pgfcalendarcurrentyear -...
l.94 \node[name=\pgfcalendarsuggestedname
,every day,shape=rectangle,
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\pgfcalendarsuggestedname ...fcalendarcurrentyear
-\pgfcalendarcurrentmonth ...
l.94 \node[name=\pgfcalendarsuggestedname
,every day,shape=rectangle,
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\pgfcalendarsuggestedname ...calendarcurrentmonth
-\pgfcalendarcurrentday \fi
l.94 \node[name=\pgfcalendarsuggestedname
,every day,shape=rectangle,
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\pgfcalendarsuggestedname ...gfcalendarcurrentday
\fi
l.94 \node[name=\pgfcalendarsuggestedname
,every day,shape=rectangle,
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
l.97 \draw
(-1.8cm, -.1ex) node[anchor = west]{\footnotesize%
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
<argument> ...@\ifcase \pgfcalendarcurrentweekday
Mon\or Tue\or Wed\or Thu\o...
l.98 ...ekdayshortname{\pgfcalendarcurrentweekday}
\InsertName
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Missing number, treated as zero.
<to be read again>
M
l.98 ...ekdayshortname{\pgfcalendarcurrentweekday}
\InsertName
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Undefined control sequence.
<argument> ...@\ifcase \pgfcalendarcurrentweekday
Mon\or Tue\or Wed\or Thu\o...
l.98 ...ekdayshortname{\pgfcalendarcurrentweekday}
\InsertName
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Missing number, treated as zero.
<to be read again>
M
l.98 ...ekdayshortname{\pgfcalendarcurrentweekday}
\InsertName
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Undefined control sequence.
<argument> ...@\ifcase \pgfcalendarcurrentweekday
Mon\or Tue\or Wed\or Thu\o...
l.98 ...ekdayshortname{\pgfcalendarcurrentweekday}
\InsertName
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Missing number, treated as zero.
<to be read again>
M
l.98 ...ekdayshortname{\pgfcalendarcurrentweekday}
\InsertName
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Undefined control sequence.
<argument> ...@\ifcase \pgfcalendarcurrentweekday
Mon\or Tue\or Wed\or Thu\o...
l.98 ...ekdayshortname{\pgfcalendarcurrentweekday}
\InsertName
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Missing number, treated as zero.
<to be read again>
M
l.98 ...ekdayshortname{\pgfcalendarcurrentweekday}
\InsertName
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
Class scrartcl Warning: Usage of deprecated font command `\sl'!
(scrartcl) You should note, that in 1994 font command `\sl' has
(scrartcl) been defined for compatiblitiy to Script 2.0 only.
(scrartcl) Now, after two decades of LaTeX2e and NFSS2, you
(scrartcl) shouldn't use such commands any longer and within
(scrartcl) KOMA-Script usage of `\sl' is definitely deprecated.
(scrartcl) See `fntguide.pdf' for more information about
(scrartcl) recommended font commands.
(scrartcl) Note also, that KOMA-Script will remove the definition
(scrartcl) of `\sl' anytime until release of about version 3.20.
(scrartcl) But for now, KOMA-Script will replace deprecated `\sl'
(scrartcl) by `\normalfont \slshape ' on input line 185.
Class scrartcl Warning: Usage of deprecated font command `\sl'!
(scrartcl) You should note, that in 1994 font command `\sl' has
(scrartcl) been defined for compatiblitiy to Script 2.0 only.
(scrartcl) Now, after two decades of LaTeX2e and NFSS2, you
(scrartcl) shouldn't use such commands any longer and within
(scrartcl) KOMA-Script usage of `\sl' is definitely deprecated.
(scrartcl) See `fntguide.pdf' for more information about
(scrartcl) recommended font commands.
(scrartcl) Note also, that KOMA-Script will remove the definition
(scrartcl) of `\sl' anytime until release of about version 3.20.
(scrartcl) But for now, KOMA-Script will replace deprecated `\sl'
(scrartcl) by `\normalfont \slshape ' on input line 185.
Package Fancyhdr Warning: \headheight is too small (43.04504pt):
Make it at least 47.05655pt.
We now make it that large for the rest of the document.
This may cause the page layout to be inconsistent, however.
Class scrartcl Warning: Usage of deprecated font command `\rm'!
(scrartcl) You should note, that in 1994 font command `\rm' has
(scrartcl) been defined for compatiblitiy to Script 2.0 only.
(scrartcl) Now, after two decades of LaTeX2e and NFSS2, you
(scrartcl) shouldn't use such commands any longer and within
(scrartcl) KOMA-Script usage of `\rm' is definitely deprecated.
(scrartcl) See `fntguide.pdf' for more information about
(scrartcl) recommended font commands.
(scrartcl) Note also, that KOMA-Script will remove the definition
(scrartcl) of `\rm' anytime until release of about version 3.20.
(scrartcl) But for now, KOMA-Script will replace deprecated `\rm'
(scrartcl) by `\normalfont \rmfamily ' on input line 185.
Package Fancyhdr Warning: \footskip is too small (0.0pt):
Make it at least 8.39996pt.
We now make it that large for the rest of the document.
This may cause the page layout to be inconsistent, however.
[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}
]
Class scrartcl Warning: Usage of deprecated font command `\sl'!
(scrartcl) You should note, that in 1994 font command `\sl' has
(scrartcl) been defined for compatiblitiy to Script 2.0 only.
(scrartcl) Now, after two decades of LaTeX2e and NFSS2, you
(scrartcl) shouldn't use such commands any longer and within
(scrartcl) KOMA-Script usage of `\sl' is definitely deprecated.
(scrartcl) See `fntguide.pdf' for more information about
(scrartcl) recommended font commands.
(scrartcl) Note also, that KOMA-Script will remove the definition
(scrartcl) of `\sl' anytime until release of about version 3.20.
(scrartcl) But for now, KOMA-Script will replace deprecated `\sl'
(scrartcl) by `\normalfont \slshape ' on input line 185.
Class scrartcl Warning: Usage of deprecated font command `\sl'!
(scrartcl) You should note, that in 1994 font command `\sl' has
(scrartcl) been defined for compatiblitiy to Script 2.0 only.
(scrartcl) Now, after two decades of LaTeX2e and NFSS2, you
(scrartcl) shouldn't use such commands any longer and within
(scrartcl) KOMA-Script usage of `\sl' is definitely deprecated.
(scrartcl) See `fntguide.pdf' for more information about
(scrartcl) recommended font commands.
(scrartcl) Note also, that KOMA-Script will remove the definition
(scrartcl) of `\sl' anytime until release of about version 3.20.
(scrartcl) But for now, KOMA-Script will replace deprecated `\sl'
(scrartcl) by `\normalfont \slshape ' on input line 185.
Class scrartcl Warning: Usage of deprecated font command `\rm'!
(scrartcl) You should note, that in 1994 font command `\rm' has
(scrartcl) been defined for compatiblitiy to Script 2.0 only.
(scrartcl) Now, after two decades of LaTeX2e and NFSS2, you
(scrartcl) shouldn't use such commands any longer and within
(scrartcl) KOMA-Script usage of `\rm' is definitely deprecated.
(scrartcl) See `fntguide.pdf' for more information about
(scrartcl) recommended font commands.
(scrartcl) Note also, that KOMA-Script will remove the definition
(scrartcl) of `\rm' anytime until release of about version 3.20.
(scrartcl) But for now, KOMA-Script will replace deprecated `\rm'
(scrartcl) by `\normalfont \rmfamily ' on input line 185.
[2]
Class scrartcl Warning: Usage of deprecated font command `\sl'!
(scrartcl) You should note, that in 1994 font command `\sl' has
(scrartcl) been defined for compatiblitiy to Script 2.0 only.
(scrartcl) Now, after two decades of LaTeX2e and NFSS2, you
(scrartcl) shouldn't use such commands any longer and within
(scrartcl) KOMA-Script usage of `\sl' is definitely deprecated.
(scrartcl) See `fntguide.pdf' for more information about
(scrartcl) recommended font commands.
(scrartcl) Note also, that KOMA-Script will remove the definition
(scrartcl) of `\sl' anytime until release of about version 3.20.
(scrartcl) But for now, KOMA-Script will replace deprecated `\sl'
(scrartcl) by `\normalfont \slshape ' on input line 185.
Class scrartcl Warning: Usage of deprecated font command `\sl'!
(scrartcl) You should note, that in 1994 font command `\sl' has
(scrartcl) been defined for compatiblitiy to Script 2.0 only.
(scrartcl) Now, after two decades of LaTeX2e and NFSS2, you
(scrartcl) shouldn't use such commands any longer and within
(scrartcl) KOMA-Script usage of `\sl' is definitely deprecated.
(scrartcl) See `fntguide.pdf' for more information about
(scrartcl) recommended font commands.
(scrartcl) Note also, that KOMA-Script will remove the definition
(scrartcl) of `\sl' anytime until release of about version 3.20.
(scrartcl) But for now, KOMA-Script will replace deprecated `\sl'
(scrartcl) by `\normalfont \slshape ' on input line 185.
Class scrartcl Warning: Usage of deprecated font command `\rm'!
(scrartcl) You should note, that in 1994 font command `\rm' has
(scrartcl) been defined for compatiblitiy to Script 2.0 only.
(scrartcl) Now, after two decades of LaTeX2e and NFSS2, you
(scrartcl) shouldn't use such commands any longer and within
(scrartcl) KOMA-Script usage of `\rm' is definitely deprecated.
(scrartcl) See `fntguide.pdf' for more information about
(scrartcl) recommended font commands.
(scrartcl) Note also, that KOMA-Script will remove the definition
(scrartcl) of `\rm' anytime until release of about version 3.20.
(scrartcl) But for now, KOMA-Script will replace deprecated `\rm'
(scrartcl) by `\normalfont \rmfamily ' on input line 185.
[3] (./Calendar.aux) )
Here is how much of TeX's memory you used:
17335 strings out of 493105
347628 string characters out of 6137072
659951 words of memory out of 5000000
20502 multiletter control sequences out of 15000+600000
10555 words of font info for 23 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
64i,11n,60p,389b,825s stack positions out of 5000i,500n,10000p,200000b,80000s
{/usr/share/texmf/fonts/enc/dvips/cm-super/cm-super-t1.en
c}</usr/share/texmf/fonts/type1/public/cm-super/sfss0800.pfb></usr/share/texmf/
fonts/type1/public/cm-super/sfss1000.pfb></usr/share/texmf/fonts/type1/public/c
m-super/sfsx1000.pfb>
Output written on Calendar.pdf (3 pages, 65918 bytes).
PDF statistics:
30 PDF objects out of 1000 (max. 8388607)
21 compressed objects within 1 object stream
0 named destinations out of 1000 (max. 500000)
13 words of extra memory for PDF output out of 10000 (max. 10000000)

据我所知,存在未定义 ifdate 和 node 的问题。但我不知道为什么?

也许您可以帮助我,个性化我的代码,使其适合我现在的情况。我希望 Eleni Graziani 从 2015 年 11 月 18 日星期三开始。我想在 12 月 10 日之间暂停工作计划,并让工作计划在 1 月 3 日重复。我知道 Ilene Crumpler 和 Iola Eudy 已经更改了第一周期的工作。

我需要帮助的地方

  • 使模板发挥作用。
  • 个性化我的方案,这样我就知道如何使用它
    • Eleni Graziani 于 2015 年 11 月 18 日星期三开始
    • 在 12 月 10 日之间暂停工作计划,并让工作计划在 1 月 3 日重复
    • Ilene Crumpler 和 Iola Eudy 改变了第一轮的工作

希望您能帮助我。非常感谢您考虑我的请求。

答案1

  • 如果您代替day code。您的错误是由于将其放置在日历环境之外造成的。
  • 我从 2015 年下半年和 2015 年上半年开始。要改变周期,请将初始化为\cleanerID从 0 到 29 的某个值。对于给定的要求,它是 18。
  • 要暂停和开始,您可以at most使用at least\ifdate
  • 要更改两个名称,它只需查找日期并手动更改它们(通过equals=<reference>),并为它们添加不同的颜色以显示效果。

代码

% 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[english]{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{2015}
\def\nextyear{2016}
% 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{Cleaning Plan}\hfill
}
%Footer
%\cfoot{\footnotesize\texttt{http://www.texample.net/}}
\pagenumbering{gobble}

% === Macro that returns a name if given a number from 0 to 29, "Error!" otherwise
\newcommand{\Person}[1]{%
\ifcase#1
Bryant Romans \or
Latricia Stoneman \or
Wilmer Lytton \or 
Tommie Lenahan \or 
Antonio Hoggard \or 
Edward Lanctot \or 
Chassidy Hyndman \or 
Marianela Wojciechowski \or 
Edna Kreitzer \or 
Harrison Cruze \or 
Marna Meloy \or 
Georgene Joly \or 
Ken Denley \or 
William Loeffler \or 
Young Spinelli \or 
Glendora Bruss \or 
Kraig Calloway \or 
Chantal Callejas \or 
Eleni Graziani \or 
Ilene Crumpler \or 
Ali Valliere \or 
Sonya Barlett \or 
Frederick Delacruz \or 
Kayce Foti \or 
Orval Kirchner \or 
Corrinne Cahoon \or 
Modesto Mulloy \or 
Alessandra Rodenberger \or 
Bernita Redman \or 
Iola Eudy \else
Error! \fi
}

\xdef\cleanerID{18}

\begin{document}
\pagestyle{fancy}
\begin{center}
\begin{tikzpicture}[every day/.style={anchor = north}]
\calendar[
  dates=\year-07-01 to \year-12-31,
  name=cal,
  day yshift = 3em,
  day code=
  { %=== Define macro that holds cleaners name on cleaning days, empty otherwise
    \ifdate{Monday,Wednesday,Saturday}%
    {   \ifdate{at most=\year-12-09}
        {   \xdef\InsertName{\Person{\cleanerID}}
            \pgfmathtruncatemacro{\newCleanerID}{mod(\cleanerID+1,30)}
                \xdef\cleanerID{\newCleanerID}
            }
            {   \xdef\InsertName{}
            }
    }
    {   \xdef\InsertName{}
    } 
    \ifdate{equals=\year-07-04}
    {   \xdef\InsertName{Iola Eudy}
        \tikzset{every day/.style={fill=cyan!50!blue}}          
    }{}
    \ifdate{equals=\year-07-27}
    {   \xdef\InsertName{Ilene Crumpler}
        \tikzset{every day/.style={fill=cyan!50!blue}}          
    }{}
    \node[name=\pgfcalendarsuggestedname,every day,shape=rectangle,
    minimum height= .53cm, text width = 4.4cm, draw = gray]{\tikzdaytext};
    %=== Insert the  cleaners name here
    \draw (-1.8cm, -.1ex) node[anchor = west]{\footnotesize%
      \pgfcalendarweekdayshortname{\pgfcalendarcurrentweekday} \InsertName
      };
  },
  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 = black, text= white, draw = black, text centered]
        {\textbf{\pgfcalendarmonthname{\pgfcalendarcurrentmonth}}
        };
    }{}
    \ifdate{workday}
    {
      % normal days are white
      \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}}}{}
    % Sundays and full holidays
    \ifdate{Sunday}{\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}
  }
];
\end{tikzpicture}
% Repeat the whole thing for the second page
%\pagebreak

\begin{tikzpicture}[every day/.style={anchor = north}]
\calendar[dates=\nextyear-01-01 to \nextyear-06-30,
  name=cal,
  day yshift = 3em,
  day code=
  { %=== Define macro that holds cleaners name on cleaning days, empty otherwise
    \ifdate{Monday,Wednesday,Saturday}%
    {   \ifdate{at least=\nextyear-01-03}
        {   \xdef\InsertName{\Person{\cleanerID}}
            \pgfmathtruncatemacro{\newCleanerID}{mod(\cleanerID+1,30)}
                \xdef\cleanerID{\newCleanerID}
            }
            {   \xdef\InsertName{}
            }
    }
    {   \xdef\InsertName{}
    }   
    \node[name=\pgfcalendarsuggestedname,every day,shape=rectangle,
    minimum height= .53cm, text width = 4.4cm, draw = gray]{\tikzdaytext};
    %=== Insert the  cleaners name here
    \draw (-1.8cm, -.1ex) node[anchor = west]{\footnotesize%
      \pgfcalendarweekdayshortname{\pgfcalendarcurrentweekday} \InsertName
      };
  },
  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 = black, text= white, draw = black, text centered]
    {
      \textbf{\pgfcalendarmonthname{\pgfcalendarcurrentmonth}}
    };
  }{}
  \ifdate{workday}
  {
    \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}}}{}
  % Sundays and full holidays
  \ifdate{Sunday}{\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}
  }
];
\end{tikzpicture}
\end{center}
\end{document}

输出

在此处输入图片描述


编辑1:可能你更希望它像这样:

  • 它于 2015 年 11 月 18 日开始并持续到 2016 年 10 月。
  • 不包括圣诞假期
  • 琳恩·克伦普勒艾奥拉·尤迪已交换,但这是手动完成的

代码

% 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[english]{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{2015}
\def\nextyear{2016}
% 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}{3ex}
\chead{
  %\fontsize{60}{70}\selectfont\textbf{\year}
  \Large\textbf{Cleaning Plan}\hfill
}
%Footer
%\cfoot{\footnotesize\texttt{http://www.texample.net/}}
\pagenumbering{gobble}

% === Macro that returns a name if given a number from 0 to 29, "Error!" otherwise
\newcommand{\Person}[1]{%
\ifcase#1
Bryant Romans \or
Latricia Stoneman \or
Wilmer Lytton \or 
Tommie Lenahan \or 
Antonio Hoggard \or 
Edward Lanctot \or 
Chassidy Hyndman \or 
Marianela Wojciechowski \or 
Edna Kreitzer \or 
Harrison Cruze \or 
Marna Meloy \or 
Georgene Joly \or 
Ken Denley \or 
William Loeffler \or 
Young Spinelli \or 
Glendora Bruss \or 
Kraig Calloway \or 
Chantal Callejas \or 
Eleni Graziani \or 
Ilene Crumpler \or 
Ali Valliere \or 
Sonya Barlett \or 
Frederick Delacruz \or 
Kayce Foti \or 
Orval Kirchner \or 
Corrinne Cahoon \or 
Modesto Mulloy \or 
Alessandra Rodenberger \or 
Bernita Redman \or 
Iola Eudy \else
Error! \fi
}

\xdef\cleanerID{18}

\begin{document}
\pagestyle{fancy}
\begin{center}
\begin{tikzpicture}[every day/.style={anchor = north}]
\calendar[
  dates=\year-11-01 to \nextyear-04-30,
  name=cal,
  day yshift = 3em,
  day code=
  { %=== Define macro that holds cleaners name on cleaning days, empty otherwise
    \ifdate{Monday,Wednesday,Saturday}%
    {   \ifdate{between=\year-11-18 and \year-12-09, at least=\nextyear-01-03}
        {   \xdef\InsertName{\Person{\cleanerID}}
            \pgfmathtruncatemacro{\newCleanerID}{mod(\cleanerID+1,30)}
                \xdef\cleanerID{\newCleanerID}
            }
            {   \xdef\InsertName{}
            }
    }
    {   \xdef\InsertName{}
    } 
    \ifdate{equals=\year-11-21}
    {   \xdef\InsertName{Iola Eudy}
        \tikzset{every day/.style={fill=cyan!50!blue!50}}       
    }{}
    \ifdate{equals=\nextyear-01-06}
    {   \xdef\InsertName{Ilene Crumpler}
        \tikzset{every day/.style={fill=cyan!50!blue!50}}       
    }{}
    \node[name=\pgfcalendarsuggestedname,every day,shape=rectangle,
    minimum height= .53cm, text width = 4.4cm, draw = gray]{\tikzdaytext};
    %=== Insert the  cleaners name here
    \draw (-1.8cm, -.1ex) node[anchor = west]{\footnotesize%
      \pgfcalendarweekdayshortname{\pgfcalendarcurrentweekday} \InsertName
      };
  },
  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 = black, text= white, draw = black, text centered]
        {\textbf{\pgfcalendarmonthname{\pgfcalendarcurrentmonth} \pgfcalendarcurrentyear}
        };
    }{}
    \ifdate{workday}
    {
      % normal days are white
      \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}}}{}
    % Sundays and full holidays
    \ifdate{Sunday}{\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}
  }
];
\end{tikzpicture}
% Repeat the whole thing for the second page
%\pagebreak

\begin{tikzpicture}[every day/.style={anchor = north}]
\calendar[dates=\nextyear-05-01 to \nextyear-10-31,
  name=cal,
  day yshift = 3em,
  day code=
  { %=== Define macro that holds cleaners name on cleaning days, empty otherwise
    \ifdate{Monday,Wednesday,Saturday}%
    {   \ifdate{at least=\nextyear-01-03}
        {   \xdef\InsertName{\Person{\cleanerID}}
            \pgfmathtruncatemacro{\newCleanerID}{mod(\cleanerID+1,30)}
                \xdef\cleanerID{\newCleanerID}
            }
            {   \xdef\InsertName{}
            }
    }
    {   \xdef\InsertName{}
    }   
    \node[name=\pgfcalendarsuggestedname,every day,shape=rectangle,
    minimum height= .53cm, text width = 4.4cm, draw = gray]{\tikzdaytext};
    %=== Insert the  cleaners name here
    \draw (-1.8cm, -.1ex) node[anchor = west]{\footnotesize%
      \pgfcalendarweekdayshortname{\pgfcalendarcurrentweekday} \InsertName
      };
  },
  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 = black, text= white, draw = black, text centered]
    {
      \textbf{\pgfcalendarmonthname{\pgfcalendarcurrentmonth} \pgfcalendarcurrentyear}
    };
  }{}
  \ifdate{workday}
  {
    \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}}}{}
  % Sundays and full holidays
  \ifdate{Sunday}{\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}
  }
];
\end{tikzpicture}
\end{center}
\end{document}

输出

在此处输入图片描述

相关内容