![tikz 日历,月份标签位置](https://linux22.com/image/268251/tikz%20%E6%97%A5%E5%8E%86%EF%BC%8C%E6%9C%88%E4%BB%BD%E6%A0%87%E7%AD%BE%E4%BD%8D%E7%BD%AE.png)
我想使月份标签和日期标题之间的距离更小。
\documentclass{article}
\usepackage[top=3cm, bottom=3cm, left=2cm, right=1cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[serbian]{babel}
\usepackage{tikz}
\usetikzlibrary{calendar}
\usepackage{pdflscape}
\clearpage
\thispagestyle{empty}
\makeatletter%
\tikzoption{day headings}{\tikzstyle{day heading}=[#1]}
\tikzstyle{day heading}=[]
\tikzstyle{day letter headings}=[
execute before day scope={ \ifdate{day of month=1}{%
\pgfmathsetlength{\pgf@ya}{\tikz@lib@cal@yshift}%
\pgfmathsetlength\pgf@xa{\tikz@lib@cal@xshift}%
\pgftransformyshift{-\pgf@ya}
\foreach \d/\l in {0/Ponedeljak,1/Utorak,2/Sreda,3/Četvrtak,4/Petak,5/Subota,6/Nedelja} {
\pgf@xa=\d\pgf@xa%
\pgftransformxshift{\pgf@xa}%
\pgftransformyshift{\pgf@ya}%
\node[every day,day heading]{\small\l};%
}
}{}%
}%
]
\makeatother%
\begin{document}
\begin{landscape}
\begin{center}
\begin{tikzpicture}[scale=6,font=\fontsize{25}{12}\selectfont\bfseries]
\calendar (mycal) [dates=2013-05-01 to 2013-05-31,week list,month label above centered,month text=\textcolor{black}{Maj} \%y-, day yshift = 0.4cm,
day letter headings];
\draw[black, line width=2pt] (mycal-2013-05-08) circle (5pt) +(-5pt,-5pt) rectangle +(5pt,5pt) ;
\draw[black, line width=2pt] (mycal-2013-05-10) circle (5pt);
\draw[black, line width=2pt] (mycal-2013-05-12) circle (5pt);
\draw[black, line width=2pt] (mycal-2013-05-15) circle (5pt);
\draw[black, line width=2pt] (mycal-2013-05-17) circle (5pt);
\draw[black, line width=2pt] (mycal-2013-05-19) circle (5pt);
\draw[black, line width=2pt] (mycal-2013-05-22) circle (5pt);
\draw[black, line width=2pt] (mycal-2013-05-24) circle (5pt);
\end{tikzpicture}
\end{center}
\hfill \Large legenda \\
*Napomena\hfill \begin{tikzpicture}
\draw[black, line width=1pt] circle (6pt);
\end{tikzpicture}~~~termini
Termine je moguće iskoristiti do 8. juna.\hfill \begin{tikzpicture}
\draw[black, line width=1pt] circle (6pt)+(-6pt,-6pt) rectangle +(6pt,6pt);
\end{tikzpicture}~~~početak/kraj termina
\end{landscape}
\end{document}
答案1
如果你将every month/.append style={yshift=-2cm}
key\calendar
作为最后一个选项添加到选项中,则会得到
\calendar (mycal) [dates=2013-05-01 to 2013-05-31,
week list,
month label above centered,
month text=\textcolor{black}{Maj} \%y-,
day yshift = 0.4cm,
day letter headings,
every month/.append style={yshift=-2cm}];