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}
  • There are two curly braces \end{tikzpicture}}! – Sigur Apr 29 '13 at 23:43
  • I'm sorry, typo while pasting. Fixing the code – Mario S. E. Apr 29 '13 at 23:48
  • The problem is still there? – Sigur Apr 29 '13 at 23:49
  • Yeap, unfortunately – Mario S. E. Apr 29 '13 at 23:50
  • @MarioS.E. please add the complete MWE. – cacamailg Apr 29 '13 at 23:52
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

  • 1
    If it is not obvious to you, for me it would be unimaginable. – Sigur Apr 30 '13 at 0:16
  • I second @Sigur. It worked perfectly, but I have no idea why this happens – Mario S. E. Apr 30 '13 at 0:18
  • I actually took the code from: tex.stackexchange.com/a/71039/27833 – Mario S. E. Apr 30 '13 at 0:20
  • @MarioS.E., but there they use only one month. – Sigur Apr 30 '13 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 – Mario S. E. Apr 30 '13 at 0:22

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.