calendar.sty 具有一致的高度间距

calendar.sty 具有一致的高度间距

我在用着月历模板

我正在尝试使用我生成的内容制作一个可打印的日历。每天都有内容。我使用的是 calendar.sty,如果它是空的,它看起来会很漂亮很干净(并且有空的日子可以有\vspace{2.5cm})。但是 vspace 不会设置单元格的最大高度,而只是为已经存在的文本添加空间,所以我不能使用它。

使用如下所示的 calendar_1.tex 文件(为简洁起见,仅给出与示例有所差异的部分):

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Monthly Calendar
% LaTeX Template
% Version 1.1 (19/9/2018)
%
% This template was downloaded from:
% http://www.LaTeXTemplates.com
%
% Original author:
% Evan Sultanik with modifications by 
% Vel ([email protected])
%
% License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%
% Important note:
% This template requires the calendar.sty file to be in the same directory as the
% .tex file. The calendar.sty file provides the necessary structure to create the
% calendar.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%----------------------------------------------------------------------------------------
%   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\documentclass[10pt]{article} % Can also use 9pt or 11pt for a smaller or larger overall font size

\usepackage{calendar} % Use the calendar.sty style

\usepackage[landscape, a4paper, margin=1cm]{geometry} % Page dimensions and margins

\usepackage{palatino} % Use the Palatino font

\begin{document}

\pagestyle{empty} % Disable default headers and footers

\setlength{\parindent}{0pt} % Stop paragraph indentation

\StartingDayNumber=1 % The starting day of the calendar, default of 1 means Sunday, 2 for Monday, etc

%----------------------------------------------------------------------------------------
%   CALENDAR HEADER
%----------------------------------------------------------------------------------------

\begin{center}
    \textsc{\LARGE Month}\\ % Month
    \textsc{\large Year} % Year
\end{center}

%----------------------------------------------------------------------------------------

\begin{calendar}{\textwidth} % Calendar to be the entire width of the page

%----------------------------------------------------------------------------------------
%   BLANK DAYS BEFORE THE BEGINNING OF THE CALENDAR
%----------------------------------------------------------------------------------------

% This part defines the number of blank days at the beginning of the calendar before the first of the month starts. If you need this to be more than 4 (i.e. the first starts on a Friday or Saturday in a 31 day month), then you have two options: 
% 1) You can uncomment another one or two \BlankDay's below which will make a new week (6 total) which makes the calendar too big for one page, remedy this by decreasing the size of each day by replacing 2.5cm below with a smaller number. 
% 2) Make the spill-over days start at the top left of the calendar (i.e. the calendar starts with 31 then a few days blank then 1, 2, 3, etc). The second option can be configured by uncommenting the below:

%\setcounter{calendardate}{31} % Begin the count with 31 so the top left day is 31; this can be changed to 29 or 30 as required
%\day{}{\vspace{2.5cm}} % 31 - add another line identical to this if starting at 30 or earlier

% You will need to comment out the 31 in the NUMBERED DAYS AND CALENDAR CONTENT section below for this as well as commenting out one of the \BlankDay's below. Play around with it and you will get it.

\BlankDay
\BlankDay
%\BlankDay
%\BlankDay
%\BlankDay
%\BlankDay

%----------------------------------------------------------------------------------------
%   NUMBERED DAYS AND CALENDAR CONTENT
%----------------------------------------------------------------------------------------

% These are the numbered days in the template - if there are less than 31 days simply comment out the days that aren't needed

% \vspace{2.5cm} is only there to provide an even look to the calendar where each day is 2.5cm tall, it can be changed or removed to automatically adjust to the day in the week with the most content

% Use \eventskip instead of \\ for newlines between events

\setcounter{calendardate}{1} % Start the date counter at 1

\day{Work}{10am Meeting with Boss \eventskip 12pm TPS Report Due} % 1 - Example of content: first argument is the heading, then the content of the day
\day{Work}{9am Team Standup Meeting \eventskip \dayheader{Social}{}\eventskip 5:30pm Tennis with John, Janet and James} % 2 - Example of day with multiple headings
\day{}{Happy } % 3
\day{}{Happy } % 4
\day{}{Happy } % 5
\day{}{Happy Sunday} % 6
\day{}{Happy Monday} % 7
\day{}{Happy Tuesday} % 8
\day{}{Happy Wednesday, otherwise known as hump day that will make the whole row taller} % 9
\day{}{Happy Thursday} % 10
\day{}{Happy Friday Friday Friday} % 11
\day{}{Happy Saturday} % 12
\day{}{Happy } % 13
\day{}{Happy } % 14
\day{}{Happy } % 15
\day{}{Happy } % 16
\day{}{Happy } % 17
\day{}{Happy } % 18
\day{}{Happy } % 19
\day{}{Happy } % 20 
\day{}{Happy } % 21
\day{}{Happy Day before vspace day} % 22
\day{}{Happy vspace 2.5cm day\vspace{2.5cm}} % 23
\day{}{Happy Day after vspace day} % 24
\day{}{Happy Two days after vspace with lots of wrapping and wrapping etc} % 25
\day{}{Happy } % 26
\day{}{Happy } % 27
\day{}{Happy } % 28
\day{}{Happy } % 29 
\day{}{Happy } % 30 
\day{}{Happy } % 31

% Un-comment the \BlankDay below if the bottom line of the calendar is missing
%\BlankDay

% Un-comment to start counting again after 31
%\setcounter{calendardate}{1}
%\day{}{Happy } % 1
%\day{}{Happy } % 2
%\day{}{Happy } % 3

%----------------------------------------------------------------------------------------

\finishCalendar
\end{calendar}
\end{document}

输出如下所示:

输出图像

我理想情况下希望所有单元格大小相同,并能扩展以适合页面。如果它们大小相同,我会很高兴。每天的内容量会有所不同,有些日子的内容量比其他日子多得多。

答案1

我发现的最佳解决方案(感谢 David Carlisle)是修改 calendar.sty。在

\def\day##1##2{

宏,我改变了这一行:

\activities{##2}

\activities{\parbox[t][2.5cm]{\hsize}{##2}}

相关内容