5

I have the following code:

\begin{figure}[t]
\centering  
    \begin{tikzpicture}
            [every calendar/.style={
                 month label above left,
                 month text={\textit{\%mt, \ \%y0}},
                 week list}]
         \calendar[dates=2013-07-01 to 2013-09-last];
        \end{tikzpicture}
    \caption{Calendar}
    \label{fig:Calendar}
\end{figure}

Which produces the following output:

enter image description here

I'm loading \usepackage{tikz} along with \usetikzlibrary{calendar,shapes.geometric}

Any ideas why the label is so misplaced?

UPDATE:

Complete MWE:

\documentclass[a4paper,twoside,11pt,openright]{report}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{tikz}                                   

%Tikz Calendar
    \usetikzlibrary{calendar,shapes.geometric}


\begin{document}
Hola.

\begin{figure}[t]
\centering  
    \begin{tikzpicture}
            [every calendar/.style={
                 month label above left,
                 month text={\textit{\%mt, \ \%y0}},
                 week list}]
         \calendar[dates=2013-07-01 to 2013-09-last];
        \end{tikzpicture}
    \caption{Calendar}
    \label{fig:Calendar}
\end{figure}

\end{document}
9
  • There are two curly braces \end{tikzpicture}}!
    – Sigur
    Commented Apr 29, 2013 at 23:43
  • I'm sorry, typo while pasting. Fixing the code Commented Apr 29, 2013 at 23:48
  • The problem is still there?
    – Sigur
    Commented Apr 29, 2013 at 23:49
  • Yeap, unfortunately Commented Apr 29, 2013 at 23:50
  • @MarioS.E. please add the complete MWE.
    – cacamailg
    Commented Apr 29, 2013 at 23:52

1 Answer 1

3

For some reason that is not obvious to me now, week list should be given before the month label above left. Probably the default spacing is for a different list and then week list comes afterwards making the spacing wrong.

Also you might use /.append style if you are not sure that you are not overwriting anything.

\documentclass{article}
\usepackage{tikz}

\usetikzlibrary{calendar,shapes.geometric}



\begin{document}

    \begin{tikzpicture}[
                 every calendar/.append style={
                 week list,
                 month label above centered,
                 month text={\textit{\%mt, \ \%y0}},
}]
         \calendar[dates=2013-07-01 to 2013-09-last];
    \end{tikzpicture}

\end{document}

enter image description here

6
  • 1
    If it is not obvious to you, for me it would be unimaginable.
    – Sigur
    Commented Apr 30, 2013 at 0:16
  • I second @Sigur. It worked perfectly, but I have no idea why this happens Commented Apr 30, 2013 at 0:18
  • I actually took the code from: tex.stackexchange.com/a/71039/27833 Commented Apr 30, 2013 at 0:20
  • @MarioS.E., but there they use only one month.
    – Sigur
    Commented Apr 30, 2013 at 0:21
  • @Sigur Yeap, but when you use more than one then you have this error that I showed in this question. I'm really new to the tikz package, so I have no idea what I'm doing here Commented Apr 30, 2013 at 0:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .