挂历样式表

挂历样式表

我想完全用 LaTeX 创建年度挂历,但找不到合适的样式表。我想要一个整页的月度图形环境,每个月自动列出,顶部显示星期几(星期日、星期一……),每个天单元格显示数字(1、2、3……),365 天中的每一天都有小文本或图形环境。分页应对应于典型的挂历,其中每个月的大图形位于顶部,下一页带有相应月份名称和日期块,悬挂在下面。理想情况下,最终的 .eps 或 .pdf 可以直接打印出来并装订,随时可以挂在墙上。

答案1

使用 TikZcalendar库当然可以实现这一点。

需要对长度和尺寸进行一些微调,以使其适合页面。

代码

\documentclass[a4paper,landscape]{article}
\usepackage[margin={1cm},noheadfoot]{geometry}
\renewcommand*\thepage{}
\usepackage{libertine}
\usepackage{tikz}\usetikzlibrary{calendar}
\tikzset{
  every weekday/.style={
    anchor=south west,
    black,
    name=weekday-\pgfcalendarcurrentmonth-\pgfcalendarcurrentweekday,
    node contents=\%wt},
  weekday above/.style={
    if = {(day of month=1) [days={append after command={
          node [at={(\tikzlastnode.north west)},
                alias=@firstweekday,
                every weekday]}}]},
    if = {(day of month=2, day of month=3, day of month=4, day of month=5, day of month=6, day of month=7) [
          days={append after command={
          node [at={(@firstweekday.south west-|\tikzlastnode.south west)}, every weekday]}}]}},
  wall calendar/.style={
    week list, weekday above, day text=,
    day and weekday/.style={
      draw, outer sep=+0pt,
      minimum width=\linewidth/7,
      minimum height=\textheight/8},
    day xshift=\linewidth/7,
    day yshift=\textheight/8,
    every day label/.style={
      anchor=north east,
      font=\Large\itshape,
      node contents={\%d=},
      inner sep=.7em},
    every day/.append style={
      day and weekday,
      label={[every day label]north east:}
    },
    every weekday/.append style={
      day and weekday,
      minimum height=2em}
  }
}
\newcommand*\Year{2022}
\begin{document}\sffamily
\centering
\foreach \mon in {1,...,12}{%
  {\Huge \pgfcalendarmonthname{\mon}\par}
  {\huge \Year\par}
  \vspace{2em}
  \tikz\calendar[
    dates=\Year-0\mon-01 to \Year-0\mon-last,
    wall calendar,
  ];

\pagebreak}
\end{document}

输出

在此处输入图片描述

相关内容