diff options
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.tex | 96 |
1 files changed, 48 insertions, 48 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 679a22a0332..a61feb19de7 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 @@ -26,7 +26,7 @@ The core command for creating calendars in \tikzname\ is the |\calendar| command. It is available only inside |{tikzpicture}| -environments (similar to, say, the |\draw| command). +environments (similar to, say, the |\draw| command). \begin{command}{\calendar \meta{calendar specification}|;|} The syntax for this command is similar to commands like |\node| or @@ -43,14 +43,14 @@ environments (similar to, say, the |\draw| command). \item |[|\meta{options}|]| You provide \meta{options} in square brackets as - in |[red,draw=none]|. These \meta{options} can be any \tikzname\ + in |[red,draw=none]|. These \meta{options} can be any \tikzname\ option and they apply to the whole calendar. You can provide this element multiple times, the effect accumulates. \item |(|\meta{name}|)| This has the same effect as saying |[name=|\meta{name}|]|. The effect of providing a \meta{name} is explained later. Note - alreadys that \emph{a calendar is not a node} and the \meta{name} + already that \emph{a calendar is not a node} and the \meta{name} is \emph{not the name of a node}. \item |at (|\meta{coordinate}|)| @@ -65,7 +65,7 @@ environments (similar to, say, the |\draw| command). \begin{stylekey}{/tikz/every calendar (initially \normalfont empty)} This style is used with every calendar. \end{stylekey} - + \medskip \textbf{The date range.} The overall effect of the |\calendar| command is to execute code for @@ -88,20 +88,20 @@ environments (similar to, say, the |\draw| command). current date code is executed, which will be called the \emph{current date code}. The current date code consists of different parts, to be detailed later. - + The central part of the current date code is the execution of the code |\tikzdaycode|. By default, this code simply produces a node whose text is set to the day of month. This means that unless further action is taken, all days of a calendar will be put on top of each other! To avoid this, you must modify the current date code to shift - days around appropriately. Predefined arrangements like + days around appropriately. Predefined arrangements like |day list downward| or |week list| do this for you, but you can define arrangements yourself. Since defining an 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}[] -\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list]; +\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list]; \end{codeexample} \medskip @@ -114,7 +114,7 @@ environments (similar to, say, the |\draw| command). horizontal shift between days. This is not the gap between days, but the shift between the anchors of their nodes. \begin{codeexample}[] -\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,day xshift=3ex]; +\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,day xshift=3ex]; \end{codeexample} \end{key} \begin{key}{/tikz/day yshift=\meta{dimension} (initially 3ex)} @@ -122,7 +122,7 @@ environments (similar to, say, the |\draw| command). vertical shift between days. Again, this is the shift between the anchors of their nodes. \begin{codeexample}[] -\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,day yshift=2ex]; +\tikz \calendar[dates=2000-01-01 to 2000-01-31,week list,day yshift=2ex]; \end{codeexample} \end{key} \begin{key}{/tikz/month xshift=\meta{dimension}} @@ -131,14 +131,14 @@ environments (similar to, say, the |\draw| command). \end{key} \begin{key}{/tikz/month yshift=\meta{dimension}} Specifies an - additional vertical shift between different months. + additional vertical shift between different months. \begin{codeexample}[] \tikz \calendar[dates=2000-01-01 to 2000-02-last,week list, - month yshift=0pt]; + month yshift=0pt]; \end{codeexample} \begin{codeexample}[] \tikz \calendar[dates=2000-01-01 to 2000-02-last,week list, - month yshift=1cm]; + month yshift=1cm]; \end{codeexample} \end{key} @@ -164,15 +164,15 @@ environments (similar to, say, the |\draw| command). placed in such a way the center of 2000-01-20 lies on the position $(2,2)$: \begin{codeexample}[] -\begin{tikzpicture} +\begin{tikzpicture} \draw[help lines] (0,0) grid (3,2); \matrix [anchor=cal-2000-01-20.center] at (2,2) { \calendar(cal)[dates=2000-01-01 to 2000-01-31,week list]; \\}; \end{tikzpicture} \end{codeexample} Unfortunately, the matrix-base positions, which is the cleanest way, - isnot as portable as the other approaches (it currently does not - work with the \textsc{svg} backend for instance). + isn't as portable as the other approaches (it currently does not + work with the \textsc{svg} backend for instance). \medskip \textbf{Changing the appearance of days.} @@ -187,7 +187,7 @@ environments (similar to, say, the |\draw| command). name, but you can change this: \begin{codeexample}[] \tikz \calendar[dates=2000-01-01 to 2000-01-31,week list, - day code={\fill[blue] (0,0) circle (2pt);}]; + day code={\fill[blue] (0,0) circle (2pt);}]; \end{codeexample} The default code is the following: \begin{codeexample}[code only] @@ -201,7 +201,7 @@ environments (similar to, say, the |\draw| command). day that is currently being processed in ISO format . For example, if January 1, 2006 is being processed and the - calendar has been named |mycal|, then the node containg the |1| + calendar has 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}[] @@ -219,7 +219,7 @@ environments (similar to, say, the |\draw| command). change it arbitrarily. Here is a silly example: \begin{codeexample}[] \tikz \calendar[dates=2000-01-01 to 2000-01-31,week list, - day text=x]; + day text=x]; \end{codeexample} More useful examples are based on using the |\%| command. This command is redefined inside a |\pgfcalendar| to mean the same as @@ -229,7 +229,7 @@ environments (similar to, say, the |\draw| command). The |\%| inserts the current day/month/year/day of week in a certain format into the text. The first letter following the |\%| - selects the type (permisslbe values are |d|, |m|, |y|, |w|), the + selects the type (permissible values are |d|, |m|, |y|, |w|), the second letter specifies how the value should be displayed (|-| means numerically, |=| means numerically with leading space, |0| means numerically with leading zeros, |t| means @@ -242,7 +242,7 @@ environments (similar to, say, the |\draw| command). leading zero: \begin{codeexample}[leave comments] \tikz \calendar[dates=2000-01-01 to 2000-01-31,week list, - day text=\%d0]; + day text=\%d0]; \end{codeexample} \end{key} @@ -285,10 +285,10 @@ environments (similar to, say, the |\draw| command). \begin{key}{/tikz/month text=\meta{text}} This option allows you to change the macro |\tikzmonthtext|. By default, the month text is a long textual presentation of the - current month being typeset. + current month being typeset. \begin{codeexample}[leave comments] \tikz \calendar[dates=2000-01-01 to 2000-01-31,week list, - month label above centered, + month label above centered, month text=\textcolor{red}{\%mt} \%y-]; \end{codeexample} \end{key} @@ -310,7 +310,7 @@ environments (similar to, say, the |\draw| command). \begin{key}{/tikz/every year} Works like |every month|, only for years. \end{key} - + \medskip \textbf{Date ifs.} Much of the power of the |\calendar| command comes from the use of @@ -321,20 +321,20 @@ environments (similar to, say, the |\draw| command). code or options}. You can have multiple such conditionals (but you cannot nest them in this simple manner). The second way is to use the following option: - \begin{key}{/tikz/if=|(|\meta{coditions}|)|\meta{code or + \begin{key}{/tikz/if=|(|\meta{conditions}|)|\meta{code or options}\opt{|else|\meta{else code or options}}} This option has the same effect as giving a corresponding if in the \meta{calendar specification}. The option is mostly useful for use in the |every calendar| style, where you cannot provide if conditionals - otherwise. + otherwise. \end{key} Now, regardless of how you specify a conditional, it has the following effect (individually and independently for each date in the calendar): \begin{enumerate} \item It is checked whether the current date is one of the - possibilities listed in \meta{coditions}. An example of such a + possibilities listed in \meta{conditions}. An example of such a condition is |Sunday|. Thus, when you write |if (Saturday,Sunday) {foo}|, then |foo| will be executed for every day in the calendar that is a Saturday \emph{or} a Sunday. @@ -394,7 +394,7 @@ environments (similar to, say, the |\draw| command). correctly. For this, we can change the day text to |\%d=|, which adds a space at the beginning of single day text. - + In the following, more technical information is covered. Most readers may wish to skip it. @@ -405,7 +405,7 @@ environments (similar to, say, the |\draw| command). nodes, to render the date nodes, to draw the month labels and to do all other stuff that is necessary to draw a calendar. - The current daet code consists of the following parts, in this order: + The current date code consists of the following parts, in this order: \begin{enumerate} \item The before-scope code. \item A scope is opened. @@ -439,7 +439,7 @@ environments (similar to, say, the |\draw| command). \begin{key}{/tikz/execute before day scope=\meta{code}} The \meta{code} is executed before everything else for each - date. Multiple + date. Multiple calls of this option have an accumulative effect. Thus, if you use this option twice, the code from the first use is used first for each day, followed by the code given the second time. @@ -455,15 +455,15 @@ environments (similar to, say, the |\draw| command). commands in at-begin- and at-end-code. \end{key} \begin{key}{/tikz/execute after day scope=\meta{code}} - This is executed at the very end of the current date, outside the + This is executed at the very end of the current date, outside the scope. The accumulation is also in reverse. - \end{key} + \end{key} \end{command} In the rest of the following subsections we have a look at how the different scope codes can be used to create different calendar -arrangements. +arrangements. \subsubsection{Creating a Simple List of Days} @@ -472,7 +472,7 @@ We start with a list the days of the calendar, one day below the other. For 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: +following code: \begin{codeexample}[] \tikz \calendar [dates=2000-01-01 to 2000-01-08, @@ -496,7 +496,7 @@ month. The idea is to do two things: We have two options where we should add the month code: Either we add it at the 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 inadventerdly ``leak outside.'' +settings to not inadvertently ``leak outside.'' \begin{codeexample}[] \tikz \calendar @@ -527,7 +527,7 @@ the Monday of each week. That means that at the end of each week the origin is moved downward one line. On all other days, the origin at the end of the day code is the same as 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. +scope to horizontally shift the day according to its day of week. \begin{codeexample}[] \tikz \calendar @@ -543,7 +543,7 @@ scope to horizontally shift the day according to its day of week. \subsubsection{Creating a Month List Arrangement} -For another example, let us create an arrangment that contains one +For another example, let us create an arrangement that contains one line for each month. This is easy enough to do as for weeks, unless we add the following requirement: Again, we want all days in a column to have the same day of week. Since months start on different days of @@ -587,7 +587,7 @@ on the page. The calendar library defines a number of predefined arrangements. We start with arrangements in which the days are listed in a long -line. +line. \begin{stylekey}{/tikz/day list downward} This style causes the days of a month to be typeset one below the @@ -624,7 +624,7 @@ line. As above, but the list grows left. \end{stylekey} -The next arrangement lists days weekwise. +The next arrangement lists days by the week. \begin{stylekey}{/tikz/week list} This style creates one row for each week in the range. The value @@ -659,15 +659,15 @@ The following arrangement gives a very compact view of a whole year. \begin{stylekey}{/tikz/month list} In this arrangement there is a row for each month. As for the |week list|, the |day xshift| is used for the horizontal distance. - For the vertical shft, |month yshift| is used. + For the vertical shift, |month yshift| is used. In each row, all days of the month are listed alongside each other. However, it is once more ensured that days in each column lie on the same day of week. Thus, the very first column contains only Mondays. If a month does not start with a Monday, its days are - shifted to the right such that the days lie on the correct columns. + shifted to the right such that the days lie on the correct columns. \begin{codeexample}[] -\sffamily\scriptsize +\sffamily\scriptsize \tikz \calendar [dates=2000-01-01 to 2000-12-31, month list,month label left,month yshift=1.25em] @@ -850,10 +850,10 @@ The following example is a futuristic calendar that is all about circles: \begin{codeexample}[] \sffamily -\colorlet{winter}{blue} -\colorlet{spring}{green!60!black} -\colorlet{summer}{orange} -\colorlet{fall}{red} +\colorlet{winter}{blue} +\colorlet{spring}{green!60!black} +\colorlet{summer}{orange} +\colorlet{fall}{red} % A counter, since TikZ is not clever enough (yet) to handle % arbitrary angle systems. @@ -880,7 +880,7 @@ The following example is a futuristic calendar that is all about circles: ] if (day of month=1) {\color{\monthcolor}\tikzmonthcode} if (Sunday) [red] - if (all) + if (all) { % Again, compute angle \mycount=1 @@ -906,7 +906,7 @@ Next, lets us have a whole year in a tight column: \end{codeexample} -%%% Local Variables: +%%% Local Variables: %%% mode: latex %%% TeX-master: "pgfmanual-pdftex-version" -%%% End: +%%% End: |