8

Here is a picture I mad in Scribus how the calender (hopefully) should look like. The red coloured days are sundays. In the left corner the month should be shown. It would be nice if you could help me make it as a template. My greatest problem is using the "\usetikzlibrary{calendar}". If someone could help my use it? I would like to create a done template where I just have to type in year and insert images for all twelve month. So that tikz (thanks to the calendar package) would make all dates (with sundays in red) and all month automatically inserted so it looks like on this picture (the white space is where the image should be placed):

Calender

I tried myself but I just (with help) created the black bar and the white line. The green area is where the image should be (don't know how to do it in tikz).

\documentclass[12pt,a4paper,oneside]{article}
\usepackage[utf8]{inputenc}
\usepackage[landscape, left=0cm,right=0cm,top=0cm,bottom=0cm]{geometry}
\usepackage{tikz}
\usepackage[T1]{fontenc}
\usetikzlibrary{calc}
\begin{document}

\begin{tikzpicture}[remember picture, overlay] 
\fill[black] (current page.south west) rectangle ($(current page.south east) + (0,5cm)$);
\fill[green] (current page.north west) rectangle ($(current page.south east) + (0,5cm)$);
\fill[white] ($(current page.south west) + (30pt, 3cm)$) rectangle ($(current page.south east) + (-30pt, 3.07cm)$);
\node[white] at  ($(current page.south west) + (30pt, 30pt)$) {{\fontsize{30}{25} \scshape \bfseries January}};
%the node doesn't work ... January is not placed correctly. It should be placed at 30pt, 30pt but it is "hiding".
\end{tikzpicture}
\end{document}

So what missing is all the dates and months placed like on the image. And to place the images. As said before would it be nice to create a easy to use template where you just have to type in the year (thanks to tikz calendar package) and manually insert all twelve images. Is that possible? Anyone who can help here?

Kind regards!

PS! I really need some help :-) ... and it would be nice if you could help creating this template because I think it is one of the most common calendar designs where I come from.

  • Nice design! I hope some good hearted guys (or girls) will help you with making it! I would definitely use it! I am a beginner myself so I can not help. But hope to use the done template! Hopefully some one help! – Conrad Kopernikus Dec 6 '14 at 8:14
  • 1
    In \fill [black] (south west)... well south west of what? It's better to write \fill [black] (0,0) rectangle (\textwidth,20pt); or, if you want to decorate the page, write in the preamble \usetikzlibrary{calc} and in the body \begin{tikzpicture}[remember picture, overlay] \fill[black] (current page.south west) rectangle ($(current page.south east) + (0,20pt)$) ; \end{tikzpicture} and compile TWO times. If you read french, you should take a look to "TikZ pour l'impatient", a very, very well written guide. – Astrinus Dec 6 '14 at 8:22
  • The \node doesn't work because before the semicolon you should put braces ({}), not parentheses. – Astrinus Dec 6 '14 at 9:42
  • What is the rule to choose the break day (18 in your example)? – Paul Gaborit Dec 6 '14 at 15:28
8

This might not be the simplest way of doing things and the positioning of the days on the second row probably needs tidying up, but hopefully shows how to proceed to get the required output.

\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{calendar,backgrounds}    
\newcount\daycount
\begin{document}    
\begin{tikzpicture}[background rectangle/.style={fill=black!95}, show background rectangle]
\calendar[%
dates=2015-01-01 to 2015-06-last,
every day/.style={anchor=base west, font=\sffamily},
execute before day scope={
  \ifdate{day of month=1}{%
    % On the first of the month move down...
    \pgftransformyshift{-6em}%
    % ...do the month label...
    \tikzmonthcode%
    % ...and draw the line.
    \draw [line cap=round,white, thick] (0,-.75em) -- (18*2em,-.75em);
  }{}%
},
execute at begin day scope={
  % Grr. \pgfcalendarcurrentday is zero prefixed
  % so the math parser will think it is octal.
  \daycount=\pgfcalendarcurrentday\relax
  % Now shift into position for the current day.
  \pgftransformxshift{(mod(\daycount-1,18)+(\daycount>18)*2.5)*2em}%
  \pgftransformyshift{-floor(\daycount/19)*2em}%
},
every month/.style={anchor=text, yshift=-3em, text=white, font=\rmfamily}
] if (Sunday) [text=red] else [text=white] ;
\end{tikzpicture}
\end{document}

