Tikz 日历的一些问题

Tikz 日历的一些问题

我一直在尝试实施自己的计划,因为商店里的东西从未真正让我满意。我现在或多或少得到了我想要的东西。我仍然有一些无法解决的小问题。所以如果有人有任何建议:

  1. 我在日历上只显示星期一、星期四和星期五(出现在每周页面的右上角)。到目前为止,我发现的唯一可行的解​​决方案是在我不想显示的日子使用负“xshift”,否则会留下空白。但出于某种原因,除了星期一与星期四和星期五分开的月份之外,它工作正常。在这种情况下,出于某种原因会添加更大的空白,但我不知道为什么。

  2. 每页显示的日历不显示最后一条垂直线,而它是在用于日记文本的表格定义中写的......

  3. 星期几和月份的名称无法翻译成法语,我不知道为什么,我注意了 usepackage 的位置,但它仍然不起作用。

  4. 一个很棒的点睛之笔是,根据星期显示不同的日历(在我的代码中 \n 的值,如果 \n 是奇数,则显示某个日历,如果 \n 是偶数,则显示另一个日历)。我不知道该怎么做。

普通的一周,第 2 期和第 3 期 普通的一周,第 2 期和第 3 期 第 1 期(以及第 2 期和第 3 期)的糟糕一周 第 1 期(以及第 2 期和第 3 期)的糟糕一周

非常感谢您的意见!干杯!

我的代码如下:

\documentclass{article}
\usepackage{advdate}

