![如何实现日历自动化](https://linux22.com/image/458125/%E5%A6%82%E4%BD%95%E5%AE%9E%E7%8E%B0%E6%97%A5%E5%8E%86%E8%87%AA%E5%8A%A8%E5%8C%96.png)
我有这个带有 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}