enter image description here

  • Thank you very much! I think I can end my template now :-) ... or I will just ask again ;-) ... but you have solved my main trouble! Thank you very much! – Basilius Sapientia Dec 6 '14 at 18:52
5

This answer is a bit late, but here it is for future users. The code is provided at Github and is based on LuaLaTeX.

Firstly a word about calendars. Most calendars will display a 42 day calendar for a given month and not as shown in the OP's image. They look more like the image below.

enter image description here

The advantage of this type of calendar is that it is easy to see a few days of the month before and after and sundays are easily seen.

Calculations are easier to be made using Lua and a rendering function can easily change the looks of the Calendar and or the language.

The code is a quick hack, but please fork and modify to suit.

Here is the first page.

enter image description here

1

You can make this calendar easily without need to the packages you mentioned. Here is my solution:

enter image description here

%pdflatex

\documentclass[12pt,a4paper]{article}
\usepackage{xcolor}

\color{white}
\pagecolor{black}
\begin{document}
\noindent
\textbf{JANUARY} \\
\noindent\makebox[\linewidth]{\rule{\textwidth}{0.4pt}} \\
1 \hfill 2 \hfill 3 \hfill 4 \hfill 5 \hfill 6 \hfill \textcolor{red}{7} \hfill 8 \hfill 9 \hfill 10 \hfill 11 \hfill 12 \hfill 13 \hfill \textcolor{red}{14} \hfill 15 \hfill 16 \hfill 17 \hfill 18 \\
\noindent\makebox[\linewidth]{\rule{\textwidth}{0.4pt}} \\
19 \hfill 20 \hfill \textcolor{red}{21} \hfill 22 \hfill 23 \hfill 24 \hfill 25 \hfill 26 \hfill 27 \hfill \textcolor{red}{28} \hfill 29 \hfill 30 \hfill 31 \\

\end{document}

Of course, you can use another fonts as well, by using the fontspec package and run it by lualatex:

enter image description here

%lualatex

\documentclass[12pt,a4paper]{article}
\usepackage{xcolor}
\usepackage{fontspec}
\setmainfont{Tahoma}

\color{white}
\pagecolor{black}
\begin{document}
\noindent
\textbf{JANUARY} \\
\noindent\makebox[\linewidth]{\rule{\textwidth}{0.4pt}} \\
1 \hfill 2 \hfill 3 \hfill 4 \hfill 5 \hfill 6 \hfill \textcolor{red}{7} \hfill 8 \hfill 9 \hfill 10 \hfill 11 \hfill 12 \hfill 13 \hfill \textcolor{red}{14} \hfill 15 \hfill 16 \hfill 17 \hfill 18 \\
\noindent\makebox[\linewidth]{\rule{\textwidth}{0.4pt}} \\
19 \hfill 20 \hfill \textcolor{red}{21} \hfill 22 \hfill 23 \hfill 24 \hfill 25 \hfill 26 \hfill 27 \hfill \textcolor{red}{28} \hfill 29 \hfill 30 \hfill 31 \\

\end{document}
  • 3
    Very good, but the actual problem is automatic generation of the months. – Astrinus Dec 6 '14 at 9:11
  • Thank you, but I would like to use tikz because it has a calendar package. I managed to place the black bar and the white line. LaTeX can automatically create the months and days with red coloured Sundays thanks to usetikzlibrary calendar. So I just have to type in the year and insert the images (when the template is done). I know it can because of these examples: texample.net/tikz/examples/feature/calendar-library ... but thank you :-) – Basilius Sapientia Dec 6 '14 at 9:42
  • @BasiliusSapientia I am a fan of tikz and pgfplots and I know that packages can ease our typesetting, but sometimes it is really hard to create what you really want. In case of your question, it is really not easy to break the line at that specific day of the month or add such options to the calendar. So I think that if we can easily typeset what we want without aid of complicated packages, we really don't need to go through those options and packages. – Enthusiastic Engineer Dec 6 '14 at 10:18

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.