\makeatletter
\renewcommand\AdvanceDate[1][\@ne]{\global\advance\day#1 \FixDate}
\makeatother

\usepackage{tgheros,tikz,array}
\usetikzlibrary{calendar}
\usepackage[margin=1.25in,noheadfoot=true]{geometry}
\usepackage[french]{babel}
\usepackage[french]{translator}


%=========================================================
%== Page characteristics (Page Setup) ====================
\setlength{\textwidth}{126mm}
\setlength{\textheight}{230.0mm}
\setlength{\topmargin}{-30mm}
\setlength{\hoffset}{-20mm}
\setlength{\marginparwidth}{-20mm}
\setlength{\footskip}{0mm}
\setlength{\headheight}{11mm}
\setlength{\headsep}{4mm}
\setlength{\parindent}{0cm}
%=========================================================

\usetikzlibrary{backgrounds, positioning, scopes}
\newcommand{\textoverline}[1]{$\overline{\mbox{#1}}$}
\usepackage[absolute,overlay,showboxes]{textpos}
\usepackage{xcolor}
\usepackage{colortbl}
\definecolor{mygrey}{RGB}{239,239,239}
\usepackage{lastpage}
\usepackage{fancyhdr}
\begin{document}

\setlength{\arrayrulewidth}{0.1pt}
\sffamily
\footnotesize

\newcommand\mondaytext[2]{%
  \begin{tabular}{|>{\mdseries\footnotesize}cp{1cm}|cp{1cm}|}
    \multicolumn{2}{c}{#1 #2} \\
    \hline
    \begin{tabular}{@{}c@{}}8:35 \\ 9:30\end{tabular}& \\ \hline
    \begin{tabular}{@{}c@{}}9:30 \\ 10:25\end{tabular} & \textbf{4D} \\\hline\hline
    \begin{tabular}{@{}c@{}}10:40 \\ 11:35\end{tabular} & \textbf{4B}\\\hline
    \begin{tabular}{@{}c@{}}11:35 \\ 12:30\end{tabular} & \\\hline\hline
    \begin{tabular}{@{}c@{}}12:30\\ 13:05\end{tabular}  & \\\hline\hline
    \begin{tabular}{@{}c@{}}13:05\\14:00 \end{tabular}  & \\\hline
    \begin{tabular}{@{}c@{}}14:00\\14:55 \end{tabular} & \begin{tabular}{@{}c|c@{}}&\textbf{4B}\end{tabular}\\\hline\hline
    \begin{tabular}{@{}c@{}}15:10\\16:05 \end{tabular}& \textbf{4C}\\\hline
  \end{tabular}
}
\newcommand\thursdaytext[2]{%
  \begin{tabular}{|>{\mdseries\footnotesize}cp{1cm}|cp{1cm}|}
    \multicolumn{2}{c}{#1 #2} \\
    \hline
    \begin{tabular}{@{}c@{}}8:35 \\ 9:30\end{tabular}& \textbf{4D}\\ \hline
    \begin{tabular}{@{}c@{}}9:30 \\ 10:25\end{tabular} & \textbf{4B}\\\hline\hline
    \begin{tabular}{@{}c@{}}10:40 \\ 11:35\end{tabular} & \textbf{4C}\\\hline
    \begin{tabular}{@{}c@{}}11:35 \\ 12:30\end{tabular} & \\\hline\hline
    \begin{tabular}{@{}c@{}}12:30\\ 13:05\end{tabular}  & \\\hline\hline
    \begin{tabular}{@{}c@{}}13:05\\14:00 \end{tabular}  & \begin{tabular}{@{}c|c@{}}\textbf{4D}&\end{tabular}\\\hline
    \begin{tabular}{@{}c@{}}14:00\\14:55 \end{tabular} & \\\hline\hline
    \begin{tabular}{@{}c@{}}15:10\\16:05 \end{tabular}& \\\hline
  \end{tabular}
}
\newcommand\fridaytext[2]{%
  \begin{tabular}{|>{\mdseries\footnotesize}p{1cm}|cp{1cm}|}
    \multicolumn{2}{c}{#1 #2} \\
    \hline
    \begin{tabular}{@{}c@{}}8:35 \\ 9:30\end{tabular}& \textbf{DF:3C}\\ \hline
    \begin{tabular}{@{}c@{}}9:30 \\ 10:25\end{tabular} & \textbf{4D} \\\hline\hline
    \begin{tabular}{@{}c@{}}10:40 \\ 11:35\end{tabular} & \\\hline
    \begin{tabular}{@{}c@{}}11:35 \\ 12:30\end{tabular} & \\\hline\hline
    \begin{tabular}{@{}c@{}}12:30\\ 13:05\end{tabular}  & \\\hline\hline
    \begin{tabular}{@{}c@{}}13:05\\14:00 \end{tabular}  & \begin{tabular}{@{}c|c@{}}& \textbf{4C}\end{tabular} \\\hline
    \begin{tabular}{@{}c@{}}14:00\\14:55 \end{tabular} & \textbf{4D}\\\hline\hline
    \begin{tabular}{@{}c@{}}15:10\\16:05 \end{tabular}& \textbf{4C}\\\hline
  \end{tabular}
}

\setlength{\skip\footins}{0cm}
\pagestyle{empty}
\SetDate[31/08/2020]
\foreach \n in {1,...,45}{

\begin{textblock}{8}(2,1.25)

  \textblockcolour{mygrey!40}
  \vspace{5mm}
    { \qquad \bfseries Notes : }
  \vspace{26mm}

  \vspace{25mm}
\end{textblock}
\begin{textblock}{15}(2,14.5)

  \textblockcolour{mygrey!40}
  \vspace{2mm}
    { \quad \bfseries Remarques : }
  \vspace{18mm}
\end{textblock}
\enlargethispage{40pt}
\setlength{\arrayrulewidth}{0.5pt}
\arrayrulecolor{black}
\LARGE PLANNING DE LA SEMAINE \n \footnotesize
\begin{tikzpicture}[remember picture, overlay,shift={(5,-3.5)}]
  \calendar (cal)
  [dates=\year-\month-\day to \year-\month-\day+5,day list right,day xshift=3cm,
   execute before day scope=
  {
    \ifdate{Tuesday,Wednesday}{\pgftransformxshift{-3cm}}{}
    },
    day text={},
    execute at begin day scope={
    \ifdate{Monday}{\tikzmonthcode}{}},
    set style={{every month}+=[anchor=base east,font=\bfseries\large,xshift=-2.5em,yshift=12em]},
%  execute after day scope={\ifdate{Sunday}{\pgftransformyshift{-30em},\pgftransformxshift{-10.1cm}}{}}
  ]
  if(Monday) [day text={\mondaytext{\%wt}{\%d0}}]
  if(Thursday) [day text={\thursdaytext{\%wt}{\%d0}}]
  if(Friday) [day text={\fridaytext{\%wt}{\%d0}}]  
  if (weekend) [font=\bfseries]
  if (Sunday) [red];
%  \node[above right,font=\bfseries\footnotesize] at (cal-2020-09-14.north west)
%    {14--18 Septembre 2020};
\end{tikzpicture}
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\\
\setlength{\arrayrulewidth}{0.1pt}
\arrayrulecolor{black!60}
\begin{tabular}{p{19cm}}
\textbf{LUNDI :} \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\\
\textbf{JEUDI :} \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\\
\textbf{VENDREDI :} \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline \\
\hline 
\end{tabular}

\AdvanceDate[7]

\newpage
}

\end{document}

相关内容