如何更改 pgfcalendar 中的日期间距?

如何更改 pgfcalendar 中的日期间距?

我在 pgfcalendar 教程中没有找到任何更改日期间距的选项,有人可以建议我如何更改日期之间的间距吗?这是 MWE

 \documentclass[border=4.9mm, multi={tikzpicture}]{standalone}
 %\usepackage[hmargin=2cm,bmargin=3cm,tmargin=4.5cm,centering,a4paper]{geometry}
 \usepackage[utf8]{inputenc}
 \usepackage{xcolor}

 %%in preamble:
 %
 \usepackage{tikz}
 \usetikzlibrary{positioning,calendar}
 \usetikzlibrary{decorations.markings}

 \newcommand{\calrow}[1]{\node[anchor=base east](Mon){\rotatebox{0}{M}};
 \node[base right=of Mon](Tue){\rotatebox{0}{T}}; \node[base right=of Tue](Wed){W};
 \node[base right=of Wed](Thu){T}; \node[base right=of Thu](Fri){F};
 \node[base right=of Fri](Sat){S}; \node[base right=of Sat](Sun){\color{red}S};
 \node[darkgreen,above=of Wed]{\textbf{#1}};}

 \newcommand{\calperiod}[1]{\calendar[dates=\the\year-#1-01 to \the\year-#1-last]
 if(Sunday) [red] \holidays;}

 \newcommand{\holidays}{% holidays in Italy
 if (equals=01-01) [black!50]%
 if (equals=01-06) [black!50]%
 if (equals=04-04) [black!50]%
 if (equals=04-05) [black!50]%
 if (equals=04-25) [black!50]%
 if (equals=05-01) [black!50]%
 if (equals=05-01) [black!50]%
 if (equals=06-02) [black!50]%
 if (equals=08-15) [black!50]%
 if (equals=11-01) [black!50]%
 if (equals=12-08) [black!50]%
 if (equals=12-25) [black!50]%
 if (equals=12-26) [black!50]%
 }

 \colorlet{darkgreen}{green!50!black}
 \year=2017
 \begin{document}
 %%in document:
 %
 \begin{tikzpicture}[every calendar/.style={week list}]
 \sffamily
 \matrix[%
 row 1/.style={darkgreen,node distance=.3ex},%
 row 3/.style={darkgreen,node distance=.3ex},
 row 5/.style={darkgreen,node distance=.3ex},
 row 7/.style={darkgreen,node distance=.3ex},
 column sep=1ex,%
 draw=darkgreen,thick, rectangle=9.5pt,%
 postaction={decorate,decoration={markings,mark=at position 0.61 with
 {\node[fill=white,text=blue,font={\bfseries\Large}] (year) {\the\year};}
 }},
 % year on frame: decorations.markings library
 ]{%

 % first row: week day and month
 \calrow{\color{blue}Arkoi} & \calrow{\color{blue}Thangthang} & \calrow{\color{blue}Therepo} \\
 \calperiod{01} & \calperiod{02} & \calperiod{03} \\[1ex]


 % second row: calendar
 \calrow{\color{blue}Jangmi} & \calrow{\color{blue}Aru} & \calrow{\color{blue}Vosik} \\
 \calperiod{04} & \calperiod{05} & \calperiod{06} \\[1ex]

 % third row: week day and month
 \calrow{\color{blue}Jakhong} & \calrow{\color{blue}Paipai} & \calrow{\color{blue}Chiti} \\
 \calperiod{07} & \calperiod{08} & \calperiod{09} \\[1ex]


 % forth row: calendar
 \calrow{\color{blue}Phere} & \calrow{\color{blue}Phaikuni} & \calrow{\color{blue}Matijong} \\
 \calperiod{10} & \calperiod{11} & \calperiod{12} \\
 };

 \end{tikzpicture}

 \end{document}

答案1

您可以在 PGF 手册的第 45 节中找到答案。代码中有趣的一行如下:

\begin{tikzpicture}[every calendar/.style={week list}]

您可以在此处添加一些样式选项。例如,关于日期间距day xshiftday yshift(下图中设置为 1pt)。

小日历

或者您可能想调整月份之间的转换。使用month xshiftmonth yshift(下图中为 xshift 10em)。

移位

随便玩玩

相关内容