我有这个带有 tikz 的日历,我想让它更新到实际日期,而无需手动执行。这是日历
\documentclass[10pt]{article} % Can also use 11pt for a larger overall font size
\usepackage{tikz}
\usetikzlibrary{calendar,shapes.misc}
\begin{document}
\begin{tikzpicture}
\calendar
[
dates=2022-11-01 to 2022-11-last,
week list,inner sep=2pt,month label above centered,
month text=\%mt \%y0
]
if (at most=2022-11-30) [nodes={strike out,draw}]
if (weekend) [black!50,nodes={draw=none}]
;
\end{tikzpicture}
\end{document}
答案1
改编
pgfcalendar
定义\year
,\month
并\day
表示当前年、月、日,可以使用
结果
代码
\documentclass[10pt]{article} % Can also use 11pt for a larger overall font size
\usepackage{tikz}
\usetikzlibrary{calendar,shapes.misc}
\begin{document}
\begin{tikzpicture}
\calendar
[
dates=\year-\month-01 to \year-\month-last,
week list,inner sep=2pt,month label above centered,
month text=\%mt \%y0
]
if (at most=\year-\month-\day) [nodes={strike out,draw}]
if (weekend) [black!50,nodes={draw=none}]
;
\end{tikzpicture}
\end{document}