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.

Following the Tikz & Pgf manual, the tutorial on mindmaps - after adding calendar, the mindmaps are gone!

Does anyone have the full LaTeX code for these examples? It is really frustrating...

Here is my code:

\documentclass{article}%
\usepackage{tikz}
\usetikzlibrary{mindmap, trees, calendar, shadows, backgrounds, calendar}

% Define macro for annotations
% #1 - number of the lecture
% #2 - name of the lecture
% #3 - positioning options, like 'above'
% #4 - position where node is placed
% #5 - list of items to be shown
% #6 - date when the lecture will be held
\def\lecture#1#2#3#4#5#6{
    \node[annotation, #3, scale=0.65, text width=4cm, inner sep=2mm] at (#4) {
        Lecture #1: \textcolor{orange}{\textbf{#2}}
        \list{--}{\topsep=2pt\itemsep=0pt\parsep=0pt
        \parskip=0pt\labelwidth=8pt\leftmargin=8pt
        \itemindent=0pt\labelsep=2pt}
        #5
        \endlist
    };
    % Place in calendar
    \node [anchor=base west] at (cal-#6.base east) {\textcolor{orange}{\textbf{#2}}};
}

\begin{document}
\noindent
\begin{tikzpicture}
    \begin{scope}[mindmap,
        % set every node to be a concept node!
        every node/.style ={concept, circular drop shadow, execute at begin node=\hskip0pt},
        root concept/.append style={concept color=black, line width=1ex, fill=white, text=black, font=\large\scshape},
        text=white,
        % define different colors
        styleA/.style={concept color=red,faded/.style={concept color=red!50}},
        styleB/.style={concept color=blue,faded/.style={concept color=blue!50}},
        styleC/.style={concept color=orange,faded/.style={concept color=orange!50}},
        styleD/.style={concept color=green!50!black,faded/.style={concept color=green!50!black!50}},
        grow cyclic,
        level 1/.append style={level distance=4.5cm, sibling angle=90},
        level 2/.append style={level distance=3cm, sibling angle=45, font=\scriptsize}
    ]
    \node [root concept]  (CompSci) {CompSci} % root
        child [styleA] { node (Hard Ware) {Hard Ware}
                    child {node {nodes} }
                    child [faded] {node {in} }
                    child {node {first} }
                    child {node {tree} }
        }
        child [styleB] { node (Lower Part) {Lower Part}
                child {node {nodes} }
                child {node {in} }
                child [faded] {node {first} }
                child {node {tree} }
        }
        child [styleC] { node (Robot) {Robot}
                child {node {nodes} }
                child [faded] {node {in} }
                child {node {first} }
                child {node {tree} }
        }
        child [styleD] { node (Head) {Head}
                    child [faded] {node {secondary} }
                    child {node {tree} }
                    child {node {nodes} }
        };

    \end{scope}

    % Calendar
    \tiny
    \calendar [day list downward,
                month text=\% mt\ \%y0,
                month yshift=3.5em,
                name=cal,
                at={(-5.\textwidth-5mm,.5\textheight-1cm)},
                dates=2009-04-01 to 2009-05-last]
    if (weekend)
        [black!25];
    if (day of month=1){
        \node at (0pt,1.5em) [anchor=base west] {\small\tikzmonthtext};
    };

    \lecture{1}{Hardware topics}{above,xshift=-3mm}
    {Hard Ware.north}
    {
        \item Hardware introduction
        \item Blah introduction
        \item More blah introduction
    }{2009-04-08}

    \begin{pgfonlayer}{background}
        % Clip the background so as not to enlarge the page
        \clip[xshift=-1cm] (-.5\textwidth,-.5\textheight) rectangle ++(\textwidth,\textheight);
        \colorlet{upperleft}{green!50!black!25}
        \colorlet{upperright}{orange!25}
        \colorlet{lowerleft}{red!25}
        \colorlet{lowerright}{blue!25}
        % The large rectangles
        \fill [upperleft] (CompSci) rectangle ++ (-20, 20);
        \fill [upperright] (CompSci) rectangle ++(20, 20);
        \fill [lowerleft] (CompSci) rectangle ++(-20, -20);
        \fill [lowerright] (CompSci) rectangle ++(20, -20);

        % the shadings
        \shade [left color=upperleft,right color=upperright]
            ([xshift=-1cm]CompSci) rectangle ++(2,20);
        \shade [left color=lowerleft, right color=lowerright]
            ([xshift=-1cm]CompSci) rectangle ++(2, -20);
        \shade [top color=upperleft,bottom color=lowerleft]
            ([yshift=-1cm]CompSci) rectangle ++(-20, 2);
        \shade [top color=upperright, bottom color=lowerright]
            ([yshift=-1cm]CompSci) rectangle ++(20,2);
    \end{pgfonlayer}

\end{tikzpicture}
\end{document}

And here is the output: empty output

share|improve this question

1 Answer 1

up vote 2 down vote accepted

The problem was with the line:

at={(-5.\textwidth-5mm,.5\textheight-1cm)},

Of course - it's just a simple dot, misplaced: -5. instead of -.5:

at={(-.5\textwidth-5mm,.5\textheight-1cm)},

Too bad there are no error messages that prevent this thing from happening.

Also, the source code for the examples can be found in the zip download file, in the doc/generic/pgf/text-en, and in my case the file was called pgfmanual-en-tutorial-map.text.

share|improve this answer

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.