summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex')
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex191
1 files changed, 97 insertions, 94 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex
index 6c0bc68d1d4..03e1f13aeb5 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-base-scopes.tex
@@ -35,10 +35,9 @@ The \pgfname\ system consists of several layers:
The system layer is documented in Part~\ref{part-system}.
\item[Basic layer.]
- The basic layer is loaded by the package |pgf|. Some
- applications do not need all of the functionality of the basic
- layer, so it is possible to load only the |pgfcore| and some other
- packages starting with |pgfbase|.
+ The basic layer is loaded by the package |pgfcore| and subsequent
+ use of the command |\usepgfmodule| to load additional modules of the
+ basic layer.
The basic layer is documented in the present part.
\item[Frontend layer.]
@@ -161,95 +160,89 @@ Before we come to the structuring commands provided by \pgfname\ to
structure your graphics, let us first have a look at the structure of
the package itself.
-\subsubsection{The Main Package}
+\subsubsection{The Core Package}
To use \pgfname, include the following package:
-\begin{package}{pgf}
- This package loads the complete ``basic layer'' of \pgfname. That
- is, it will load all of the commands described in the current part
- of this manual, but it will not load frontends like \tikzname.
+\begin{package}{pgfcore}
+ This package loads the complete core of the ``basic layer'' of
+ \pgfname, but not any modules. That is, it will load all of the
+ commands described in the current part of this manual, but it will
+ not load frontends like \tikzname. It will also load the system
+ layer. To load additional modules, use the |\usepgfmodule| command
+ explained below.
+\end{package}
- In detail, this package will load the following packages, each of
- which can also be loaded individually:
- \begin{itemize}
- \item
- |pgfsys|, which is the lowest layer of \pgfname\ and which is
- always needed. This file will read |pgf.cfg| to discern which
- driver is to be used. See Section~\ref{section-pgfsys} for
- details.
- \item
- |pgfcore|, which is the central core of \pgfname\ and which is
- always needed unless you intend to write a new basic layer from
- scratch.
- \item
- |pgfbaseimage|, which provides commands for declaring and
- using images. An example is |\pgfuseimage|.
- \item
- |pgfbaseshapes|, which provides commands for declaring and using
- shapes. An example is |\pgfdeclareshape|.
- \item
- |pgfbaseplot|, which provides commands for plotting functions.
- \end{itemize}
+The following package is just a convenience.
- Including any of the last three packages will automatically load the
- first two.
+\begin{package}{pgf}
+ This package loads the |pgfcore| and the two modules |shapes| and
+ |plot|.
+
+ In \LaTeX, the package takes two options:
+ \begin{packageoption}{draft}
+ When this option is set, all images will be replaced by empty
+ rectangles. This can speedup compilation.
+ \end{packageoption}
+
+ \begin{packageoption}{version=\meta{version}}
+ Indicates that the commands of version \meta{version} need to be
+ defined. If you set \meta{version} to |0.65|, then a large bunch of
+ ``compatibility commands'' are loaded. If you set \meta{version} to
+ |0.96|, then these compatibility commands will not be loaded.
+
+ If this option is not given at all, then the commands of all
+ versions are defined.
+ \end{packageoption}
\end{package}
-In \LaTeX, the package takes two options:
-\begin{packageoption}{draft}
- When this option is set, all images will be replaced by empty
- rectangles. This can speedup compilation.
-\end{packageoption}
-
-\begin{packageoption}{version=\meta{version}}
- Indicates that the commands of version \meta{version} need to be
- defined. If you set \meta{version} to |0.65|, then a large bunch of
- ``compatibility commands'' are loaded. If you set \meta{version} to
- |0.96|, then these compatibility commands will not be loaded.
-
- If this option is not given at all, then the commands of all
- versions are defined.
-\end{packageoption}
-\subsubsection{The Core Package}
+\subsubsection{The Modules}
-\begin{package}{pgfcore}
- This package defines all of the basic layer's commands, except for
- the commands defined in the additional packages like
- |pgfbaseplot|. Typically commands defined by the core include
- |\pgfusepath| or |\pgfpoint|. The core is internally structured
- into several subpackages, but the subpackages cannot be loaded
- individually since they are all ``interrelated.''
-\end{package}
+\begin{command}{\usepgflibrary\marg{module names}}
+ Once the core has been loaded, you can use this command to load
+ further modules. The modules in the \meta{module names} list should
+ be separated by commas. Instead of curly braces, you can also
+ use square brackets, which is something Con\TeX t users will
+ like. If you try to load a module a second time, nothing will
+ happen.
+ \example |\usepgfmodule{matrix,shapes}|
-\subsubsection{The Optional Basic Layer Packages}
+ What this command does is to load the file
+ |pgfmodule|\meta{module}|.code.tex| for each \meta{module} in
+ the \meta{module names}. Thus, to write your own module,
+ all you need to do is to place a file of the appropriate name
+ somewhere where \TeX\ can find it. \LaTeX, plain \TeX, and Con\TeX t
+ users can then use your library.
+\end{command}
-The |pgf| package automatically loads the following packages, but you
-can also load them individually (all of them automatically include the
-core):
+The following modules are available for use with |pgfcore|:
\begin{itemize}
- \item |pgfbaseshapes|
- This package provides commands for drawing nodes and shapes. These
- commands are explained in Section~\ref{section-shapes}.
-
- \item |pgfbaseplot|
- This package provides commands for plotting function. The
+\item The |plot| module provides commands for plotting functions. The
commands are explained in Section~\ref{section-plots}.
-
- \item |pgfbaseimage|
- This package provides commands for including (external) images. The
- commands are explained in Section~\ref{section-images}.
+\item The |shapes| module provides commands for drawing shapes and
+ nodes. These commands are explained in
+ Section~\ref{section-shapes}.
+\item The |decorations| module provides commands for adding
+ decorations to paths. These commands are explained in
+ Section~\ref{section-base-decorations}.
+\item The |matrix| module provides the |\pgfmatrix| command. The
+ commands are documented in Section~\ref{section-base-matrices}.
\end{itemize}
\subsubsection{The Library Packages}
-There is a special command for loading library packages.
+There is a special command for loading library packages. The
+difference between a library and module is the following: A library
+just defines additional objects using the basic layer, whereas a
+module adds completely new functionality. For instance, a decoration
+library defines additional decorations, while a decoration module
+defines the whole code for handling decorations.
\begin{command}{\usepgflibrary\marg{list of libraries}}
Use this command to load further libraries. The list of libraries
@@ -661,22 +654,26 @@ a shading into a |{pgfpicture}|.
effect, you have to (possibly temporarily) reset the high-level
transformation matrix.
- The following \meta{options} may be given as conveniences:
- \begin{itemize}
- \itemoption{left}
- causes the text box to be placed such that its left border is on the origin.
+ The \meta{options} keys are used with the path |/pgf/text/|. The
+ following keys are defined for this path:
+ \begin{key}{/pgf/text/left}
+ The key causes the text box to be placed such that its left
+ border is on the origin.
\begin{codeexample}[]
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[left] {lovely}}
\end{codeexample}
- \itemoption{right}
- causes the text box to be placed such that its right border is on the origin.
+ \end{key}
+ \begin{key}{/pgf/text/right}
+ Thie key causes the text box to be placed such that its right
+ border is on the origin.
\begin{codeexample}[]
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[right] {lovely}}
\end{codeexample}
- \itemoption{top}
- causes the text box to be placed such that its top is on the
+ \end{key}
+ \begin{key}{/pgf/text/right}
+ This key causes the text box to be placed such that its top is on the
origin. This option can be used together with the |left| or
|right| option.
\begin{codeexample}[]
@@ -687,9 +684,10 @@ a shading into a |{pgfpicture}|.
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[top,right] {lovely}}
\end{codeexample}
- \itemoption{bottom}
- causes the text box to be placed such that its bottom is on the
- origin.
+ \end{key}
+ \begin{key}{/pgf/text/bottom}
+ This key causes the text box to be placed such that its bottom is
+ on the origin.
\begin{codeexample}[]
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[bottom] {lovely}}
@@ -698,9 +696,10 @@ a shading into a |{pgfpicture}|.
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[bottom,right] {lovely}}
\end{codeexample}
- \itemoption{base}
- causes the text box to be placed such that its baseline is on the
- origin.
+ \end{key}
+ \begin{key}{/pgf/text/base}
+ This key causes the text box to be placed such that its baseline
+ is on the origin.
\begin{codeexample}[]
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[base] {lovely}}
@@ -709,29 +708,33 @@ a shading into a |{pgfpicture}|.
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[base,right] {lovely}}
\end{codeexample}
- \itemoption{at}|=|\meta{point}
- Translates the origin (that is, the point where the text is
- shown) to \meta{point}.
+ \end{key}
+ \begin{key}{/pgf/text/at=\meta{point}}
+ Translates the origin (that is, the point where the text is
+ shown) to \meta{point}.
\begin{codeexample}[]
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[base,at={\pgfpoint{1cm}{0cm}}] {lovely}}
\end{codeexample}
- \itemoption{x}|=|\meta{dimension}
- Translates the origin by \meta{dimension} along the $x$-axis.
+ \end{key}
+ \begin{key}{/pgf/text/x=\meta{dimension}}
+ Translates the origin by \meta{dimension} along the $x$-axis.
\begin{codeexample}[]
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[base,x=1cm,y=-0.5cm] {lovely}}
\end{codeexample}
- \itemoption{y}|=|\meta{dimension}
- works like the |x| option.
- \itemoption{rotate}|=|\meta{degree}
+ \end{key}
+ \begin{key}{/pgf/text/y=\meta{dimension}}
+ This key works like the |x| option.
+ \end{key}
+ \begin{key}{/pgf/text/rotate=\meta{degree}}
Rotates the coordinate system by \meta{degree}. This will also
rotate the text box.
\begin{codeexample}[]
\tikz{\draw[help lines] (-1,-.5) grid (1,.5);
\pgftext[base,x=1cm,y=-0.5cm,rotate=30] {lovely}}
\end{codeexample}
- \end{itemize}
+\end{key}
\end{command}