我正在尝试寻找一个好的选项来排版月历,但能够在其中写下我必须做的事情。我进行了广泛的搜索,找到了很多日历,tikz
但没有一个能满足我的需求。
编辑:
最接近我想要的是这个:
http://www.latextemplates.com/template/monthly-calendar
但我正在尝试修复坏箱,但却做不到。
答案1
通过注释掉 和 原始定义中的一些虚假空格 \dayheader
、在 中\activities
添加缺失值、在 环境 使用的之前添加缺失值和 在 之后添加,我抑制了 33 条警告(其中 32 条关于 未满,1 条关于 过满):\par
\dayheader
\noindent
tabularx
\par
tabularx
calendar
\hbox
\hbox
\documentclass[landscape,a4paper,draft]{article}
\usepackage{calendar} % Use the calendar.sty style
\usepackage[landscape,margin=0.5in]{geometry}
\usepackage{etoolbox}
\patchcmd{\calendar}
{\tabularx}
{\par\noindent\tabularx}
{}
{}
\patchcmd{\endcalendar}
{\endgroup}
{\endgroup\par}
{}
{}
\def\dayheader#1#2{
\begin{minipage}[t]{0.87\hsize}
\raggedright
\textit{#1}
\end{minipage}%
\begin{minipage}[t]{0.13\hsize}
\raggedleft
\textit{#2}
\end{minipage}\par%
}
\def\activities#1{%
\parbox{\linewidth}{\vspace*{5pt}\raggedright\scriptsize #1}\smallskip
}
\begin{document}
\pagestyle{empty} % Removes the page number from the bottom of the page
\StartingDayNumber=1 % Calendar starting day, default of 1 means Sunday, 2 for Monday, etc
%----------------------------------------------------------------------------------------
% MONTH AND YEAR SECTION
%----------------------------------------------------------------------------------------
\begin{center}
\textsc{\LARGE Month}\\ % Month
\textsc{\large Year} % Year
\end{center}
%----------------------------------------------------------------------------------------
\begin{calendar}{\linewidth}
%----------------------------------------------------------------------------------------
% BLANK DAYS BEFORE THE BEGINNING OF THE CALENDAR
%----------------------------------------------------------------------------------------
% This part is very finicky. It 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 bottom lines.
% \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
\setcounter{calendardate}{1} % Start the date counter at 1
\day{Work}{10am Meeting with Boss \\[6pt] 12pm Meeting with Group} % 1 - Example of content
\day{}{\vspace{2.5cm}} % 2
\day{}{\vspace{2.5cm}} % 3
\day{}{\vspace{2.5cm}} % 4
\day{}{\vspace{2.5cm}} % 5
\day{}{\vspace{2.5cm}} % 6
\day{}{\vspace{2.5cm}} % 7
\day{}{\vspace{2.5cm}} % 8
\day{}{\vspace{2.5cm}} % 9
\day{}{\vspace{2.5cm}} % 10
\day{}{\vspace{2.5cm}} % 11
\day{}{\vspace{2.5cm}} % 12
\day{}{\vspace{2.5cm}} % 13
\day{}{\vspace{2.5cm}} % 14
\day{}{\vspace{2.5cm}} % 15
\day{}{\vspace{2.5cm}} % 16
\day{}{\vspace{2.5cm}} % 17
\day{}{\vspace{2.5cm}} % 18
\day{}{\vspace{2.5cm}} % 19
\day{}{\vspace{2.5cm}} % 20
\day{}{\vspace{2.5cm}} % 21
\day{}{\vspace{2.5cm}} % 22
\day{}{\vspace{2.5cm}} % 23
\day{}{\vspace{2.5cm}} % 24
\day{}{\vspace{2.5cm}} % 25
\day{}{\vspace{2.5cm}} % 26
\day{}{\vspace{2.5cm}} % 27
\day{}{\vspace{2.5cm}} % 28
\day{}{\vspace{2.5cm}} % 29
\day{}{\vspace{2.5cm}} % 30
\day{}{\vspace{2.5cm}} % 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{}{\vspace{2.5cm}} % 1
%\day{}{\vspace{2.5cm}} % 2
%\day{}{\vspace{2.5cm}} % 3
%----------------------------------------------------------------------------------------
\finishCalendar
\end{calendar}
\end{document}
答案2
如果您使用 Emacs,它可以生成一个包含 Emacs 日记文件中的约会和截止日期的日历的 latex 源。例如,执行M-x calendar
,将光标放在您想要的星期中的日期上,然后按t f w
以在页面上获取该星期。将光标放在您想要的月份中的日期上,按 以t M
在横向页面上获取该月份。