Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

There is probably something simple I'm missing, but I have tried several variations, and I can't seem to get the following right.

This is some minimal code that demonstrates the problem:

\documentclass{article}
\usepackage[dutch]{babel}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes}
\usetikzlibrary{positioning,calendar,er}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{shapes.geometric}

\newcommand{\training}{\node [anchor=base,fill=lightgray,draw=lightgray,rounded corners=0pt,inner sep=0pt,minimum size=10pt] {};}

\begin{document}
\begin{center}
\begin{tikzpicture}[every calendar/.style={week list},every day/.style={anchor=mid,day text={\%d=}}]
\calendar (juni) [dates=2012-06-01 to 2012-06-last] if (Wednesday) {\training};

\end{tikzpicture}

\end{center}

\end{document} 

which gives

enter image description here

The problem is that I can't seem to get the training-nodes and the days to properly align vertically. This is the best I can get them, but the number of the day is placed at the top of the training-node, while I want them to be centred vertically.

I've tried several combinations of anchors for the training nodes and the every day-style. Any help is greatly appreciated.

share|improve this question
add comment

1 Answer

up vote 8 down vote accepted

Change the line

\begin{tikzpicture}[every calendar/.style={week list},every day/.style={anchor=mid,day text={\%d=}}]

to

\begin{tikzpicture}[every calendar/.style={week list},every day/.style={anchor=center,day text={\%d=}}]

In other words, you need to change the anchor to center instead of mid.

This is the updated figure:

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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