summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calendar.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calendar.tex')
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calendar.tex90
1 files changed, 48 insertions, 42 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calendar.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calendar.tex
index 6d1f3a3f4f4..5037bef78b9 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calendar.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-calendar.tex
@@ -101,7 +101,7 @@ say, the |\draw| command).
arrangement is a bit tricky, it is explained only later on. For the time
being, let us use a predefined arrangement to produce our first calendar:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list];
\end{codeexample}
@@ -116,7 +116,7 @@ say, the |\draw| command).
Specifies the horizontal shift between days. This is not the gap
between days, but the shift between the anchors of their nodes.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,day xshift=3ex];
\end{codeexample}
\end{key}
@@ -125,7 +125,7 @@ say, the |\draw| command).
Specifies the vertical shift between days. Again, this is the shift
between the anchors of their nodes.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,day yshift=2ex];
\end{codeexample}
\end{key}
@@ -137,12 +137,12 @@ say, the |\draw| command).
\begin{key}{/tikz/month yshift=\meta{dimension}}
Specifies an additional vertical shift between different months.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz \calendar[dates=2000-01-01 to 2000-02-last,week list,
month yshift=0pt];
\end{codeexample}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz \calendar[dates=2000-01-01 to 2000-02-last,week list,
month yshift=1cm];
\end{codeexample}
@@ -169,7 +169,7 @@ say, the |\draw| command).
the whole matrix. For example, the following calendar is placed in such a
way the center of 2000-01-20 lies on the position $(2,2)$:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\begin{tikzpicture}
\draw[help lines] (0,0) grid (3,2);
\matrix [anchor=cal-2000-01-20.center] at (2,2)
@@ -195,7 +195,7 @@ say, the |\draw| command).
day. The default is to create a node with an appropriate name, but you
can change this:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,
day code={\fill[blue] (0,0) circle (2pt);}];
\end{codeexample}
@@ -217,7 +217,7 @@ say, the |\draw| command).
been named |mycal|, then the node containing the |1| for this date will
be names |mycal-2006-01-01|. You can later reference this node.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\begin{tikzpicture}
\calendar (mycal) [dates=2000-01-01 to 2000-01-31,week list];
@@ -231,7 +231,7 @@ say, the |\draw| command).
macro simply yields the current day of month, but you can change it
arbitrarily. Here is a silly example:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,
day text=x];
\end{codeexample}
@@ -255,7 +255,7 @@ say, the |\draw| command).
Let us redefine the |day text| so that it yields the day with a leading
zero:
%
-\begin{codeexample}[leave comments]
+\begin{codeexample}[leave comments,preamble={\usetikzlibrary{calendar}}]
\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,
day text=\%d0];
\end{codeexample}
@@ -266,7 +266,7 @@ say, the |\draw| command).
|every day| style is useful for changing the way days look. For
example, let us make all days red:
%
-\begin{codeexample}[leave comments]
+\begin{codeexample}[leave comments,preamble={\usetikzlibrary{calendar}}]
\tikz[every day/.style=red]
\calendar[dates=2000-01-01 to 2000-01-31,week list];
\end{codeexample}
@@ -280,7 +280,7 @@ say, the |\draw| command).
per month or year and this is not done by default. Rather, special styles
starting with |month label| place these labels and make them visible:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz \calendar[dates=2000-01-01 to 2000-02-last,week list,
month label above centered];
\end{codeexample}
@@ -305,7 +305,7 @@ say, the |\draw| command).
default, the month text is a long textual presentation of the current
month being typeset.
%
-\begin{codeexample}[leave comments]
+\begin{codeexample}[leave comments,preamble={\usetikzlibrary{calendar}}]
\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,
month label above centered,
month text=\textcolor{red}{\%mt} \%y-];
@@ -385,7 +385,7 @@ say, the |\draw| command).
Let us now have a look at some examples. First, we use a conditional to
make all Sundays red.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz
\calendar
[dates=2000-01-01 to 2000-01-31,week list]
@@ -394,7 +394,7 @@ say, the |\draw| command).
%
Next, let us do something on a specific date:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz
\calendar
[dates=2000-01-01 to 2000-01-31,week list]
@@ -407,7 +407,7 @@ say, the |\draw| command).
|base east| anchor, which shifts the label up and right. To overcome this
problem we can change the anchor:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz [every day/.style={anchor=mid}]
\calendar
[dates=2000-01-01 to 2000-01-31,week list]
@@ -496,7 +496,7 @@ this, we simply shift the coordinate system downward at the end of the code for
each day. This shift must be \emph{outside} the day scope as we want day shifts
to accumulate. Thus, we use the following code:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz
\calendar [dates=2000-01-01 to 2000-01-08,
execute after day scope=
@@ -523,7 +523,7 @@ beginning of the day scope or before. Either will work fine, but it might be
safer to put the code inside the scope to ensure that settings to not
inadvertently ``leak outside''.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz
\calendar
[dates=2000-01-01 to 2000-01-08,
@@ -555,7 +555,7 @@ at the beginning. To position each day correctly, we use code inside and at the
beginning of the day scope to horizontally shift the day according to its day
of week.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz
\calendar
[dates=2000-01-01 to 2000-01-20,
@@ -583,7 +583,7 @@ by its day of month. Furthermore, we must additionally shift the day to ensure
that the first day of the month lies on the correct day of week column. For
this, we remember this day of week the first time we see it.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\newcount\mycount
\tikz
\calendar
@@ -610,7 +610,7 @@ this, we remember this day of week the first time we see it.
\subsection{Arrangements}
An \emph{arrangement} specifies how the days of calendar are arranged on the
-page. The calendar library defines a number of predefined arrangements.
+page. The |calendar| library defines a number of predefined arrangements.
We start with arrangements in which the days are listed in a long line.
@@ -619,7 +619,7 @@ We start with arrangements in which the days are listed in a long line.
The shift between days is given by |day yshift|. Between month an
additional shift of |month yshift| is added.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz
\calendar [dates=2000-01-28 to 2000-02-03,
day list downward,month yshift=1em];
@@ -630,7 +630,7 @@ We start with arrangements in which the days are listed in a long line.
\begin{stylekey}{/tikz/day list upward}
Works as above, only the list grows upward instead of downward.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz
\calendar [dates=2000-01-28 to 2000-02-03,
day list upward,month yshift=1em];
@@ -643,7 +643,7 @@ We start with arrangements in which the days are listed in a long line.
Instead of |day yshift| and |month yshift|, the values of |day xshift| and
|month xshift| are used.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz
\calendar [dates=2000-01-28 to 2000-02-03,
day list right,month xshift=1em];
@@ -675,12 +675,12 @@ The next arrangement lists days by the week.
additional vertical space of |month yshift| is added. If this is set to
|0pt| you get a continuous list of days.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz
\calendar [dates=2000-01-01 to 2000-02-last,week list];
\end{codeexample}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz
\calendar [dates=2000-01-01 to 2000-02-last,week list,
month yshift=0pt];
@@ -701,7 +701,7 @@ The following arrangement gives a very compact view of a whole year.
does not start with a Monday, its days are shifted to the right such that
the days lie on the correct columns.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\sffamily\scriptsize
\tikz
\calendar [dates=2000-01-01 to 2000-12-31,
@@ -730,7 +730,7 @@ labels:
position is chosen ``as if'' the month had started on a Monday -- which is
usually exactly what you want.)
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz
\calendar [dates=2000-01-28 to 2000-02-03,
day list downward,month yshift=1em,
@@ -743,7 +743,7 @@ labels:
This style works like the above style, only the label is rotated
counterclockwise by 90 degrees.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz
\calendar [dates=2000-01-28 to 2000-02-03,
day list downward,month yshift=1em,
@@ -758,7 +758,7 @@ labels:
the right of the first day, for a week list it is to the right of the first
week, and for a month list it is to the right of the whole month.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz
\calendar [dates=2000-01-28 to 2000-02-03,
day list downward,month yshift=1em,
@@ -770,7 +770,7 @@ labels:
\begin{stylekey}{/tikz/month label right vertical}
Works as above, only the label is rotated clockwise by 90 degrees.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz
\calendar [dates=2000-01-28 to 2000-02-03,
day list downward,month yshift=1em,
@@ -785,14 +785,14 @@ labels:
raised is fixed to |1.25em|; use the |yshift| option with the month node to
modify this.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz
\calendar [dates=2000-01-28 to 2000-02-03,
day list right,month xshift=1em,
month label above left];
\end{codeexample}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz
\calendar [dates=2000-01-20 to 2000-02-10,
week list,month label above left];
@@ -804,13 +804,13 @@ labels:
Works as above, only the label is centered above the row containing the
first day.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz
\calendar [dates=2000-02-01 to 2000-02-last,
day list right,month label above centered];
\end{codeexample}
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz
\calendar [dates=2000-01-20 to 2000-02-10,
week list,month label above centered];
@@ -821,7 +821,7 @@ labels:
\begin{stylekey}{/tikz/month label above right}
Works as above, but flushed right
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz
\calendar [dates=2000-01-20 to 2000-02-10,
week list,month label above right];
@@ -834,7 +834,7 @@ labels:
row. This placement is not really useful with the |week list| arrangement,
but rather with the |day list right| or |month list| arrangement.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz
\calendar [dates=2000-02-01 to 2000-02-last,
day list right,month label below left];
@@ -845,7 +845,7 @@ labels:
\begin{stylekey}{/tikz/month label below centered}
Works like |month label above centered|, only below.
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\tikz
\calendar [dates=2000-02-01 to 2000-02-last,
day list right,month label below centered];
@@ -863,7 +863,10 @@ Let us start with a year-2100-countdown, in which we cross out dates as we
approach the big celebration. For this, we set the shape to |strike out| for
these dates.
%
-\begin{codeexample}[leave comments]
+\begin{codeexample}[
+ leave comments,
+ preamble={\usetikzlibrary{calendar,shapes.misc}},
+]
\begin{tikzpicture}
\calendar
[
@@ -882,7 +885,10 @@ current date. The last three days before the deadline are in red, because we
really should be done by then. All days on which we can no longer work on the
project are crossed out.
%
-\begin{codeexample}[leave comments]
+\begin{codeexample}[
+ leave comments,
+ preamble={\usetikzlibrary{calendar,shapes.misc}},
+]
\begin{tikzpicture}
\calendar
[
@@ -904,7 +910,7 @@ project are crossed out.
The following example is a futuristic calendar that is all about circles:
%
-\begin{codeexample}[]
+\begin{codeexample}[preamble={\usetikzlibrary{calendar}}]
\sffamily
\colorlet{winter}{blue}
@@ -952,7 +958,7 @@ The following example is a futuristic calendar that is all about circles:
Next, let's us have a whole year in a tight column:
%
-\begin{codeexample}[leave comments]
+\begin{codeexample}[leave comments,preamble={\usetikzlibrary{calendar}}]
\begin{tikzpicture}
\small\sffamily
\colorlet{darkgreen}{green!50!black}