2

I am trying to find a good option to typeset a monthly calendar but with the ability to write in its days what I have to do. I have searched extensively and I have found a lot of calendars with tikz but there was none to match my needs.

Edit:

The closest to what I want is this:

http://www.latextemplates.com/template/monthly-calendar

but I am trying to fix the badboxes and I can't.

  • 1
    Perhaps something at tex.stackexchange.com/questions/843/… would help? Otherwise, please add a minimal working example (MWE) that illustrates your problem. It is hard to know which bad boxes you are trying to fix if you don't tell us how you are creating them. – cfr May 4 '14 at 1:47
  • I have already checked everything that is on this site. If you run the code on Monthly Calendar in my link you will see the badboxes. – Adam May 4 '14 at 1:50
4

By commenting out some spurious blank spaces in the original definitions of \dayheader and \activities, and adding a missing \par in \dayheader, and adding a missing \noindent before the tabularx and a \par after the tabularx used by the calendar environment , I suppressed 33 warnings (32 about underfull \hboxes and one about an overfull \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}

enter image description here

1

If you use Emacs, it can produce latex source for a calendar populated with the appointments and deadlines in your Emacs diary file. For example, do M-x calendar, put your cursor on a date in the week you want, and press t f w to get the week on a page. And with your cursor on a date in the month you want, press t M for the month on a page in landscape.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.