diff options
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/pgf/contrib/tzplot/tzplot-doc-A-v1.0.1.tex (renamed from graphics/pgf/contrib/tzplot/tzplot-doc-A-v1.0.tex) | 38 | ||||
-rw-r--r-- | graphics/pgf/contrib/tzplot/tzplot-doc-B-v1.0.1.tex (renamed from graphics/pgf/contrib/tzplot/tzplot-doc-B-v1.0.tex) | 251 | ||||
-rw-r--r-- | graphics/pgf/contrib/tzplot/tzplot-doc-C-v1.0.1.tex (renamed from graphics/pgf/contrib/tzplot/tzplot-doc-C-v1.0.tex) | 757 | ||||
-rw-r--r-- | graphics/pgf/contrib/tzplot/tzplot-doc-D-v1.0.1.tex (renamed from graphics/pgf/contrib/tzplot/tzplot-doc-D-v1.0.tex) | 359 | ||||
-rw-r--r-- | graphics/pgf/contrib/tzplot/tzplot-doc.pdf | bin | 808794 -> 827727 bytes | |||
-rw-r--r-- | graphics/pgf/contrib/tzplot/tzplot-doc.tex | 16 | ||||
-rw-r--r-- | graphics/pgf/contrib/tzplot/tzplot.sty | 61 |
7 files changed, 845 insertions, 637 deletions
diff --git a/graphics/pgf/contrib/tzplot/tzplot-doc-A-v1.0.tex b/graphics/pgf/contrib/tzplot/tzplot-doc-A-v1.0.1.tex index 67d2e2e2aa..1d949a6768 100644 --- a/graphics/pgf/contrib/tzplot/tzplot-doc-A-v1.0.tex +++ b/graphics/pgf/contrib/tzplot/tzplot-doc-A-v1.0.1.tex @@ -11,13 +11,18 @@ \section{About \texttt{tzplot.sty}} -The |tzplot| package is just a collection of macros based on \TikZ\ to save you time in typing \Tikz\ code. +The |tzplot| package is just a collection of macros based on \TikZ\ to save you time typing \Tikz\ code. In |pstricks|, a line connecting two points |(A)| and |(B)| is drawn by |\psline(A)(B)|. With the package |tzplot|, you can do it by |\tzline(A)(B)|. \begin{tztikz}{} -\tzline[blue](A)(B){my line}[right] % is an abbreviation of: +\tzline(A)(B) % is an abbreviation of: + \draw (A) -- (B); +\end{tztikz} +% +\begin{tztikz}{} +\tzline[blue](A)(B){my line}[r] % is an abbreviation of: \draw [blue] (A) -- (B) node [right] {my line}; \end{tztikz} @@ -27,18 +32,17 @@ All of the drawing macros of |tzplot| are prefixed by |\tz|. Of course, it means The syntax of the |tzplot| macros comes from |tikz| and |pstricks|. However, the input mode is more like |pstricks|. -To use the |tzplot| package you have to load the package in the preamble of your document as follows. +To use the |tzplot| package you have to load the package in the preamble of your document as follows: \begin{verbatim} \usepackage{tzplot} \end{verbatim} -The package depends on the packages |tikz|, |xpars|, and |expl3|. -And it uses the following \Tikz\ libraries. +The package depends on the packages |tikz|, |xparse|, and |expl3|. +And it uses the following \Tikz\ libraries: \begin{verbatim} calc,backgrounds,positioning,intersections,arrows,shapes,patterns,plotmarks, decorations.pathreplacing,calligraphy - \end{verbatim} This package sets the basic arrow style to |stealth|. @@ -51,10 +55,10 @@ Finally, note that this is far from a \Tikz\ tutorial. To make good use of this package, you need to familiarize yourself with \Tikz. \section{Preoccupied style names} -\label{s:abbreviations} +\label{s:stylenames} This package does not provide any environment. -Since all the drawing macros, prefixed |\tz|, are just abbreviations of \Tikz\ code, +Since all the drawing macros prefixed by |\tz| are just abbreviations of \Tikz\ code, you can use the macros in the |tikzpicture| environment together with any \Tikz\ commands. However, there are some preoccupied style names that you should not overwrite. @@ -66,7 +70,8 @@ Those are as follows: tzshorten tzextend tzshowcontrols \end{verbatim} -This package also predefined aliases of \Tikz's basic placement options as follows: +This package also predefined \iisw{abbreviations} of \Tikz's basic placement options as follows: +\label{abbreviations} \begin{tzsty}{} % preoccupied (alias) styles @@ -82,8 +87,10 @@ This package also predefined aliases of \Tikz's basic placement options as follo br/.style={below right=#1}, } \end{tzsty} +You can use these abbreviations to place \Tikz's \iisw{main node}\xem{s} but not \iisw{label node}\xem{s}. To place label nodes, use non-abbreviated options or angles instead. -The |tzplot| package also defines layers as follows: + +The |tzplot| package also defines graphic layers as follows: \begin{tzsty}{} \pgfdeclarelayer{background} @@ -93,17 +100,16 @@ The |tzplot| package also defines layers as follows: \pgfsetlayers{background,behind,main,above,foreground} \end{tzsty} - Therefore, you can select the graphic layers in sequence: |background|, |behind|, |main|, |above|, and |foreground|. -For example, you can change the layer of a tangent line from |behind| (default) to |main| as follows: +For example, you can change the layer of a straight line from |main| (default) to |background| as follows: \begin{tzcode}[listing only]{1} \begin{tikzpicture} -\tzaxes(10,10) +\tzhelplines(4,3) <tzplot macros> <tikz macros> -\begin{pgfonlayer}{main} -\tztangentat{curve}{5}[1:8] +\begin{pgfonlayer}{background} + \tzline[blue](0,0)(3,1) \end{pgfonlayer} \end{tikzpicture} \end{tzcode} @@ -117,7 +123,7 @@ Optional arguments are hidden when not used. The document has three essential parts: Part II, Part III, and Part IV. Part II introduces essential macros with only frequently used options. -There are many options hidden in the macros introduces in Part II. +There are many options hidden in the macros introduced in Part II. Some macros are not introduced in Part II. Part III and IV describe all the features of all macros. diff --git a/graphics/pgf/contrib/tzplot/tzplot-doc-B-v1.0.tex b/graphics/pgf/contrib/tzplot/tzplot-doc-B-v1.0.1.tex index f3253e5799..6cd6e61fab 100644 --- a/graphics/pgf/contrib/tzplot/tzplot-doc-B-v1.0.tex +++ b/graphics/pgf/contrib/tzplot/tzplot-doc-B-v1.0.1.tex @@ -10,7 +10,7 @@ \chapter{An Intuitive Introduction I: Basics} \label{ci:introI} -All drawing macros provided in this package work within |tikzpicture| environment, just like any other \Tikz\ command. +All drawing macros provided in this package work within |tikzpicture| environment, just like any other \Tikz\ commands. %%------------------------------------------------------------ \section{Lines: Basics: \protect\cmd{\tzline(0,0)(3,1)}} @@ -84,10 +84,10 @@ You can change of the size of a dot by specifying the \xem{radius} of the circle \end{tzcode} -\subsection{A node circle dot: \protect\cmd{\tzdot(0,0)}} +\subsection{A circle node dot: \protect\cmd{\tzdot(0,0)}} \label{ssi:tzdot} -\icmd{\tzdot} draws a `node circle dot' at a specified coordinate. +\icmd{\tzdot} draws a `circle node dot' at a specified coordinate. The starred version \icmd{\tzdot*} prints a filled dot. The default size (\xem{diameter} or |minimum size|) is |2.4pt|. \begin{tzcode}{.3} @@ -126,8 +126,8 @@ The size (\xem{diameter} or |minimum size|) of a node dot can be changed by the \subsection{Difference between \protect\cmd{\tzcdot} and \protect\cmd{\tzdot}} \label{ssi:difference} -A `circle dot' drawn by |\tzcdot| is affected by |xscale| or |yscale| in \Tikz, but a `node circle dot' drawn by |\tzdot| is not. -Note also that |\tzcdot| controls the \xem{radius} of a circle dot (following \Tikz\ practice), while |\tzdot| controls the \xem{diameter} of a node circle dot. +A `circle dot' drawn by |\tzcdot| is affected by |xscale| or |yscale| in \Tikz, but a `circle node dot' drawn by |\tzdot| is not. +Note also that |\tzcdot| controls the \xem{radius} of a circle dot (following \Tikz\ practice), while |\tzdot| controls the \xem{diameter} of a circle node dot. \begin{tzcode}{.3} % \tzdot: size not changed by scaling @@ -142,8 +142,8 @@ Note also that |\tzcdot| controls the \xem{radius} of a circle dot (following \T \remark -The circle dots drawn by |\tzcdot| are affected by \Tikz\ |scale|. It gets bigger or smaller by |scale|. -Let us see what happens to circle dots especially when |xscale| and |yscale| are not symmetric. +The circle dots drawn by |\tzcdot| are affected by \Tikz\ |scale| factors. It gets bigger or smaller by |scale|. +Let us see what happens to circle dots, especially when |xscale| and |yscale| are not symmetric. \begin{tzcode}{.3} % \tzcdot: distorted @@ -222,7 +222,7 @@ The starred version \icmd{\tzcoor*} prints a filled node dot at a specified coor \subsection{\protect\cmd{\tzbezier}} \label{ssi:tzbezier} -\icmd{\tzbezier} draws a bezier curve with one or two control points. +\icmd{\tzbezier} draws a B\'{e}zier curve with one or two control points. The style |tzshowcontrols|, which is predefined in the package, reveals the control point(s). \begin{tzcode}{.3} @@ -234,16 +234,24 @@ The style |tzshowcontrols|, which is predefined in the package, reveals the cont \end{tzcode} \begin{tztikz}{} -\tzbezier[blue](0,0)(2,0)(4,2) % works like: +\tzbezier[blue](0,0)(2,0)(4,2) % works like: \draw [blue] (0,0) .. controls (2,0) .. (4,2); -\tzbezier(0,2)(1,3)(3,0)(4,1) % works like: +\tzbezier(0,2)(1,3)(3,0)(4,1) % works like: \draw (0,2) .. controls (1,3) and (3,0) .. (4,1); \end{tztikz} \subsection{\protect\cmd{\tzparabola}} \label{ssi:tzparabola} -\icmd{\tzparabola} draws a parabola controlled by several options of \Tikz. +\icmd{\tzparabola} draws a parabola controlled by several options of \Tikz's |parabola| operation. + +\begin{tztikz}{} +\tzparabola(0,0)(2,4) % works like: + \draw (0,0) parabola (2,4); +\tzparabola(2,0)(3,3)(4,1) % works like: + \draw (2,0) parabola bend (3,3) (4,1); +\end{tztikz} + \begin{tzcode}{.3} \begin{tikzpicture} @@ -255,13 +263,6 @@ The style |tzshowcontrols|, which is predefined in the package, reveals the cont \end{tikzpicture} \end{tzcode} -\begin{tztikz}{} -\tzparabola(0,0)(2,4) % works like: - \draw (0,0) parabola (2,4); -\tzparabola(2,0)(3,3)(4,1) % works like: - \draw (2,0) parabola bend (3,3) (4,1); -\end{tztikz} - @@ -273,7 +274,7 @@ The style |tzshowcontrols|, which is predefined in the package, reveals the cont \subsection{\protect\cmd{\tznode(3,1)\{text\}[right]}} \label{ssi:tznode} -With \icmd{\tznode}|{<text>}[<node opt>]| you can put some text at a specified position. +With \icmd{\tznode}|(<coor>){<text>}[<node opt>]|, you can put some text at a specified position. The starred version \icmd{\tznode*} draws the node perimeter, which is a |rectangle| by default. \begin{tzcode}{.3} @@ -288,9 +289,9 @@ The starred version \icmd{\tznode*} draws the node perimeter, which is a |rectan \begin{tztikz}{} -\tznode(0,0){A} % works like: +\tznode(0,0){A} % works like: \node at (0,0) {A}; -\tznode(2,2){Text}[above right,blue] % works like: +\tznode(2,2){Text}[above right,blue] % works like: \draw (2,2) node [above right,blue] {Text}; \end{tztikz} @@ -310,7 +311,7 @@ When a \iisw{main node} with text in it is placed at a specific point, its \iisw \end{tikzpicture} \end{tzcode} -The angles for label nodes can be replaced by the corresponding placement words. For example, the angle |90| degree for a label node can be replaced by |above|, |0| by |right|, |-135| by |below left|, and the like. The angle expression \xem{cannot} be used for placing a main node. +The angles for label nodes can be replaced by the corresponding placement words. For example, the angle |90| degree for a label node can be replaced by |above|, |0| by |right|, |-135| by |below left|, and the like. Note that the angle expression \xem{cannot} be used for placing a main node. \xmedskip1 \remark @@ -318,7 +319,7 @@ The angles for label nodes can be replaced by the corresponding placement words. \item In this package, macros related to `dots' or `coordinates' (like |\tzcdot|, |tzdot|, and |\tzcoor|) can optionally have `label nodes,' while macros related to `lines' and `curves' (like |\tzline|, |\tzto|, |\tzbezier| and |\tzparabola|) optionally have `main nodes' or `text nodes.' \item -There is one exception, |\tzshoworigin|. |\tzshoworigin| can have a label, but its location is controlled by positional words such as |below left| but not by |<angle>|. +There is one exception: |\tzshoworigin|. |\tzshoworigin| can have a label, but its location is controlled by positional words such as |below left| but not by |<angle>|. (See Section \ref{s:tzshoworigin} on page \pageref{s:tzshoworigin} for more details.) \end{itemize} @@ -339,7 +340,7 @@ You can use \isw{abbreviations} |a| for |above|, |r| for |right|, |bl| for |belo \end{tzcode} \warning The abbreviations of \Tikz\ basic placement options \xem{cannot} be used to place \xem{labels}. -To place labels, use \xem{angles} or the unabridged placement options of \Tikz such as |above| and |below left|. +To place labels, use \xem{angles} or the unabridged placement options of \Tikz\ such as |above| and |below left|. %%------------------------------------------------------------ \section{Labeling dots and coordinates} @@ -351,7 +352,7 @@ To place labels, use \xem{angles} or the unabridged placement options of \Tikz s To add a label to a dot generated by |\tzdot| or |\tzcdot|, you should specify, \xem{right after a coordinate}, |{<label>}| followed by |[<angle>]| (|90| degree or |above| by default in \Tikz). \textsc{Remember} that the order of the arguments is |(<coor>){<label>}[<angle>]|. -To change the size of a dot, you need to specify |(<dimension>)| after all the other arguments. +To change the size of a dot, you need to specify the last option |(<dimension>)| after all the other arguments. \begin{tzcode}{.3} \begin{tikzpicture} @@ -366,7 +367,7 @@ To change the size of a dot, you need to specify |(<dimension>)| after all the o \begin{tztikz}{} \tzcdot*(1,2){C}[180](2pt) % works like: - \draw[fill] (1,1) circle (2pt) node [label={180:C}] {}; + \draw[fill] (1,2) circle (2pt) node [label={180:C}] {}; \end{tztikz} \subsection{\protect\cmd{\tzcoor}} @@ -385,7 +386,7 @@ To change the size of a dot, you need to specify |(<dimension>)| after all the o \tzcoor(<coor>)(<coor name>){<label>}[[<label opt>]<angle>] % defaults (<m>)(<m>){}[] - % <m> means `mandatory' +% <m> means `mandatory' \end{tzdef} You can see the full syntax of |\tzcoor| in Section \ref{s:tzcoor} on page \pageref{s:tzcoor}. @@ -408,7 +409,7 @@ You can see the full syntax of |\tzcoor| in Section \ref{s:tzcoor} on page \page \subsection{\protect\cmd{\tzcoor*}} \label{ssi:tzcoor*} -\icmd{\tzcoor*} designates a coordinate and prints a node dot with a label around the designated point like |\tzdot*| does. +The starred version \icmd{\tzcoor*} designates a coordinate and prints a node dot with a label around the designated point like |\tzdot*| does. \begin{tzdef}{} % syntax: simflified @@ -440,7 +441,7 @@ You can see the full syntax of |\tzcoor| in Section \ref{s:tzcoor} on page \page \label{ssi:texttotzline} \icmd{\tzline} accepts two mandatory coordinates. -To add text to a line segment, just specify the optional arguments |{<text>}| and |[<node opt>]| \xem{inbetween} the two coordinates. The |[<node opt>]| is |[above,midway]|, by default. +To add text to a line segment, just specify the optional arguments |{<text>}| and |[<node opt>]| \xem{in-between} the two coordinates. The |[<node opt>]| is |[above,midway]|, by default. \begin{tzcode}{.3} \begin{tikzpicture} @@ -466,7 +467,7 @@ The optional argument |{<text>}| \xem{following the second coordinate} can also \subsection{\protect\cmd{\tzto}} \label{ssi:texttotzto} -To add text to a line or a curve drawn by \icmd{\tzto}, just specify the optional arguments |{<text>}| and |[<node opt>]| \xem{in bewteen} the two coordinates. By default, the |[<node opt>]| is |[above,midway]|. +To add text to a line or a curve drawn by \icmd{\tzto}, just specify the optional arguments |{<text>}| and |[<node opt>]| \xem{in-between} the two coordinates. By default, the |[<node opt>]| is |[above,midway]|. \begin{tzcode}{.3} \begin{tikzpicture} @@ -494,7 +495,7 @@ The optional argument |{<text>}| \xem{following the second coordinate} can also \label{ssi:texttotzbezier} \icmd{\tzbezier} accepts three or four coordinates as arguments. -You can add text to the curve drawn by |\tzbezier| using the optional arguments |{<text>}| and |[<pos>]| after the last coordinate. +You can add text to the curve drawn by |\tzbezier| using the optional arguments |{<text>}| and |[<node opt>]| after the last coordinate. \begin{tzcode}{.3} \begin{tikzpicture} @@ -512,7 +513,7 @@ You can add text to the curve drawn by |\tzbezier| using the optional arguments \label{ssi:texttotzparabola} \icmd{\tzparabola} accepts two or three coordinate arguments. -You can add text to a parabola drawn by |\tzparabola| using the optional arguments |{<text>}| and |[<node opt>]| \xem{followed by the last coordinate}. +You can add text to a parabola drawn by |\tzparabola| using the optional arguments |{<text>}| and |[<node opt>]| \xem{following the last coordinate}. The text is placed at (by default) or around the last coordinate according to |[<node opt>]|. @@ -537,8 +538,8 @@ The text is placed at (by default) or around the last coordinate according to |[ \label{ssi:tzlines} \icmd{\tzlines} connects with line segments an arbitrary number of coordinates. The coordinate iteration must end with semicolon |;|. -Here, the \xem{semicolon} |;| indicates \xem{the end of repetition} of coordinates. -Let us call this kind of macro a \iisw{semicolon version}. +Here, the \xem{semicolon} `|;|' indicates \xem{the end of repetition} of coordinates. +Let us call this kind of macro a \iisw{semicolon version} macro. \begin{tzcode}{.3} \begin{tikzpicture} @@ -547,7 +548,7 @@ Let us call this kind of macro a \iisw{semicolon version}. \end{tikzpicture} \end{tzcode} -With the optional argument |{<text>}| followed by |[<node opt>]| \xem{inbetween two coordinates}, you can print |{<text>}| at or around the middle point of the corresponding line segment in accordance with |[<node opt>]| (by default |[midway]|). +With the optional argument |{<text>}| followed by |[<node opt>]| \xem{in-between two coordinates}, you can print |{<text>}| at or around the middle point of the corresponding line segment in accordance with |[<node opt>]| (by default |[midway]|). \begin{tzcode}{.3} \begin{tikzpicture} @@ -571,8 +572,8 @@ The optional argument |{<text>}| \xem{following the last coordinate} can be used \end{tikzpicture} \end{tzcode} -\textsc{Remember} the repeated pattern is the triple |(<coor>){<text>}[<node opt>]| in that order. -DO NOT FORGET to indicate when the repetition ends by typing the semicolon. So it will look like |(){}[]..repeated..(){}[];| +\textsc{Remember} the repeating pattern is the triple |(<coor>){<text>}[<node opt>]| in that order. +DO NOT FORGET to indicate when the repetition ends by typing a semicolon. So it will look like |(){}[]..repeated..(){}[];|. \subsection{\protect\cmd{\tzpolygon}, \protect\cmd{\tzpolygon*}: Closed paths} \label{ssi:tzpolygon} @@ -581,7 +582,7 @@ DO NOT FORGET to indicate when the repetition ends by typing the semicolon. So i In fact, |\tzpolygon| is a closed version of |\tzlines|. The starred version |\tzpolygon*| does the same thing as |\tzpolgon| except for one thing. -|\tzplygon*|, by default, fills the interior of the polygon with |black!50| with |fill=opacity=.3|. (Changing the fill opacity is not an issue in this introduction. See Section \ref{s:tzpolygon} on path \pageref{s:tzpolygon} for more details.) +|\tzplygon*|, by default, fills the interior of the polygon with |black!50| with |fill opacity=.3| but with |text opacity=1|. (Changing the |fill opacity| is not an issue in this introduction. See Section \ref{s:tzpolygon} on page \pageref{s:tzpolygon} for more details.) \begin{tzcode}{.3} \begin{tikzpicture} @@ -590,7 +591,7 @@ The starred version |\tzpolygon*| does the same thing as |\tzpolgon| except for \end{tikzpicture} \end{tzcode} -The optional arguments |{<text>}| and |[node opt]| inbetween two coordinates prints |<text>| according to |[node opt]| (by default |[midway]|) around the middle point of the corresponding line segment. +The optional arguments |{<text>}| and |[<node opt>]| \xem{in-between} two coordinates prints |<text>| according to |[<node opt>]| (by default |[midway]|) around the middle point of the corresponding line segment. \begin{tzcode}{.3} \begin{tikzpicture} @@ -601,16 +602,16 @@ The optional arguments |{<text>}| and |[node opt]| inbetween two coordinates pri \end{tikzpicture} \end{tzcode} -The options |{<text>}| and |[node opt]| following the last coordinate can be used as a name of the connected line segments. +The options |{<text>}| and |[<node opt>]| following the last coordinate can be used as a name of the connected line segments. -Here, the entire repeated pattern is |(coor){text}[pos] .. repeated .. (){}[];|. +The entire repetition will look like |(<coor>){<text>}[<node opt>] ..repeated.. (){}[];|. DO NOT FORGET to indicate when the repetition ends by typing a semicolon. \begin{tzcode}{.3} \begin{tikzpicture}[sloped,auto] \tzhelplines(4,3) \tzpolygon[dashed] - (0,0){up} (1,2){down} (3,0){up} (4,1) {Weight}[r] ; + (0,0){up} (1,2){down} (3,0){up} (4,1){Weight}[r] ; \end{tikzpicture} \end{tzcode} @@ -651,7 +652,7 @@ You can fill the interior of a path formed by |\tzpath| (after being closed) wit -The starred version \icmd{\tzpath*} takes the default options |fill=black!50| and |fill opacity=.3| to fill the area. +The starred version \icmd{\tzpath*} takes the default options |fill=black!50|, |fill opacity=.3| to fill the area. \begin{tzcode}{.3} \begin{tikzpicture} @@ -680,7 +681,7 @@ How to change the |fill opacity| with |\tzpath*| is not discussed in this introd \section{Many dots: Semicolon versions} \label{si:manydots} -\subsection{\protect\cmd{\tzcdots}, \protect\cmd{\tzcdots*}} +\subsection{\protect\cmd{\tzcdots(*)}} \label{ssi:tzcdots} \icmd{\tzcdots} accepts an arbitrary number of coordinates to print circle dots, but the coordinate repetition must be ended by |;| (semicolon version). @@ -694,7 +695,7 @@ How to change the |fill opacity| with |\tzpath*| is not discussed in this introd \end{tikzpicture} \end{tzcode} -Each coordinate can be labeled by specifying the optional argument |{<label>}| followed by |[<angle>]|. You can also change the size (\xem{radius}) of the dots by specifying the parenthesis argument |(<dot radius>)| \xem{after} the semicolon. +Each coordinate can be labeled by specifying the optional argument |{<label>}| followed by |[<angle>]|. You can also change the size (\xem{radius}) of the dots by specifying the \xem{last} parenthesis option |(<dot radius>)| \xem{after} the semicolon. \begin{tzcode}{.3} \begin{tikzpicture} @@ -710,7 +711,7 @@ Each coordinate can be labeled by specifying the optional argument |{<label>}| f -\subsection{\protect\cmd{\tzdots}, \protect\cmd{\tzdots*}} +\subsection{\protect\cmd{\tzdots(*)}} \label{ssi:tzdots} \icmd{\tzdots} accepts an arbitrary number of coordinates to print circle node dots, but the repetition must be ended by |;| (semicolon version). @@ -724,7 +725,7 @@ Each coordinate can be labeled by specifying the optional argument |{<label>}| f \end{tikzpicture} \end{tzcode} -Each coordinate can be labeled by specifying the optional argument |{<label>}| followed by |[<angle>]|. You can also change the size of the dots by specifying the parenthesis argument |(<size>)| \xem{after} the semicolon. +Each coordinate can be labeled by specifying the optional argument |{<label>}| followed by |[<angle>]|. You can also change the size (\xem{diameter}) of the dots by specifying the \xem{last} parenthesis argument |(<dot size>)| \xem{after} the semicolon. \begin{tzcode}{.3} \begin{tikzpicture} @@ -747,7 +748,7 @@ Each coordinate can be labeled by specifying the optional argument |{<label>}| f \label{ssi:tzcoors} |\tzcoor| accepts \xem{a pair} of mandatory arguments in parentheses: |(<coor>)(<name>)|. -\icmd{\tzcoors} accepts \xem{an arbitrary number of the pairs} to define multiple coordinates. It is a semicolon version, meaning that a semicolon is necessary to indicate when the repetition ends. +\icmd{\tzcoors} accepts \xem{an arbitrary number of the pairs} to define multiple coordinates. It is a semicolon version, meaning that a semicolon is necessary to indicate when the coordinate repetition ends. \begin{tzcode}{.3} \begin{tikzpicture} @@ -761,8 +762,8 @@ Each coordinate can be labeled by specifying the optional argument |{<label>}| f \end{tikzpicture} \end{tzcode} -The optional arguments |{<label>}| and |[<angle>]| following each pair of |(<coor>)| and |(<name>)| allow you to add |<label>| in the direction |<angle>| around the coordinate. -Here, the repeated pattern is |(<coor>)(<name>){<label>}[<angle>]|, in that order. The first two parenthesis arguments are mandatory and others are optional. The pattern is repeated until |\tzcoors| meets a semicolon |;|. +The options |{<label>}| and |[<angle>]| following each pair of |(<coor>)| and |(<name>)| allow you to put |<label>| in the direction of |<angle>| around the coordinate. +Here, the repeating pattern is the quadruple |(<coor>)(<name>){<label>}[<angle>]|. The first two parenthesis arguments are mandatory and others are optional. The pattern is repeated until |\tzcoors| meets a semicolon |;|. \begin{tzcode}{.3} \begin{tikzpicture} @@ -812,7 +813,7 @@ The starred version \icmd{\tzcoors*} does one more thing: prints node dots. \subsection{\protect\cmd{\tzcoorsquick*}} \label{ssi:tzcoorsquick*} -\icmd{\tzcoorsquick*} prints node dots and automatically puts the labels |above| (in the direction of |90| degree from) them, by default. +The starred version \icmd{\tzcoorsquick*} prints node dots and automatically puts the labels |above| (in the direction of |90| degree from) them, by default. \begin{tzcode}{.3} \begin{tikzpicture} @@ -848,10 +849,10 @@ The starred version \icmd{\tzcoors*} does one more thing: prints node dots. \begin{tztikz}{} \tzplot*(0,0)(1,1)(2,1); % works like: - \draw [mark=*] plot coordiates {(0,0)(1,1)(2,1)}; + \draw [mark=*] plot coordinates {(0,0)(1,1)(2,1)}; \end{tztikz} -Each coordinate can be labeled by specifying the optional argument |{<text>}| followed by |[<angle>]|. With the option |mark=o| you can print hollow dots. You can also change the \xem{radius} of the marks by specifying the parenthesis argument |(<mark size>)| \xem{after} the semicolon. +Each coordinate can be labeled by specifying the optional argument |{<text>}| followed by |[<angle>]|. With the option |[mark=o]| you can print hollow dots. You can also change the \xem{radius} of the marks by specifying the \xem{last} parenthesis argument |(<mark size>)| \xem{after} the semicolon. \begin{tzcode}{.3} \begin{tikzpicture} @@ -883,7 +884,7 @@ Each coordinate can be labeled by specifying the optional argument |{<text>}| fo \begin{tztikz}{} \tzplot(0,0)(1,1)(2,1); % works like: - \draw plot coordiates {(0,0)(1,1)(2,1)}; + \draw plot coordinates {(0,0)(1,1)(2,1)}; \end{tztikz} @@ -907,7 +908,7 @@ Each coordinate can be labeled by specifying the optional argument |{<text>}| fo \subsection{\protect\cmd{\tzplotcurve}: Curves with \texttt{[smooth,tension=1]}} \label{ssi:tzplotcurve} -\icmd{\tzplotcurve} plots coordinates with the option |[smooth,tension=1]|, resulting in a curve connecting specified coordinates. +\icmd{\tzplotcurve} plots coordinates with the option |[smooth,tension=1]|, resulting in a curve connecting an arbitrary number of coordinates. The repetition of coordinates must be ended by |;| (semicolon version). \begin{tzcode}{.3} @@ -932,7 +933,7 @@ The repetition of coordinates must be ended by |;| (semicolon version). \begin{tztikz}{} \tzplotcurve(0,0)(1,1)(2,1); % works like: - \draw [smooth,tension=1] plot coordiates {(0,0)(1,1)(2,1)}; + \draw [smooth,tension=1] plot coordinates {(0,0)(1,1)(2,1)}; \end{tztikz} You can change the tension value by specifying the optional argument |{<tension>}|, before the first coordinate. @@ -968,7 +969,7 @@ You can change the tension value by specifying the optional argument |{<tension> \tzaxes[<opt>]<x-shift,y-shift>(<x1,y1>)(<x2,y2>) {<x-text>}[<x-opt>]{<y-text>}[<y-opt>] % defaults - [->,>=stealth]<0,0>(0,0)(<m>){}[right]{}[above] + [->]<0,0>(0,0)(<m>){}[right]{}[above] % <m> means mandatory \end{tzdef} @@ -987,7 +988,7 @@ And optionally the names of x-axis and y-axis can be printed at a specified plac \begin{tzcode}{.3} \begin{tikzpicture}[scale=.5] \tzhelplines(-1,-1)(8,5) -\tzaxes[draw=blue](8,5){$x$}{$y$} % +\tzaxes[draw=blue](8,5){$x$}{$y$} %% \end{tikzpicture} \end{tzcode} @@ -1004,7 +1005,7 @@ With the optional argument |<x-shift,y-shift>|, the axes are shifted accordingly \subsection{\protect\cmd{\tzaxes*}} \label{ssi:tzaxes*} -The starred version \icmd{\tzaxes*} is just to set the current state to a \iisw{bounding box} when |\tzaxes| is executed. Use |\tzaxes*| before any larger graphics. +The starred version \icmd{\tzaxes*} is just to set the current state to a \iisw{bounding box} when the |\tzaxes| macro execution is completed. Use |\tzaxes*| before any larger graphics. \begin{tzcode}{.3} \begin{tikzpicture}[scale=.5] @@ -1039,7 +1040,7 @@ The starred version \icmd{\tzaxes*} is just to set the current state to a \iisw{ \end{tikzpicture} \end{tzcode} -|\tzshoworigin*(<coor>){<text>}[<node opt>]| prints a node dot and text around |(<coor>)|, by default |(0,0)|. (Notice that the place where the |<text>| is printed at is not by |<angle>|. So you can use the abbreviations of \Tikz\ basic placement options such as |a|, |l|, |br|, ect. See Section \ref{s:abbreviations}.) +|\tzshoworigin*(<coor>){<text>}[<node opt>]| prints a node dot and text around |(<coor>)|, by default |(0,0)|. (Notice that the place where the |<text>| is printed at is not by |<angle>|. Instead, you can use the \xem{abbreviations} of \Tikz\ basic placement options such as |a|, |l|, |br|, ect. See Section \ref{s:stylenames}, for more details.) \begin{tzcode}{.3} \begin{tikzpicture}[scale=.5] @@ -1085,7 +1086,7 @@ Notice that, in the above example, the two axes intersect at |(7,4)| by the shif \subsection{\protect\cmd{\tzticks}} \label{ssi:tzticks} -\icmd{\tzticks}|{<x-tick places>}{y-tick places>}| prints tick labels for x- and y-axis at specified places, which are comma separated. +\icmd{\tzticks}|{<x-tick places>}{<y-tick places>}| prints tick labels for x- and y-axis at specified places, which are comma separated. By default, tick labels are the numbers specified. \begin{tzcode}{.3} @@ -1093,32 +1094,35 @@ By default, tick labels are the numbers specified. \tzhelplines(8,5) \tzshoworigin \tzaxes(-1,-1)(8,5) -\tzticks{1,2,...,8}{1,2,...,5} +\tzticks{1,2,...,8} % x-ticks + {1,2,...,5} % y-ticks \end{tikzpicture} \end{tzcode} -You can change the numbered label, for example |{2,4,7}|, to any other form, by doing like, for example, |{2/mylabel,4,7}|. (Internally, |\tzticks| uses |foreach| operation of \Tikz.) +You can change the numbered labels, for example |{2,4,7}|, to any other form, by doing like, for example, |{2/mylabel,4,7}|. (Internally, |\tzticks| uses the |foreach| operation of \Tikz.) \begin{tzcode}{.3} \begin{tikzpicture}[scale=.5,font=\scriptsize] \tzhelplines(8,5) \tzshoworigin \tzaxes(-1,-1)(8,5) -\tzticks{2/x,4/y,5.5/$z_1$,7}{1,2.5/$\frac25$,4} +\tzticks{2/x,4/y,5.5/$z_1$,7} + {1,2.5/$\frac25$,4} \end{tikzpicture} \end{tzcode} \subsection{\protect\cmd{\tzticks*}} \label{ssi:tzticks*} -\icmd{\tzticks*} prints tick labels from |0pt| to |3pt| by default, without printing tick labels. +The starred version \icmd{\tzticks*} prints tick marks from |0pt| to |3pt| by default, without printing tick labels. \begin{tzcode}{.3} \begin{tikzpicture}[scale=.5,font=\scriptsize] %\tzhelplines(8,5) \tzshoworigin \tzaxes(-1,-1)(8,5) -\tzticks*{1,2,...,7}{1,2,...,4} +\tzticks*{1,2,...,7} + {1,2,3,4} \end{tikzpicture} \end{tzcode} @@ -1128,7 +1132,8 @@ You can change the length of tick marks, for example, like |(-2pt:3pt)| and |(-5 \begin{tikzpicture}[scale=.5] \tzhelplines(-1,-1)(8,5) \tzaxes(-1,-1)(8,5) -\tzticks*(-2pt:3pt){1,2,...,7}(-5pt:10pt){1,2,...,4} +\tzticks*(-2pt:3pt){1,2,...,7} + (-5pt:10pt){1,2,3,4} \end{tikzpicture} \end{tzcode} @@ -1167,7 +1172,7 @@ You can change the length of tick marks, for example, like |(-2pt:3pt)| and |(-5 \subsection{\protect\cmd{\tzprojx(*)}, \protect\cmd{\tzprojy(*)}} \label{ssi:tzprojx} -\icmd{\tzprojx} draws a dotted (by default) line from a coordinate to its projection on the x-axis and prints text around (|[below]| by default) the projection point. +\icmd{\tzprojx} draws a dotted (by default) line from a specified coordinate to its projection point on the x-axis and prints text around (|[below]| by default) the projection point. |\tzprojy| works similarly but for the projection point on the y-axis. @@ -1191,6 +1196,8 @@ You can change the length of tick marks, for example, like |(-2pt:3pt)| and |(-5 \tznode(3,2){$(x_1,x_2)$}[ar] \tzprojx*(3,2){$x_1$}[xshift=-3pt] \tzprojy[->,dashed,draw=red](3,2){$x_2$} +\tzprojx*(1.5,2.5){$a$} +\tzprojy*(2.5,1.5){$b$} \end{tikzpicture} \end{tzcode} @@ -1221,7 +1228,7 @@ And \icmd{\tzproj*} combines |\tzprojx*| and |\tzprojy*|, so it suppresses tick \label{ssi:tzfn} \icmd{\tzfn}|{<fn of \x>}[<a:b>]| plots a function of $x$ over the specified domain $[a:b]$, which means that $a\leq x \leq b$. -Optionally, you can add |{<text>}| at |[<node opt>]| as shown in the following example. +Optionally, you can add |{<text>}| with |[<node opt>]| as shown in the following example. \begin{tzcode}{.3} \begin{tikzpicture}[scale=.7] @@ -1258,21 +1265,21 @@ You can name a path formed by |\tzfn| by specifying the optional argument |"<pat \end{tzcode} \remark -If the curly brace mandatory argument consists of \xem{only a macro name} like |{\Foo}|, the macro name |Foo| (without the backslash) is automatically assigned to the \xem{name of the path}. +If the curly brace mandatory argument consists of \xem{only a macro name} like |{\Foo}|, the macro name |Foo| (without the backslash) is automatically assigned to the \xem{name of the path}. (See Section \ref{ss:tzfn:namepath} on page \pageref{ss:tzfn:namepath}, for more details.) \subsection{\protect\cmd{\tzhfnat}, \protect\cmd{\tzhfn}: Horizontal lines} \label{ssi:tzhfn} -\icmd{\tzhfnat} draws a horizontal line (the graph of a constant function) at $y$, by default, from bottom to top of the \ixxw{current bounding box}. +\icmd{\tzhfnat} draws a horizontal line (the graph of a constant function) at $y$, by default, from left to right of the \ixxw{current bounding box}. \begin{tzdef}{} % syntax -\tzhfnat[<opt>]"<path name>"{<y-val>}[<from:to>]{<text>}[<pos>] +\tzhfnat[<opt>]"<path name>"{<y-val>}[<from:to>]{<text>}[<node opt>] % defaults - []""{<m>}[south:north of current bounding box]{}[] + []""{<m>}[west:east (of current bounding box)]{}[] \end{tzdef} -\icmd{\tzhfn}|(<coor>)| accepts a coordinate, instead of the value of $y$ to draw a vertical line at the value of $y$ coordinate of |(<coor>)|, ignoring the value of $x$ coordinate. +\icmd{\tzhfn}|(<coor>)| accepts a coordinate, instead of the value of $y$, to draw a horizontal line at the value of $y$ coordinate of |(<coor>)|, ignoring the value of $x$ coordinate. \begin{tzcode}{.3} \begin{tikzpicture} @@ -1289,13 +1296,13 @@ If the curly brace mandatory argument consists of \xem{only a macro name} like | \subsection{\protect\cmd{\tzvfnat}, \protect\cmd{\tzvfn}: Vertical lines} \label{ssi:tzvfn} -\icmd{\tzvfn} draws a vertical line at $x$ from left to right of the |current bounding box| by default. +\icmd{\tzvfnat} draws a vertical line at $x$ from bottom to top of the |current bounding box| by default. \begin{tzdef}{} % syntax: simplified \tzvfnat[<opt>]"<path name>"{<x-vale>}[<from:to>]{<text>}[<pos>] % defaults - []""{<m>}[west:east of current bounding box]{}[] + []""{<m>}[south:north (of current bounding box)]{}[] \end{tzdef} \icmd{\tzvfn}|(<coor>)| accepts a coordinate, instead of the value of $x$. It draws a vertical line at the value of $x$ coordinate of |(<coor>)|, ignoring the value of $y$ coordinate. @@ -1315,8 +1322,8 @@ If the curly brace mandatory argument consists of \xem{only a macro name} like | \subsection{\protect\cmd{\tzLFn}: Linear functions} \label{ssi:tzLFn} -\icmd{\tzLFn}|(<coor1>)(<coor2>)...| draws a \xem{linear function} passing through two points: |(<coor1)| and |(<coor2>)|. -|\tzLFn(<coor1>){<slope>}...| draws a linear function passing through |(<coor1>)| with the slope of |<slope>|. If both of the two coordinates are specified the |<slope>| is ignored. The domain in the form of |[a:b]| is also required. +\icmd{\tzLFn}|(<coor1>)(<coor2>)...| draws a \xem{linear function} passing through two points: |(<coor1>)| and |(<coor2>)|. +|\tzLFn(<coor1>){<slope>}...| draws a linear function passing through one point, |(<coor1>)|, with the slope of |<slope>|. If both of the two coordinates are specified the option |{<slope>}| is ignored. The domain in the form of |[a:b]| is also a required argument. \begin{tzcode}{.3} \begin{tikzpicture}[scale=.7,font=\footnotesize] @@ -1339,20 +1346,21 @@ If the curly brace mandatory argument consists of \xem{only a macro name} like | In \Tikz, you can find \xem{intersection} points when two \xem{named paths} intersect. The name of a path is usually given by the option |[name path=<path name>]| in \Tikz. -In this package, of course, you can use the option |[name path=<path name>]| in usual \Tikz\ way. With the package \pkg{tzplot}, you can also name a path by specifying an optional argument within quotation marks such as |"<path name>"|. +With the package \pkg{tzplot}, you can name a path by specifying an optional argument within quotation marks such as |"<path name>"|. +(Of course, you can also name a path in usual \Tikz\ way, like |[name path=<path name>]|.) -All macros (with a few exceptions) related to lines and curves accept this quotation optional argument to name paths as follows: +In this package, all macros (with a few exceptions) related to lines and curves accept this quote optional argument to name paths as follows: \begin{verbatim} \tzline[<opt>]"<path name>"(<coor>)... - \tzlines..."<path name>"(<coor>)... - \tzpolygon..."<path name">(<coor>)... - \tzpath..."<path name">(<coor>)... - \tzto..."<path name">(<coor>)... - \tzparabola..."<path name">(<coor>)... - \tzbezier..."<path name">(<coor>)... - \tzfn..."<path name">{<fn of \x>}... - \tzLFn..."<path name">(<coor>)... + \tzlines... "<path name>"(<coor>)... + \tzpolygon... "<path name>"(<coor>)... + \tzpath... "<path name>"(<coor>)... + \tzto... "<path name>"(<coor>)... + \tzparabola..."<path name>"(<coor>)... + \tzbezier... "<path name>"(<coor>)... + \tzfn... "<path name>"{<fn of \x>}... + \tzLFn... "<path name>"(<coor>)... and more... \end{verbatim} @@ -1361,12 +1369,12 @@ All macros (with a few exceptions) related to lines and curves accept this quota \draw [dashed,name path=foo](1,1) -- (3,3); \end{tztikz} -In most cases, the quotation optional arguments for naming paths are placed immediately before the first mandatory argument or essential argument (when no mandatory argument exists) of the |tzplot| macros. +In most cases, the quote optional arguments for naming paths are placed \xem{immediately before the first mandatory argument} of the |tzplot| macros. \subsection{\protect\cmd{\tzXpoint(*)}: Intersection points of two paths} \label{ssi:tzXpoint} -For example, \icmd{\tzXpoint}|{path1}{path2}(A)| finds intersection points of |path1| and |path2| and names the first intersection point |(A)|. This intersection can be referred to as |(A)| or |(A-1)|. If there are two or more intersection points found, they are called |(A)=(A-1)|, |(A-2)|, |(A-3)|, and so on. +For example, \icmd{\tzXpoint}|{path1}{path2}(A)| finds intersection points of |path1| and |path2| and names the first intersection point |(A)|. This intersection point can be referred to as |(A)| or |(A-1)|. If there are two or more intersection points found, they are called |(A)=(A-1)|, |(A-2)|, |(A-3)|, and so on. \begin{tzcode}{.3} \begin{tikzpicture} @@ -1395,17 +1403,17 @@ You can label the point by specifying |{<text>}| and |[<angle>]| after the speci \end{tzcode} \remark -You have to expect \Tikz\ to take a few seconds (or less) to find the intersection points. +You have to expect \Tikz\ to take a few seconds (or less) to find intersection points. \subsection{\protect\cmd{\tzvXpointat(*)}, \protect\cmd{\tzvXpoint(*)}: Vertical intersection points} \label{ssi:tzvXpoint} To find vertical intersection points at $x$ to a curve, you should specify a path name and either the value of $x$ or the coordinate $(x,y)$. Here the $y$ coordinate is ignored. -\icmd{\tzvXpointat}|{<path>}{<x>}(A)| finds vertical intersection points with |<path>| at $x=\texttt{<x>}$ and names it |(A)|. +\icmd{\tzvXpointat}|{<path>}{<x>}(A)| finds vertical intersection points of |<path>| at $x=\texttt{<x>}$ and names it |(A)|. The starred version \icmd{\tzvXpointat*} additionally prints a node dot at the (first) intersection point. -For example, \icmd{\tzvXpoint}|{<path>}(<coor>)(A)| gives the same result as |\tzvXpoint{<path>}{<x-coor>}(A)|. Here the $y$ coordinate of |(<coor>)| is not important. |\tzvXpoint| is useful when you do not know the exact value of $x$ coordinate of |(<coor>)|. +The macro \icmd{\tzvXpoint} uses |(<coor>)|, while |\tzvXpointat| uses the value of $x$. Here the $y$ coordinate of |(<coor>)| is not important. |\tzvXpoint| is useful when you do not know the exact value of $x$ coordinate of |(<coor>)|. The starred version \icmd{\tzvXpoint*} additionally prints a node dot at the (first) intersection point. @@ -1423,13 +1431,14 @@ The starred version \icmd{\tzvXpoint*} additionally prints a node dot at the (fi \end{tzcode} -\subsection{\protect\cmd{\tzhXpointat}, \protect\cmd{\tzhXpoint}: Horizontal intersection points} +\subsection{\protect\cmd{\tzhXpointat(*)}, \protect\cmd{\tzhXpoint(*)}: Horizontal intersection points} \label{ssi:tzhXpoint} \icmd{\tzhXpointat}|{<path>}{<y>}(A)| works like |\tzvXpointat{<path>}{<x>}(A)|, but it uses the value of $y$ instead of $x$. The starred version \icmd{\tzhXpointat*} additionally prints a node dot at the (first) intersection point. -\icmd{\tzhXpoint}|{<path>}(<coor>)(A)| works like |\tzvXpoint{<path>}(<coor>)(A)|, but it uses only the $y$ coordinate of |(<coor>)|, ignoring the value of $x$ coordinate. +\icmd{\tzhXpoint} uses |(<coor>)|, while |\tzhXpointat| uses the value of $y$. +Here the $x$ coordinate of |(<coor>)| is ignored. The starred version \icmd{\tzhXpoint*} prints a node dot at the (first) intersection point. \begin{tzcode}{.3} @@ -1455,29 +1464,33 @@ The starred version \icmd{\tzhXpoint*} prints a node dot at the (first) intersec \subsection{\protect\cmd{\tztangentat}} \label{ssi:tztangentat} -\icmd{\tztangentat}|{<path>}{<x>}| draws a tangent line to |<path>| at $x=\texttt{<x>}$. The line is drawn on the |behind| layer, by default. - -\remark -The slope of a tangent line drawn by |\tztangentat| is just approximate. +\icmd{\tztangentat}|{<path>}{<x>}[<a:b>]| draws a tangent line to |<path>| at $x=\texttt{<x>}$ over $x\in [a,b]$. +The domain is a mandatory argument and should be of the form |[<from:to>]|. \begin{tzdef}{} -% syntax -\tztangentat{<path>}{<x>}[<domain>]{<text>}[<pos>] +% syntax: simplified +\tztangentat{<path>}{<x>}[<domain>]{<text>}[<node opt>] % defaults []{<m>}{<m>}[<m>]{}[] % <m> means mandatory \end{tzdef} -The domain is a mandatory argument and should be of the form |[<from:to>]|. + +\remark +The slope of a tangent line drawn by |\tztangentat| is just approximate. + +The line is drawn on the |behind| layer, by default. + +You can also add some text next to the line by specifying the optional arguments |{<text>}| and |[<node opt>]|, after the domain. \begin{tzcode}{.3} \begin{tikzpicture}[scale=.7] -\tzhelplines[use as bounding box](5,5) +\tzhelplines(5,5) \tzparabola[thick,blue]"curve"(0,1)(2,3)(4,2) \tzvXpointat*{curve}{1} \tzvXpointat*{curve}{3} \tztangentat{curve}{1}[0:3] -\tztangentat[red]{curve}{3}[1:5] +\tztangentat[red]{curve}{3}[1:5]{tangent at $x=3$}[b] \end{tikzpicture} \end{tzcode} @@ -1486,24 +1499,24 @@ The domain is a mandatory argument and should be of the form |[<from:to>]|. \icmd{\tztangent} works like |\tztangentat|, but it accepts a coordinate instead of the value of $x$. -|\tztangent{<path>}(<coor>)| draws a tangent line to |<path>| at $x$ coordinate of |(<coor>)|. Here, the $y$ coordinate of |(<coor>)| is ignored. The line is drawn on the |behind| layer, by default. +|\tztangent{<path>}(<coor>)| draws a tangent line to |<path>| at the $x$ coordinate of |(<coor>)|. Here, the $y$ coordinate of |(<coor>)| is ignored. The line is drawn on the |behind| layer, by default. \begin{tzdef}{} -% syntax -\tztangentat{<path>}(<coor>)[<from:to>]{<text>}[<pos>] +% syntax: simplified +\tztangent{<path>}(<coor>)[<from:to>]{<text>}[<node opt>] % defaults []{<m>}(<m>)[<m>]{}[] \end{tzdef} \begin{tzcode}{.3} \begin{tikzpicture}[scale=.7] -\tzhelplines[draw=none,use as bounding box](5,5) +\tzhelplines(5,5) \tzparabola[thick,blue]"curve"(0,1)(2,3)(4,2) \tzvXpoint*{curve}(1,0)(A){A}[135] \tzvXpoint*{curve}(3,0)(B){B}[45] \tztangent{curve}(A)[0:3] -\tztangent[red]{curve}(B)[1:5] +\tztangent[red]{curve}(B)[1:5]{tangent at $B$}[b] \end{tikzpicture} \end{tzcode} @@ -1516,8 +1529,8 @@ The domain is a mandatory argument and should be of the form |[<from:to>]|. \begin{tzcode}{.3} \begin{tikzpicture}[scale=.7] -\tzhelplines[use as bounding box](5,5) -\tzaxes(5,5) +\tzhelplines(5,5) +\tzaxes*(5,5) \tzparabola"curve"(0,1)(2,3)(5,1) \tzsecantat{curve}{1}{2} \tzsecantat[red]{curve}{1}{3} @@ -1531,7 +1544,7 @@ The domain is a mandatory argument and should be of the form |[<from:to>]|. \begin{tzcode}{.3} \begin{tikzpicture}[scale=.7] -\tzhelplines[use as bounding box](5,5) +\tzhelplines(5,5) \tzaxes(5,5) \tzparabola"curve"(0,1)(2,3)(5,1) \tzsecant{curve}(1,0)(2,0) @@ -1611,7 +1624,7 @@ Here, we are using |\tzto|. \end{tikzpicture} \end{tzcode} -\paragraph{Step 4} If necessary, use |\tzproj| to draw projection lines with text at the projection points. +\paragraph{Step 4} If necessary, use |\tzproj| to draw projection lines with text around the projection points. \begin{tzcode}{.3} \begin{tikzpicture}[x=0.05cm,y=0.05cm,scale=.7] @@ -1653,9 +1666,9 @@ Here, we are using |\tzto|. % step 2 \def\demA{100-\x} \def\suppA{10+\x} -\tzfn\demA[0:100]{$D$}[ar] % name path = \demA -\tzfn\suppA[0:90]{$S$}[r] % name path = \suppA -\tzXpoint*{demA}{suppA}(E) +\tzfn\demA[0:100]{$D$}[ar] % name path = \demA +\tzfn\suppA[0:90]{$S$}[r] % name path = \suppA +\tzXpoint*{demA}{suppA}(E){$E$} % step 3 \tzfn[dashed]"suppB"{\suppA+20}[0:80]{$S'$}[ar] \tzXpoint*{demA}{suppB}(newE){$E'$} @@ -1853,7 +1866,7 @@ Here, we are using |\tzto|. \tzto[out=0,in=-95](5,2)(8,6){$LM$}[a] \tzto[dashed,out=0,in=-95](5,2)(9.5,6){$LM'$}[a] \tzLFn"IS"(4,2){-1}[5:1]{$IS$}[a] -\tzLFn[dashed]<1,0>"ISa"(4,2){-1}[5:1]{$IS'$}[a] % shift +\tzLFn[dashed]<1,0>"ISa"(4,2){-1}[5:1]{$IS'$}[a] %% \tzXpoint{IS}{LM}(E) \tzXpoint{ISa}{LM}(E1) \tzproj(E){$Y^*$}{$r_0$} @@ -1920,8 +1933,8 @@ See Section \ref{s:tzto} on page \pageref{s:tzto} for more details. \tzaxes(4,4){alternatives}{preferences} \tzticksx{1/$a$,2/$b$,3/$c$} \tzplot[mark=ball](1,3)(2,2)(3,1){A}[0]; -\tzplot[mark=*,mark color=red](1,2)(2,1)(3,3){B}[0]; -\tzplot[mark=+](1,1)(2,3)(3,2){C}[0]; +\tzplot[mark=*] (1,2)(2,1)(3,3){B}[0]; +\tzplot[mark=+] (1,1)(2,3)(3,2){C}[0]; \end{tikzpicture} \end{tzcode} diff --git a/graphics/pgf/contrib/tzplot/tzplot-doc-C-v1.0.tex b/graphics/pgf/contrib/tzplot/tzplot-doc-C-v1.0.1.tex index 36320a2bfd..6b2dd29562 100644 --- a/graphics/pgf/contrib/tzplot/tzplot-doc-C-v1.0.tex +++ b/graphics/pgf/contrib/tzplot/tzplot-doc-C-v1.0.1.tex @@ -32,7 +32,7 @@ The styles \ixttw{tzdotted}, \ixttw{tzdashed}, and \ixttw{tzhelplines} are defin } \end{tzsty} -The style |tzdotted| and |tzdashed| prints 10 dots and 10 dashes per 1cm, respectively, by default. +The styles |tzdotted| and |tzdashed| print 10 dots and 10 dashes per 1cm, respectively, by default. The style |tzhelplines| uses |tzdotted| by default. @@ -58,7 +58,7 @@ The starred version \icmd{\tzhelplines*} uses the grid as a \iisw{bounding box}. Here, |(|\ixxw{<m>}|)| stands for a \xem{mandatory} argument. \begin{tztikz}{} -\tzhelplines(4,3) % works similarly to: +\tzhelplines(4,3) % works similarly to: \draw [help lines] (0,0) grid (4,3); \tzhelplines(1,1)(4,3) % works similarly to: @@ -117,6 +117,25 @@ Similarly for |tzdashed|. \end{tzcode} +%%------------------------------------------------------------ +\section{\protect\cmd{\tzbbox}: A bounding box} +\label{s:tzbbox} + +\icmd{\tzbbox} sets a bounding box. + +\begin{tzdef}{} +% syntax +\tzbbox(<coor1>)(<coor2>) +% defaults + (0,0)(<m>) +\end{tzdef} + +\begin{tztikz}{} +\tzbbox(-1,-1)(4,3) % is an abbreviation of: + \path [ use as bounding box ] (-1,-1) rectangle (4,3); +\end{tztikz} + +If only one coordinate is specified, the first coordinate is regarded as |(0,0)|. %%================================== \chapter{Dots} @@ -154,7 +173,7 @@ There are three ways to change the \xem{radius} of a circle dot drawn by |\tzcdo \item The simplest way is to use the last parenthesis option, like |\tzcdot(0,0)(3pt)|. \begin{tztikz}{} -\tzcdot(0,0) or \tzcdot(0,0)(1.2pt) % is an abbreviation of: +\tzcdot(0,0) % is an abbreviation of: \draw (0,0) circle (1.2pt); % default radius=1.2pt \end{tztikz} @@ -168,8 +187,8 @@ You can use the key-value option |[tzcdot=<dim>]|, like |\tzcdot[tzcdot=3pt](0,0 If both the |tzcdot| key-value and the last parenthesis option are used, the former wins. \begin{tztikz}{} -\tzcdot\tzcddot[tzcdot=1.2pt](1,1) or \tzcdot(1,1) % works like: - \draw (1,1) circle [radius=1.2pt]; % default radius=1.2pt +\tzcdot*(1,1) % works like: + \draw [fill] (1,1) circle [radius=1.2pt]; % default radius=1.2pt \end{tztikz} \begin{tztikz}{} @@ -204,7 +223,7 @@ It is effective within the |tizpicture| environment unless changed by \icmd{\set \paragraph{How to label} -You can add a label to a specified coordinate by adding the optional argument |{<label>}| immediately after |(<coor>)|. You can also change the |<label>| position by the option |[<angle]|. +You can add a label to a specified coordinate by adding the optional argument |{<label>}| immediately after |(<coor>)|. You can also change the |<label>| position by the option |[<angle>]|. (Note that you \xem{cannot} use the abbreviations such as |a|, |r|, |bl|, etc. to place label nodes.) \begin{tztikz}{} @@ -227,10 +246,10 @@ You can add a label to a specified coordinate by adding the optional argument |{ \end{tikzpicture} \end{tzcode} -The position does not depend on the size of dot circles. +The label position does not depend on the size of circle dots. \paragraph{How to change colors} -With the first optional argument |[<opt>]| you can change the color of a dot. +With the first optional argument |[<opt>]|, you can change the color of a dot. You can also change the color of a label, as shown in the following example. \begin{tzcode}{.3} @@ -281,16 +300,16 @@ Dots can be shifted by specifying the optional argument |<shift coor>| immediate The macro \icmd{\tzcdots} takes an arbitrary number of coordinates as arguments to print multiple circle dots with the radius |1.2pt|, by default. You need to indicate when the iteration of an arbitrary number of coordinates ends, by typing a \xem{semicolon} |;|. -Let us call this kind of macro a \iisw{semicolon version}. +Let us call this kind of macro a \iisw{semicolon version} macro. \remark \begin{itemize} \item DO NOT FORGET to enter `|;|' at the end of iteration. \begin{itemize} - \item Tokens such as `|!|' and `|#|' other than the open parenthesis `|(|' works like the semicolon `|;|' to indicate the end of iteration. + \item Tokens such as `|!|' and `|#|' other than the open parenthesis `|(|' work like the semicolon `|;|' to indicate the end of iteration. But it is highly recommended to use `|;|' for consistency. \end{itemize} -\item Without |;|, the macro does nothing or a compile error occurs. +\item Without the semicolon |;|, the macro does nothing or a compile error occurs. \end{itemize} @@ -360,7 +379,7 @@ The effect remains within the |tikzpicture| environment unless it is changed aga \paragraph{How to change colors} With the first optional argument |[<opt>]|, you can change the color of dots. -You can also change the color of all labels together using the first optional argument, +You can also change the color of all labels at once using the first optional argument, like |\tzcdots[text=red]...| as shown in the following example. \begin{tzcode}{.3} @@ -434,11 +453,11 @@ There are \iscw{Three Ways} to change the \xem{diameter} (or |minimum size|) of \begin{tztikz}{} \tzdot(0,0) % works like: \path (0,0) node [tzdot=2.4pt] {}; % default size -% or equivalently + % or equivalently \node [tzdot,minimum size=2.4pt] at (0,0) {}; \end{tztikz} -\item The simplest way is to use the last parenthesis optional argument, like |\tzdot(0,0)(5pt)|, which yields the same result as in |\tzdot[tzdot=5pt](0,0)|. +\item The simplest way is to use the \xem{last} parenthesis optional argument, like |\tzdot(0,0)(5pt)|, which yields the same result as in |\tzdot[tzdot=5pt](0,0)|. If both options are used, the |tzdot| (or |minimum size|) option overwrites the last parenthesis option. \begin{tzcode}{.3} @@ -450,7 +469,7 @@ If both options are used, the |tzdot| (or |minimum size|) option overwrites the \end{tikzpicture} \end{tzcode} -\item To change the size of all node dots draw by |\tzdot*|, you can use the macro |\settzdotsize|. Its effect remains until the end of |tikzpicture| environment unless changed again. +\item To change the size of all node dots drawn by |\tzdot*|, you can use the macro |\settzdotsize|. Its effect remains valid until the end of |tikzpicture| environment unless changed again. \begin{tzcode}{.3} % \settzdotsize @@ -472,7 +491,7 @@ You can add a label to a specified coordinate by specifying the optional argumen You can also change the label position by the option |[<angle>]| following |{<label>}|. \begin{tztikz}{} -\tzdot(0,0){A}(3pt) % works like: +\tzdot(0,0){A}(3pt) % works like: \path (0,0) node [tzdot=3pt,label={:A}] {}; \tzdot*(0,0){A}[[red]0](3pt) % works like: @@ -492,19 +511,19 @@ You can also change the label position by the option |[<angle>]| following |{<la \end{tikzpicture} \end{tzcode} -Unlike |\tzcdot|, the |\tzdot|'s label position depends on the size of a circle node. In \Tikz\ jargon, |{<label>}| is a \iisw{label node} for a \iisw{main node} that is a circle node with no text in it. +Unlike |\tzcdot|, the |\tzdot|'s label position depends on the size of a circle node. In \Tikz\ jargon, |{<label>}| is in a \iisw{label node} for a \iisw{main node} that is a circle node with no text in it, so |<label>| moves accordingly as the main node dot gets bigger or smaller. \subsection{How to change colors and shapes} \label{ss:tzdot:color} -With the first optional argument |[<node opt>]| you can change of the color or shape of dots. -You can also change the label color using |[<label opt>]| as shown in the example below. +With the first optional argument |[<node opt>]|, you can change of the color or shape of dots. +You can also change the label color using |[<label opt>]| as shown in the following example. \remark \begin{itemize} \item |[<node opt>]| is for options of \xem{main nodes}, |[<label opt>]| is for options of \xem{label nodes}. -\item |[<label opt>]| is used in the form of |[[<label opt>]angle>]|. +\item |[<label opt>]| is used in the form of |[<[label opt]angle>]|. \end{itemize} \begin{tzcode}{.3} @@ -597,8 +616,8 @@ circle \tzcdot \tzcdots \settzcdotradius [tzcdot=1.2pt] % radius |\tzdot| is also useful for labelling a large dot. \begin{itemize} \item In |\tzdot|, |<label>| is a label in a \iisw{label node} for a node dot (as a \iisw{main node}). - So if a node dot gets larger, its label moves accordingly. - (Unlike, a label with |\tzcdot| or |\tzcdots|.) + So if a main node dot gets larger or smaller, its label moves accordingly. + (Unlike, the labels with |\tzcdot| or |\tzcdots|.) \item The position of |<label>| in |\tzcdot| does not depend on the size of dots. \end{itemize} \item The package |tzplot| takes |\tzdot| as a \xem{standard dot}, not |\tzcdot|. @@ -610,18 +629,18 @@ So, you can apply the \threeways\ (on page \pageref{ss:threeways}) to change the \section{\protect\cmd{\tzdots(*)}: Multiple node dots} \label{s:tzdots} -\icmd{\tzdots} takes an arbitrary number of coordinates as arguments to print multiple node circle dots with the \xem{diameter} (or |minimum size|) of |2.4pt|, by default. +\icmd{\tzdots} takes an arbitrary number of coordinates as arguments to print multiple circle node dots with the \xem{diameter} (or |minimum size|) of |2.4pt|, by default. -This is a \iisw{semicolon version} macro, with the whole repeating pattern |(<coor>){<label>}[<angle>]|, which means that you need to type a \xem{semicolon} |;| at the end of the repetition. The \xem{semicolon} says, ``\xem{The repetition ends here}." +This is a \iisw{semicolon version} macro, with the repeating pattern |(<coor>){<label>}[<angle>]|, which means that you need to type a \xem{semicolon} `|;|' at the end of the coordinate repetition. The \xem{semicolon} says, ``\xem{The repetition ends here}." \remark \begin{itemize} \item DO NOT FORGET to enter `|;|' at the end of iteration. \begin{itemize} - \item Tokens such as `|!|' and `|#|' other than the open parenthesis `|(|' works like the semicolon `|;|' to indicate the end of iteration. + \item Tokens such as `|!|' and `|#|' other than the open parenthesis `|(|' work like the semicolon `|;|' to indicate the end of iteration. But it is highly recommended to use `|;|' for consistency. \end{itemize} -\item Without |;|, the macro does nothing or a compile error occurs. +\item Without the semicolon |;|, the macro does nothing or a compile error occurs. \end{itemize} The starred version \icmd{\tzdots*} prints multiple filled node dots. @@ -663,12 +682,12 @@ Each coordinate can be followed by the optional arguments |{<label>}| and |[<ang \end{tzcode} -\paragraph{How change the size of dots} +\paragraph{How to change the size of dots} There are \threeways\ of changing the \xem{diameter} of node dots, as discussed in Section \ref{ss:threeways} on page \pageref{ss:threeways}. \begin{enumerate} -\item The simplest way is to use the `last' parenthesis optional argument, \xem{after the semicolon}. +\item The simplest way is to use the \xem{last} parenthesis optional argument, \xem{after the semicolon}. \item Another way is to use the style \ixxw{tzdot}, like |\tzdots[tzdot=3pt]...|. If both options are used the |tzdot| option style wins. \item You can also use the macro \icmd{\settzdotsize}. @@ -691,7 +710,7 @@ The effect remains within the |tikzpicture| environment unless it is changed aga \paragraph{How to change colors} -With the first optional argument |[<node opt>]| you can change of the color of node dots. +With the first optional argument |[<node opt>]| you can change the color of node dots. You can also change the color of each label by |[<label opt>]|. \begin{tzcode}{.3} @@ -711,8 +730,8 @@ You can also change the color of each label by |[<label opt>]|. \remark \begin{itemize} \item |[<node opt>]| is the option of a \iisw{main node} and |[<label opt>]| is the option of a \iisw{label node}. -\item |[<label opt>]| is used in the form of |[<[<label opt>]angle>]|, like |[[red]90]|. -\item You can control all labels together using |every label/.style| as in the following example. +\item |[<label opt>]| is used in the form of |[<[label opt]angle>]|, like |[[red]90]|. +\item You can control all labels together using |every label/.style| as in the following examples: \end{itemize} \begin{tzcode}{.3} @@ -735,14 +754,16 @@ You can also change the color of each label by |[<label opt>]|. % every label/.style \begin{tikzpicture}[every label/.style={draw,text=red}] \tzhelplines(4,3) -\tzdots*(0,0){Ace}[[font=\LARGE\ttfamily]-90] - (2,1){\textbf{Bob}}[[blue]135] - (3,2){$C_1$\\$N_o$}[[align=center]0]; +\tzdots* + (0,0){Ace}[[font=\LARGE\ttfamily]-90] + (2,1){\textbf{Bob}}[[blue]135] + (3,2){$C_1$\\$N_o$}[[align=center]0]; \end{tikzpicture} \end{tzcode} \paragraph{Shift} You can move the coordinates of dots by specifying |<shift coor>| option immediately before the first coordinate. +The empty shift option |<>| is not allowed. \begin{tzcode}{.3} % \tzdots: shift @@ -800,7 +821,7 @@ You can put a label to a coordinate by specifying the optional arguments |{<labe % \tzcoor \begin{tikzpicture} \tzhelplines(4,3) -\tzcoor(0,0)(A){$A_1$} % Tikz default: 90 or above +\tzcoor(0,0)(A){$A_1$} % TikZ default: 90 or above \tzcoor(2,1)(B){$B_2$\\ending point}[[align=left,red]0] \draw (A) -- (B); \end{tikzpicture} @@ -808,6 +829,7 @@ You can put a label to a coordinate by specifying the optional arguments |{<labe \paragraph{Shift} You can move the coordinate by specifying the optional argument |<shift coor>| before |(<coor>)|. +The empty shift option |<>| is not allowed. \begin{tzcode}{.3} % \tzcoor: shift @@ -851,10 +873,10 @@ The starred version \icmd{\tzcoor*} works like |\tzcoor| with one exception. It \end{tztikz} \begin{tzcode}{.3} -% \tzcoor +% \tzcoor* \begin{tikzpicture} \tzhelplines(4,3) -\tzcoor*(0,0)(A){$A_1$} % Tikz default: 90 or above +\tzcoor*(0,0)(A){$A_1$} % TikZ default: 90 or above \tzcoor*(30:3cm)(B){$B_2$}[[draw,blue]0] \draw (A) -- (B); \end{tikzpicture} @@ -862,10 +884,11 @@ The starred version \icmd{\tzcoor*} works like |\tzcoor| with one exception. It \paragraph{Changing the color and size of a dot} -You can change the color of a dot by specifying |[<dot opt>]|, which is, in fact, \Tikz\ node option. +You can change the color of a dot by specifying |[<dot opt>]|, which is, in fact, \Tikz's |node| option. To change the size of dots, you can apply the \threeways\ (see Subsection \ref{ss:threeways} on page \pageref{ss:threeways}). \begin{tzcode}{.3} +% \tzcoor*: color, size \begin{tikzpicture} \tzhelplines(4,3) \tzcoor(1,1)(A){A} @@ -877,6 +900,7 @@ To change the size of dots, you can apply the \threeways\ (see Subsection \ref{s \end{tzcode} \paragraph{Shift} The optional argument |<shift coor>| works just like in |\tzcoor|. +The empty shift option |<>| is not allowed. \begin{tzcode}{.3} % \tzcoor*: shift @@ -896,7 +920,7 @@ To change the size of dots, you can apply the \threeways\ (see Subsection \ref{s \label{ss:tzcoors} The macro \icmd{\tzcoors} takes an arbitrary number of pairs of coordinates and their names as arguments. -For example, |\tzcoors(0,0)(A) (1,1)(B) (2,2)(C);| means that |(0,0)| is represented by the name |(A)|, |(1,1)| by |(B)|, and |(2,2)| by |(C)|. +For example, |\tzcoors(0,0)(A) (1,1)(B) (2,2)(C);| means that the coordinate |(0,0)| is represented by the name |(A)|, |(1,1)| by |(B)|, and |(2,2)| by |(C)|. \begin{tzdef}{} % syntax: minimum @@ -905,11 +929,11 @@ For example, |\tzcoors(0,0)(A) (1,1)(B) (2,2)(C);| means that |(0,0)| is represe \tzcoors <shift coor>(<coor>)(<name>){<label>}[<[label opt]angle>] ..repeated.. ()(){}[] ; % defaults - (<m>)(<m>){}[] ..repeated.. ()(){}[] ; + <> (<m>)(<m>){}[] ..repeated.. ()(){}[] ; \end{tzdef} This is a \xem{semicolon version} macro. The quadruple |(<coor>)(<name>){<label>}[<angle>]| is the whole repeating pattern. -It is required to type a \xem{semicolon} (|;|) to indicate when the repetition ends. +It is required to type a \xem{semicolon} `|;|' to indicate when the coordinate repetition ends. \begin{tztikz}{} @@ -941,6 +965,7 @@ You can add a label to each specified coordinate by adding the optional argument \end{tzcode} By the option |<shift coor>|, all specified coordinates are shifted. +The empty shift option |<>| is not allowed. \begin{tzcode}{.3} % \tzcoors @@ -957,7 +982,7 @@ By the option |<shift coor>|, all specified coordinates are shifted. \subsection{\protect\cmd{\tzcoors*}} \label{ss:tzcoors*} -The starred version \icmd{\tzcoors*} takes an arbitrary number of coordinates as arguments to print node dots at the coordinates. Full repeating pattern is |(<coor>)(<name>){<label>}[<angle>]|. It is required to type a \xem{semicolon} |;| to indicate when the iteration of coordinates ends. +The starred version \icmd{\tzcoors*} takes an arbitrary number of coordinates as arguments to print node dots at the coordinates. Full repeating pattern is |(<coor>)(<name>){<label>}[<angle>]|. It is required to type a \xem{semicolon} `|;|' to indicate when the iteration of coordinates ends. \begin{tzdef}{} % syntax: minimum @@ -966,7 +991,7 @@ The starred version \icmd{\tzcoors*} takes an arbitrary number of coordinates as \tzcoors*[<dot opt>]<shift coor>(<coor>)(<name>){<label>}[<[label opt]angle>] ..repeated.. ()(){}[] ; (<dot size>) % defaults - *[](<m>)(<m>){}[] ..repeated.. ()(){}[] ; (2.4pt) + *[]<> (<m>)(<m>){}[] ..repeated.. ()(){}[] ; (2.4pt) \end{tzdef} You can label each dot by specifying the optional arguments |{<label>}| and |[<angle>]| after the pair |(<coor>)(<name>)|. @@ -982,8 +1007,8 @@ You can label each dot by specifying the optional arguments |{<label>}| and |[<a \end{tikzpicture} \end{tzcode} -You can change the dot color by |[<dot opt>]| and the label color by |[label opt]|. -You can apply the \threeways\ (on page \pageref{ss:threeways}) to change the dot size. The simplest way of changing the dot size is to specify the `last' (even after the semicolon) parenthesis option |(<dot size>)|. +You can change the dot color by |[<dot opt>]| and the label color by |[<label opt>]|. +You can apply the \threeways\ (on page \pageref{ss:threeways}) to change the dot size. The simplest way of changing the dot size is to specify the \xem{last} (even after the semicolon) parenthesis option |(<dot size>)|. \begin{tzcode}{.3} % \tzcoors* @@ -997,6 +1022,7 @@ You can apply the \threeways\ (on page \pageref{ss:threeways}) to change the dot \end{tzcode} By specifying the optional argument |<shift coor>| immediately before the first coordinate, you can move all specified coordinates. +The empty shift option |<>| is not allowed. \begin{tzcode}{.3} % \tzcoors*: shift @@ -1041,7 +1067,7 @@ You can see the coordinate array at a glance using \icmd{\tzcoorsquick}, which d \end{tzcode} A label can be suppressed by the empty braces |{}|. -You can shift the coordinate by specifying |<shift coor>| immediately before the first coordinate. +You can move the coordinates by specifying |<shift coor>| immediately before the first coordinate. The empty option |<>| is not allowed. \begin{tzcode}{.3} % \tzcoorsquick: shift, color @@ -1075,16 +1101,14 @@ The starred version \icmd{\tzcoorsquick*} prints node dots on the coordinates an % \tzcoorsquick* \begin{tikzpicture} \tzhelplines(4,3) -\tzcoorsquick*(0,0)(A) - (1,1)(Ben) - (2,1)(Cate) - (3,2)(Daniel); +\tzcoorsquick*(0,0)(A) (1,1)(Ben) + (2,1)(Cate) (3,2)(Daniel); \end{tikzpicture} \end{tzcode} A label can be suppressed by the empty braces |{}|. You can change the dot size using the \threeways\ (on page \pageref{ss:threeways}). -You can shift the coordinate by specifying |<shift coor>| immediately before the first coordinate. +You can shift the coordinate by specifying |<shift coor>| immediately before the first coordinate. The empty shift option |<>| is not allowed. \begin{tzcode}{.3} % \tzcoorsquick*: size, color, shift @@ -1094,7 +1118,7 @@ You can shift the coordinate by specifying |<shift coor>| immediately before the (0,0)(A) (1,1)(Ben) (2,1)(Cate){} (3,2)(Daniel); \tikzset{every label/.style={blue}} \tzcoorsquick*[blue]<0,1> - (0,0)(A) (1,1)(Ben) (2,1)(Cate){} (3,2)(Daniel); (6pt) + (0,0)(A) (1,1)(Ben) (2,1)(Cate){} (3,2)(Daniel);(6pt) \end{tikzpicture} \end{tzcode} @@ -1117,7 +1141,7 @@ You can also control each labels using |[<label opt>]| for each coordinate. \section{\protect\cmd{\tzgetxyval}} \label{s:tzgetxyval} -\icmd{\tzgetxyval} extracts the values of x-coordinate and the y-coordinate \xem{in the unit of centimeter} from a coordinate and saves the values in the user-defined macros, so that you can use them later. +\icmd{\tzgetxyval} extracts the values of x-coordinate and the y-coordinate \xem{in the unit of centimeter} from a specified coordinate and saves the values in the user-defined macros, so that you can use them later. For example, |\tzgetxyval(3,2){\xval}{\yval}| results in |\xval=3| and |\yval=2|. \begin{tzdef}{} @@ -1153,7 +1177,7 @@ For example, |\tzgetxyval(3,2){\xval}{\yval}| results in |\xval=3| and |\yval=2| \label{s:tzplot} \icmd{\tzplot} takes an arbitrary number of coordinates as arguments. -Each |(<coor>)| can be followed by the optional arguments |{<label>}| and |[<angle>]| to label the coordinate. This is a \xem{semicolon version} and the whole repeating pattern is the triple |(<coor>){<label>}[<angle>]|. It is required to type a semicolon |;| to indicate when the coordinate iteration ends. +Each |(<coor>)| can be followed by the optional arguments |{<label>}| and |[<angle>]| to label the coordinate. This is a \xem{semicolon version} and the whole repeating pattern is the triple |(<coor>){<label>}[<angle>]|. It is required to type a semicolon `|;|' to indicate when the coordinate iteration ends. The macro |\tzplot| draws connected line segments that link specified coordinates. @@ -1164,9 +1188,9 @@ The macro |\tzplot| draws connected line segments that link specified coordinate \tzplot(<coor>){<label>}[<angle>]..repeated..(<coor>){<label>}[<angle>] ; % syntax:full \tzplot[<opt>]{<tension>} [<plot opt>]<shift coor>"<path name>" - (<coor>){<label>}[<[label opt]angle>] - ..repeated.. - (){}[] ; (<mark size>) <code.append> + (<coor>){<label>}[<[label opt]angle>] + ..repeated.. + (){}[] ; (<mark size>) <code.append> % defaults [tzmark=2pt]{0}[smooth] <>"" (<m>){}[] ..repeated.. (){}[] ; (2pt) <> \end{tzdef} @@ -1186,7 +1210,7 @@ The style \ixxw{tzmark} is defined as follows: The value of |\tzmarksize| can be changed by the macro \icmd{\settzmarksize}, like |\settzmarksize{3pt}|. -The starred version |\tzplot*| draw connected line segments and print dot marks at specified coordinates. +The starred version |\tzplot*| prints dot marks at specified coordinates, without drawing line segments connecting the coordinates, by default. @@ -1194,7 +1218,7 @@ The starred version |\tzplot*| draw connected line segments and print dot marks \section{\protect\cmd{\tzplot*}: Dots and marks} \label{s:tzplot-dots} -|\tzplot*| prints \Tikz\ marks (|*| by default) at specified coordinates. +The starred version |\tzplot*| prints \Tikz\ marks (|*| by default) at specified coordinates. You can change the mark color and mark style using the first bracket optional argument. \begin{tztikz}{} @@ -1213,7 +1237,7 @@ You can change the mark color and mark style using the first bracket optional ar \end{tikzpicture} \end{tzcode} -\paragraph{Labels, marks, and marks size} +\paragraph{Labels, marks, and mark size} You can also add labels to specified coordinates with the optional arguments |{<label>}| and |[<angle>]| immediately after each |(<coor>)|. \begin{tztikz}{} @@ -1227,7 +1251,7 @@ There are three ways to change the mark size. \begin{enumerate} \item The simplest way is to use the parenthesis optional argument |(<mark size>)|, \xem{immediately after the semicolon}. -\item You can use the style |\tzmark|, like |\tzmark=3pt|. +\item You can use the style |tzmark|, like |tzmark=3pt|. \item You can also use the macro |\settzmarksize|, which is effective until the end of |tikzpicture| environment. \end{enumerate} @@ -1242,7 +1266,7 @@ There are three ways to change the mark size. \end{tikzpicture} \end{tzcode} -With |\tzplot*|, you can draw line segments by giving the |draw| option in the first bracket optional argument, like |\tzplot*[draw]|. +With |\tzplot*|, you can draw line segments by giving the \Tikz's option |draw| in the first bracket optional argument, like |\tzplot*[draw]|. \begin{tzcode}{.3} % \tzplot*: line, more marks, size @@ -1270,6 +1294,7 @@ With |\tzplot*|, you can draw line segments by giving the |draw| option in the f \paragraph{Shift} You can move specified coordinates using the option |<shift coor>| before the first coordinate (to be precise, immediately before the option |"<path name>"| if it exists). +The empty shift option |<>| is not allowed. \begin{tzcode}{.3} % \tzplot*: shift @@ -1288,18 +1313,15 @@ You can move specified coordinates using the option |<shift coor>| before the fi \label{s:tzplot-lines} |\tzplot| draws connected line segments connecting specified coordinates. +(By default, |tension=0|.) \begin{tztikz}{} \tzplot(0,0)(1,2)(2,2)(3,3); % works like: \draw [tension=0] plot [smooth] coordinates { (0,0)(1,1)(2,2)(3,3) } ; \end{tztikz} -\begin{tztikz}{} -\tzplot[blue,smooth cycle]{1}(0,0)(1,2)(2,2)(3,3); % works like: - \draw [blue,tension=1] plot [smooth cycle] coordinates { (0,0)(1,1)(2,2)(3,3) } ; -\end{tztikz} -\paragraph{Options: draw, mark, plot} +\paragraph{Options: draw, mark, mark options, etc.} You can use the optional argument |[<opt>]| to change the style of lines and marks. \begin{tzcode}{.3} @@ -1344,6 +1366,7 @@ To close the path of |\tzplot| you can use the option |smooth cycle| in the firs \end{tzcode} \paragraph{Shift} You can also move the line segments by specifying the option |<shift coor>| before the first coordinate (to be precise, immediately before the option |"<path name>"| if it exists). +The empty shift option |<>| is not allowed. \begin{tzcode}{.3} % \tzplot: shift @@ -1357,7 +1380,7 @@ To close the path of |\tzplot| you can use the option |smooth cycle| in the firs \paragraph{\texttt{name path} for intersections} -To find the intersection point of two lines, you may want to name the paths first, like |[name path=<path name>]| in \Tikz. With |\tzplot|, you can do it by specifying the quotation optional argument |"<path name>"| immediately before the first coordinate. +To find the intersection points of two lines, you may want to name the paths first, like |[name path=<path name>]| in \Tikz. With |\tzplot|, you can do it by specifying the quote optional argument |"<path name>"| immediately before the first coordinate. \begin{tzcode}{.3} % \tzplot: "path name" @@ -1391,8 +1414,13 @@ In order to \xem{extend a path}, formed by |\tzplot|, \xem{from the last coordin \section{\protect\cmd{\tzplot}: Curves} \label{s:tzplot:curves} +With |\tzplot|, the default value of |tension| is |0|. You can draw a curve with |\tzplot|, by specifying the optional argument |{<tension>}| before the coordinates or between the first and second bracket options (if they exist). -The default value of |tension| is |0|. + +\begin{tztikz}{} +\tzplot[blue,smooth cycle]{1}(0,0)(1,2)(2,2)(3,3); % works like: + \draw [blue,tension=1] plot [smooth cycle] coordinates { (0,0)(1,1)(2,2)(3,3) } ; +\end{tztikz} \begin{tzcode}{.3} \begin{tikzpicture}[scale=.8] @@ -1468,7 +1496,7 @@ Do not use |<shift coor>| for plotting bars or combs to avoid getting unexpected %\end{tzcode} \item -It can be a mess when using |shift={(coor)}| with the type of mixed coordinates: native and named coordinates. +It can be a mess when using the \Tikz\ option |shift={(coor)}| with the type of mixed coordinates: native and named coordinates. %\begin{tzcode}{.3} %% \tzplot(*) @@ -1522,10 +1550,10 @@ Basically, this is equivalent to |\tzpolot*[draw,tension=1]|. Since |\tzplotcurve| is a \xem{semicolon version}, you need to enter a semicolon to indicate when the coordinate iteration ends. In repeating coordinates, each mandatory coordinate can have a label. So the whole repeating pattern is the triple |(<coor>){<text>}[<pos>]|. -For example, |(A){here}[above]| is something like, in |tikz|, -|(A) node [above] {here}|. +For example, |(A){here}[above]| represents |(A) node [above] {here}| in \Tikz. -\paragraph{Options: lines, labels, colors, smooth cycle} Use the first bracket option. +\paragraph{Options: lines, labels, colors, smooth cycle} +Use the first bracket option to control the colors of lines or labels. \begin{tztikz}{} \tzplotcurve(0,0)(1,2)(2,2){A}[below](3,3){B}[right]; % works like: @@ -1547,21 +1575,23 @@ You can change the color of all labels together by adding |[text=<color>]| to th \end{tzcode} The simplest way to change the mark size is to specify |(<mark size>)| immediately after the semicolon |;|. +To close the path of |\tzplotcurve|, you can use the \Tikz\ option |smooth cycle| in the first bracket option or in the second bracket option. \begin{tzcode}{.3} % \tzplotcurve(*): smooth cycle, mark size \begin{tikzpicture} \tzhelplines(4,3) -\tzplotcurve*[red,text=blue,smooth cycle] +\tzplotcurve*[red,text=blue][smooth cycle] (0,0)(1,2){B}(2,2)(3,3)(4,1){E}[0];(3pt) %% \tzplotcurve*[smooth cycle](1,.5)(2,3)(3,2)(2,1)(3,1); \end{tikzpicture} \end{tzcode} \paragraph{Tension} -You can change the value tension (|1| by default) by specifying the options |{<tension>}| before the coordinates or between the two bracket options if they exist. +You can change the value of |tension| (|tension=1| by default) by specifying the option |{<tension>}| before the coordinates or between the two bracket options if they exist. \begin{tzcode}{.3} +% \tzplotcurve: tension \begin{tikzpicture} \tzhelplines(4,3) \tzcoor(.5,.5)(A) @@ -1574,6 +1604,7 @@ You can change the value tension (|1| by default) by specifying the options |{<t \paragraph{Shift} Use the optional argument |<shift coor>| before the first coordinate (to be precise, immediately before |"<path name>"|, if exists). +The empty shift option |<>| is not allowed. \begin{tzcode}{.3} % \tzplotcurve(*): shift @@ -1581,12 +1612,13 @@ You can change the value tension (|1| by default) by specifying the options |{<t \tzhelplines(4,3) \tzplotcurve*[red,text=blue,smooth cycle] <0,1>(0,0)(1,2){B}(2,2)(3,3)(4,1){E}[0];(3pt) %% -\tzplotcurve*[smooth cycle](1,.5)(2,3)(3,2)(2,1)(3,1); +\tzplotcurve*[smooth cycle] + (1,.5)(2,3)(3,2)(2,1)(3,1); \end{tikzpicture} \end{tzcode} -\paragraph{Extending the path} In order to extend the path of |\tzplotcurve| from the last coordinate, you can write \Tikz\ code in the very last optional argument |<code.append>|, after the semicolon. +\paragraph{Extending the path} In order to extend the path created by |\tzplotcurve(*)| from the last coordinate, you can directly write \Tikz\ code in the very last optional argument |<code.append>|, after the semicolon. \begin{tzcode}{.3} % \tzplotcurve(*): <code.append> @@ -1595,20 +1627,22 @@ You can change the value tension (|1| by default) by specifying the options |{<t \tzplotcurve*[red,text=blue,thick] (0,0)(1,2){B}(2,2)(3,3)(4,1){E}[-45];(3pt) < arc (-90:90:1cm) node [above] {up} > %% -\tzplotcurve[dashed](1,.5)(2,3)(3,2)(2,1)(3,1); +\tzplotcurve[dashed] + (1,.5)(2,3)(3,2)(2,1)(3,1); < -- ++(-1,-1) node [below] {down} > %% \end{tikzpicture} \end{tzcode} -You can also use |<--cycle>| to close the path with a straight line from the last coordinate to the first coordinate. +You can also use |<--cycle>| to \xem{close} the path \xem{with a straight line} from the last coordinate to the first coordinate. \begin{tzcode}{.3} % \tzplotcurve(*): <--cycle> \begin{tikzpicture} \tzhelplines(4,3) \tzplotcurve*[red,text=blue] - (0,0)(1,2)(2,2)(3,3)(4,1){A}[right];(3pt)<--cycle> -\tzplotcurve(1,.5)(2,3)(3,2)(2,1)(3,1);<--cycle> + (0,0)(1,2)(2,2)(3,3)(4,1){A}[right] ; (3pt)<--cycle> +\tzplotcurve + (1,.5)(2,3)(3,2)(2,1)(3,1) ; <--cycle> \end{tikzpicture} \end{tzcode} @@ -1619,8 +1653,10 @@ You can name the path of |\tzplotcurve| by specifying the option |"<path name>"| % \tzplotcurve(*): name path \begin{tikzpicture} \tzhelplines(4,3) -\tzplotcurve[blue]"IC"(.5,3)(1.5,1.2)(4,.5){$u$}[0]; -\tzplot[draw=red]"bgt"(0,3)(4,0){budget}[-90]; +\tzplotcurve[blue] + "IC"(.5,3)(1.5,1.2)(4,.5){$u$}[0]; +\tzplot[draw=red] + "bgt"(0,3)(4,0){budget}[-90]; % intersection points \tzXpoint{IC}{bgt}(K) \tzdots*(K){$A_1$}[30](K-2){$A_2$}; @@ -1628,9 +1664,6 @@ You can name the path of |\tzplotcurve| by specifying the option |"<path name>"| \end{tzcode} - - - %%================================== \chapter{Nodes} \label{c:nodes} @@ -1640,9 +1673,9 @@ You can name the path of |\tzplotcurve| by specifying the option |"<path name>"| \label{s:tznode} The macro \icmd{\tznode} allows you to put text at specified coordinates. -You can also optionally name a node so you can refer to the coordinate name later. +You can also optionally name a node so you can refer to the \iisw{node coordinate} later. -The starred version \icmd{\tznode*} is equivalent to |\tznode[draw]|, which draws the perimeter of the specified node. The default node shape is |rectangle|. +The starred version \icmd{\tznode*} is equivalent to |\tznode[draw]|, which draws the perimeter of the specified node. The default node shape is a |rectangle|. \begin{tzdef}{} % syntax: minimal @@ -1665,7 +1698,7 @@ The starred version \icmd{\tznode*} is equivalent to |\tznode[draw]|, which draw \node [draw] (A) at (0,0) [above right] {text}; \end{tztikz} -|\tznode*| prints the perimeter of a node, which is |rectangular| by default. +|\tznode*| prints the perimeter of a node, which is a |rectangular| by default. \begin{tzdef}{} % syntax: minimal @@ -1681,7 +1714,7 @@ The starred version \icmd{\tznode*} is equivalent to |\tznode[draw]|, which draw \node [draw] (A) at (0,0) [above right] {text}; \end{tztikz} -\paragraph{Putting text} You can use \Tikz\ options in the optional arguments |[<opt>]| or |[<node opt>]| to put text with different colors, fonts, and so on. +\paragraph{Putting text} You can use \Tikz\ options in the first bracket optional argument |[<opt>]| or the second bracket option |[<node opt>]| to put text with different colors, fonts, and so on. \begin{tzcode}{.3} % \tznode(*) @@ -1695,7 +1728,7 @@ The starred version \icmd{\tznode*} is equivalent to |\tznode[draw]|, which draw \end{tikzpicture} \end{tzcode} -\paragraph{Abbreviations} You can use \xem{abbreviations} such as |a| for |above|, |l| for |left|, |ar| for |above right|, |bl| for |below left|, and so on to indicate where the \xem{text} of a \xem{main node} is placed. +\paragraph{Abbreviations} You can use \xem{abbreviations} such as |a| for |above|, |l| for |left|, |ar| for |above right|, |bl| for |below left|, and so on to indicate where the \xem{text} of a \xem{main node} is placed. (See also Section \ref{s:stylenames} on page \pageref{s:stylenames}.) \begin{quote} \warning @@ -1711,6 +1744,7 @@ Note that, on the other hand, you CANNOT use the |<angle>| option to place a \xe \begin{tzcode}{.3} +% \tznode(*): main node, label node \begin{tikzpicture} \tzhelplines(4,3) \tzdot*(1,1) @@ -1728,6 +1762,7 @@ Note that, on the other hand, you CANNOT use the |<angle>| option to place a \xe You can name a node at a specified coordinate |(<coor>)| by specifying |(<name>)| immediately after the coordinate. You can use the node name as a \iisw{node coordinate}. \begin{tzcode}{.3} +% \tznode(*): name nodes \begin{tikzpicture} \tzhelplines(4,3) \tznode*(1,1)(A){A} @@ -1740,9 +1775,10 @@ You can name a node at a specified coordinate |(<coor>)| by specifying |(<name>) \paragraph{Shift} You can move the coordinates by specifying the option |<shift coor>| immediately before the coordinate |(<coor>)|. +The empty shift option |<>| is not allowed. \begin{tzcode}{.3} -% shift +% \tznode(*): shift \begin{tikzpicture} \tzhelplines(4,3) \tznode*<-1,0>(1,1)(A){A} @@ -1759,7 +1795,7 @@ You can move the coordinates by specifying the option |<shift coor>| immediately \label{s:tznodedot} \icmd{\tznodedot} names a node and prints a circle node dot. -|\tznodedot| is the same as |\tzdot|, except for one thing. +|\tznodedot| is basically the same as |\tzdot|, except for one thing. |\tznodedot| names a node. The starred version \icmd{\tznodedot*} prints a filled circle node dot (of the size |2.4pt|, by default), just like |\tzdot*|. But it optionally names a node. @@ -1768,13 +1804,13 @@ The starred version \icmd{\tznodedot*} prints a filled circle node dot (of the s % syntax: medium \tznodedot(<coor>)(<node name>){<label>}[<angle>] % syntax: full -\tznodedot*[<opt>]<shift coor>(<coor>)(<node name>){<label>}[<[label opt]angle>] - (<dot size>) +\tznodedot*[<opt>]<shift coor> + (<coor>)(<node name>){<label>}[<[label opt]angle>] (<dot size>) % defaults *[]<>(<m>)(){}[](2.4pt) \end{tzdef} -Since |\tznodedot(*)| prints a dot, its |<label>| is placed by |<angle>|. +Since |\tznodedot(*)| prints a node dot, its |<label>| is placed by |<angle>|. \begin{tzcode}{.3} % \tznodedot(*): label, color @@ -1806,6 +1842,7 @@ The simplest way is to use the last parenthesis option |(<dot size>)|. You can move the coordinates of dots by specifying the |<shift coor>| option immediately before the coordinate. +The empty shift option |<>| is not allowed. \begin{tzcode}{.3} % \tznodedot(*): shift @@ -1838,22 +1875,6 @@ You can move the coordinates of dots by specifying the |<shift coor>| option imm []<>(<m>)(){}[text=black] \end{tzdef} -The starred version |\tznodeframe*| fills the rectangle with color (|black!50| by default) with |fill opacity=.3| by default. - -%\icmd{\tznoderectangle*} and \icmd{\tznodebox*} are aliases of |\tznodeframe*|. - -\begin{tzdef}{} -% syntax: -\tznodeframe*[<opt>]<shift coor> - (<coor>)(<node name>){<text>}[<node opt>]{<fill opacity>} -% defaults - *[fill=black!50,fill opacity=.3]<>(<m>)(){}[draw=black,text=black]{.3} -\end{tzdef} - -\remark -|\tznodeframe| works very similar to |\tznode|, but the starred versions are different. -While |\tznode*| draws the perimeter of a node, |\tznodeframe*| fills a node with color. - \begin{tzcode}{.3} % \tznodeframe @@ -1880,7 +1901,22 @@ While |\tznode*| draws the perimeter of a node, |\tznodeframe*| fills a node wit \end{tikzpicture} \end{tzcode} -By default, |\tznodeframe*| fills a node with color with |opacity=.3|. +The starred version |\tznodeframe*| fills the rectangle with color (|black!50| by default) with |fill opacity=.3| but with |text opacity=1|, by default. + +%\icmd{\tznoderectangle*} and \icmd{\tznodebox*} are aliases of |\tznodeframe*|. + +\begin{tzdef}{} +% syntax: +\tznodeframe*[<opt>]<shift coor> + (<coor>)(<node name>){<text>}[<node opt>]{<fill opacity>} +% defaults + *[fill=black!50,fill opacity=.3,text opacity=1] <> + (<m>)(){}[draw=black,text=black]{.3} +\end{tzdef} + +\remark +|\tznodeframe| works very similar to |\tznode|, but their `starred versions' work differently. +While |\tznode*| draws the perimeter of a node, |\tznodeframe*| fills a node with color. \begin{tzcode}{.3} % \tznodeframe*: opacity=.3 (by default) @@ -1890,20 +1926,21 @@ By default, |\tznodeframe*| fills a node with color with |opacity=.3|. \tznodeframe(4,2)(B)[circle] \tzline[blue,thick](A)(B) \tznodeframe*[green,scale=1.5](2,1){Node frame} - [label=180:Left, pin=-45:pin] + [label=180:Left, pin=-45:pin] \end{tikzpicture} \end{tzcode} You can change the |fill opacity| of |\tznodeframe*| by specifying the last curly brace option |{<fill opacity>}|. You can also move the node by specifying the |<shift coor>| option immediately before the coordinate. +(The empty shift coor |<>| is not allowed.) \begin{tzcode}{.3} -% opacity, shift +% \tznodeframe(*): opacity, shift \begin{tikzpicture} \tzhelplines[solid](4,3) \tznodebox(0,0) \tznodeframe*(1,2)(A){A}{.1} % opacity -\tznoderectangle[fill=yellow](2,2)(B){B} -\tznodebox*[red](3,2)(C){Cat} +\tznodeframe[fill=yellow](2,2)(B){B} +\tznodeframe*[red](3,2)(C){Cat} \tznodeframe[fill=green]<-1,-2>(4,2)(D){Dog} % shift \tzto[->,bend left=45](A.north)(C.90) \tzto[->,bend right=45,dashed](B.-135)(D.west) @@ -1915,8 +1952,8 @@ In addition to using the option |{<fill opacity>}|, you can use a macro to chang \begin{itemize} \item The default fill opacity can be changed by the macro \icmd{\settzfillopacity}. \item -The default fill color is |black!50|. You can change the default color -with the macro \icmd{\settzfillcolor}. +The default fill color is |black!50|. You can use the macro \icmd{\settzfillcolor} to change the default fill color. +\item With |\tznodeframe|, you can change the color of the perimeter and text with the second bracket option |[<node opt>]|. \end{itemize} @@ -1924,23 +1961,24 @@ with the macro \icmd{\settzfillcolor}. \section{\protect\cmd{\tznodecircle} and \protect\cmd{\tznodecircle*}} \label{s:tznodecircle} -\icmd{\tznodecircle} works just like |\tznodeframe| but with a node circle. +\icmd{\tznodecircle} works just like |\tznodeframe| but with a circle node. \begin{tzdef}{} -% syntax: +% syntax \tznodecircle[<opt>]<shift coor>(<coor>)(<node name>){<text>}[<node opt>] % defaults - []<>(<m>)(){}[text=black] + [circle]<>(<m>)(){}[text=black] \end{tzdef} -\icmd{\tznodecircle*} works just like |\tznodeframe*| but with a node circle. +\icmd{\tznodecircle*} works just like |\tznodeframe*| but with a circle node. \begin{tzdef}{} -% syntax: +% syntax \tznodecircle*[<opt>]<shift coor> (<coor>)(<node name>){<text>}[<node opt>]{<fill opacity>} % defaults - *[fill=black!50,fill opacity=.3]<>(<m>)(){}[draw=black,text=black]{.3} + *[circle,fill=black!50,fill opacity=.3,text opacity=1] <> + (<m>)(){}[draw=black,text=black]{.3} \end{tzdef} \begin{tzcode}{.3} @@ -1956,6 +1994,7 @@ with the macro \icmd{\settzfillcolor}. \end{tzcode} You can change the |fill opacity| of |\tznodecircle*| by specifying the last curly brace option |{<fill opacity>}| or using |\settzfillopacity|. You can also move the node by specifying the |<shift coor>| option immediately before the coordinate. +(The empty shift coor |<>| is not allowed.) \begin{tzcode}{.3} % opacity, shift @@ -1977,23 +2016,24 @@ You can change the |fill opacity| of |\tznodecircle*| by specifying the last cur \section{\protect\cmd{\tznodeellipse} and \protect\cmd{\tznodeellipse*}} \label{s:tznodeellipse} -\icmd{\tznodeellipse} works just like |\tznodeframe| but with a node circle. +\icmd{\tznodeellipse} works just like |\tznodeframe| but with an ellipse node. \begin{tzdef}{} % syntax: \tznodeellipse[<opt>]<shift coor>(<coor>)(<node name>){<text>}[<node opt>] % defaults - []<>(<m>)(){}[text=black] + [ellipse]<>(<m>)(){}[text=black] \end{tzdef} -\icmd{\tznodeellipse*} works just like |\tznodeframe*| but with a node circle. +The starred version \icmd{\tznodeellipse*} works just like |\tznodeframe*| but with an ellipse node. \begin{tzdef}{} % syntax: \tznodeellipse*[<opt>]<shift coor> - (<coor>)(<node name>){<text>}[<node opt>]{<fill opacity>} + (<coor>)(<node name>){<text>}[<node opt>]{<fill opacity>} % defaults - *[fill=black!50,fill opacity=.3]<>(<m>)(){}[draw=black,text=black]{.3} + *[ellipse,fill=black!50,fill opacity=.3,text opacity=1] <> + (<m>)(){}[draw=black,text=black]{.3} \end{tzdef} \begin{tzcode}{.3} @@ -2010,6 +2050,7 @@ You can change the |fill opacity| of |\tznodecircle*| by specifying the last cur \end{tzcode} You can change the |fill opacity| of |\tznodeellipse*| by specifying the last curly brace option |{<fill opacity>}|. You can also move the node by specifying the |<shift coor>| option immediately before the coordinate. +(The empty shift coor |<>| is not allowed.) \begin{tzcode}{.3} % opacity, shift @@ -2052,8 +2093,8 @@ You can change the |fill opacity| of |\tznodeellipse*| by specifying the last cu \begin{tztikz}{} -\tzline(0,0)(2,1) % works like: - \draw (1,1) -- (2,1); +\tzline(0,1)(2,1) % works like: + \draw (0,1) -- (2,1); \end{tztikz} @@ -2063,8 +2104,8 @@ You can change the |fill opacity| of |\tznodeellipse*| by specifying the last cu You can use the first optional argument |[<opt>]| to control the line styles. \begin{tztikz}{} -\tzline[blue](0,0)(2,1) % works like: - \draw [blue] (1,1) -- (2,1); +\tzline[blue](0,1)(2,1) % works like: + \draw [blue] (0,1) -- (2,1); \end{tztikz} \begin{tzcode}{.3} @@ -2081,14 +2122,14 @@ You can use the first optional argument |[<opt>]| to control the line styles. \subsection{Adding text} \label{ss:tzline:addingtext} -You can add text by specifying the optional arguments |{<text>}| and |[node opt]|. +You can add text by specifying the optional arguments |{<text>}| and |[<node opt>]|. \paragraph{Text next to the line} -With the options |{<text1>}[<node opt1>]| inbetween two coordinates, you can add text next to the line, with the option |[above,midway]| by default. +With the options |{<text1>}[<node opt1>]| \xem{in-between} two coordinates, you can add text next to the line, with the option |[above,midway]| by default. \begin{tztikz}{} -\tzline[blue](0,0){my line}[sloped](2,1) % works like: - \draw [blue] (1,1) -- node [above,sloped] {my line} (2,1) ; +\tzline[blue](0,1){my line}[sloped](2,1) % works like: + \draw [blue] (0,1) -- node [above,sloped] {my line} (2,1) ; \end{tztikz} \begin{tzcode}{.3} @@ -2101,16 +2142,16 @@ With the options |{<text1>}[<node opt1>]| inbetween two coordinates, you can add \end{tikzpicture} \end{tzcode} -You can use the \xem{abbreviations} of \Tikz\ basic placement options such as |a| for |above|, |bl| for |below left|, and so on. +You can use the \xem{abbreviations} of \Tikz\ basic placement options such as |a| for |above|, |bl| for |below left|, and so on. (For more details, see page \pageref{abbreviations}.) \paragraph{Text at or around the last coordinate} -You can also add text at or around the second coordinate by specifying |{<text2>}| and |[<node opt2>]| immediately after the second coordinate. +You can also add text at (by default) or around the second coordinate by specifying |{<text2>}| and |[<node opt2>]| immediately \xem{after} the second coordinate. \begin{tztikz}{} -\tzline[blue](0,0)(2,1){my line}[right] % works like: - \draw [blue] (1,1) -- (2,1) node [right] {my line}; +\tzline[blue](0,1)(2,1){my line}[right] % works like: + \draw [blue] (0,1) -- (2,1) node [right] {my line}; \end{tztikz} @@ -2157,7 +2198,8 @@ You can also add text at or around the second coordinate by specifying |{<text2> \subsection{Moving the line: \texttt{shift}} \label{ss:tzline:shift} -You can move the line drawn by |\tzline| by specifying the option |<shift coor>| before the first coordinate (to be precise, immediately before the option |"<path name>"|, which is put immediately before the first coordinate, if it exists). +You can move the line generated by |\tzline| by specifying the option |<shift coor>| before the first coordinate (to be precise, immediately before the option |"<path name>"|, which is put immediately before the first coordinate, if it exists). +The empty shift coor |<>| is not allowed. \begin{tzcode}{.3} % \tzline: shift @@ -2176,7 +2218,7 @@ You can move the line drawn by |\tzline| by specifying the option |<shift coor>| \subsection{Extending the path} \label{ss:tzline:extendingpath} -You can extend the path generated by |\tzline| from the last coordinate, by writing \Tikz\ code in the last optional argument |<code.append>|. +You can extend the path of |\tzline| from the last coordinate, by writing \Tikz\ code in the last optional argument |<code.append>|. \begin{tzcode}{.3} % \tzline: shift @@ -2192,8 +2234,8 @@ You can extend the path generated by |\tzline| from the last coordinate, by writ \subsection{Naming the path: Intersection points} \label{ss:tzline:namepath} -When you specify the option |"<path name>"| immediately before the first coordinate, it works like |[name path=<path name>]| in the option list |[<opt>]|. -You can use this name to find intersection points. +When you specify the option |"<path name>"| immediately before the first coordinate, it works like |[name path=<path name>]| in the option list of |[<opt>]|. +You can use this name of path to find intersection points. \begin{tzcode}{.3} % \tzline+: name path @@ -2227,14 +2269,14 @@ The \iisw{plus version} \icmd{\tzline+} takes the second coordinate |(<coor2>)| \begin{tztikz}{} -\tzline+(0,0)(2,1) % works like: - \draw (1,1) -- ++ (2,1); +\tzline+(0,1)(2,1) % works like: + \draw (0,1) -- ++ (2,1); \end{tztikz} \begin{tztikz}{} -\tzline+[dashed]"AA"(1,1){A}[red](2,1){B}[right,blue] % works like: +\tzline+[dashed]"AA"(0,1){A}[red](2,1){B}[right,blue] % works like: \draw [dashed,name path=AA] - (1,1) -- node [red] {A} ++ (2,1) node [right,blue] {B}; + (0,1) -- node [red] {A} ++ (2,1) node [right,blue] {B}; \end{tztikz} @@ -2265,7 +2307,7 @@ The \iisw{plus version} \icmd{\tzline+} takes the second coordinate |(<coor2>)| \section{Styles: \texttt{tzshorten} and \texttt{tzextend}} \label{s:tzshorten} -The style \ixxw{tzshorten} and \ixxw{tzextend} are defined as follows. +The styles \ixxw{tzshorten} and \ixxw{tzextend} are defined as follows. \begin{tzsty}{} % tzshorten @@ -2281,8 +2323,7 @@ The style \ixxw{tzshorten} and \ixxw{tzextend} are defined as follows. } \end{tzsty} -For example, |[tzshorten={2mm}{1mm}]| is equivalent to |[shorten <=2mm,shorten >=1mm]| in \ -Tikz. Simple |[tzshorten]| means that |[tzshorten={2pt}{2pt}]| by default. +For example, |[tzshorten={2mm}{1mm}]| is equivalent to |[shorten <=2mm,shorten >=1mm]| in \Tikz. Simple |[tzshorten]| means that |[tzshorten={2pt}{2pt}]| by default. The style |tzextend| is a negative |tzshorten|. For example, |tzextend{2mm}{1mm}| is equivalent to |tzshorten{-2mm}{-1mm}|. @@ -2293,9 +2334,9 @@ The style |tzextend| is a negative |tzshorten|. For example, |tzextend{2mm}{1mm} \tzhelplines(4,3) \tzdots(0,0)(3,0); \tzline(0,0)(3,0) \tzdots(0,1)(3,1); -\tzline[->,thick,blue,tzshorten={2mm}{1mm}](0,1)(3,1); +\tzline[->,thick,blue,tzshorten={2mm}{1mm}](0,1)(3,1) \tzdots(1,2)(3,2); -\tzline[<->,thick,red,tzextend={1cm}{1cm}](1,2)(3,2); +\tzline[<->,thick,red,tzextend={1cm}{1cm}](1,2)(3,2) \end{tikzpicture} \end{tzcode} @@ -2305,7 +2346,7 @@ The style |tzextend| is a negative |tzshorten|. For example, |tzextend{2mm}{1mm} \label{s:tzlines} \icmd{\tzlines} connects two or more points with connected line segments. -Since |\tzlines| takes an arbitrary number of coordinates as arguments, it is a \xem{semicolon version}. So, you need to enter a semicolon to indicate when the coordinate iteration ends. +Since |\tzlines| takes an arbitrary number of coordinates as arguments, it is a \xem{semicolon version}. So, you need to enter a semicolon `|;|' to indicate when the coordinate iteration ends. \begin{tzdef}{} % syntax: minimum @@ -2320,20 +2361,25 @@ Since |\tzlines| takes an arbitrary number of coordinates as arguments, it is a []<>"" (<m>){}[] ..repeated.. (){}[] ; <> \end{tzdef} -The whole repeating pattern in |\tzlines| is the triple |(<coor>){<text>}[<node opt>]|. -%Any |<+ or ++>| after the last coordinate, if any, is ignored. \begin{tztikz}{} -% standard version \tzlines(1,1)(2,2)(3,1)(4,3); % works like: \draw (1,1) -- (2,2) -- (3,1) -- (4,3); \end{tztikz} +The whole repeating pattern in |\tzlines| is the triple |(<coor>){<text>}[<node opt>]|. +%Any |<+ or ++>| after the last coordinate, if any, is ignored. + +\begin{tztikz}{} +\tzlines(1,1)(2,2)(3,1){C}(4,3){D}[r]; % works like: + \draw (1,1) -- (2,2) -- (3,1) -- node {C} (4,3) node [right] {D}; +\end{tztikz} + \paragraph{Line styles} Use the first optional argument |[<opt>]| to control the style of the connected line drawn by |\tzlines|. \begin{tzcode}{.3} -% \tzlines +% \tzlines: line style \begin{tikzpicture} \tzhelplines(4,3) \tzlines[blue,<->](0,1)(1,2)(3,1)(4,3); @@ -2379,7 +2425,8 @@ The options |{<text>}| and |[<node opt>]| after the last coordinate put |<text>| %\end{tzcode} \paragraph{Shift} -You can move the connected line by specifying |<shift coor>| before the first coordinate or before |"<path name>"| (if any). +You can move the connected line by specifying |<shift coor>| before the first coordinate or immediately before the option |"<path name>"| if it exists. +(The empty shift option |<>| is not allowed.) \begin{tzcode}{.3} % \tzlines: shift @@ -2416,7 +2463,7 @@ You can name the path of |\tzlines| by specifying the option |"<path name>"| imm You can extend the path of |\tzlines| by writing \Tikz\ code in the last (even \xem{after the semicolon}) optional argument |<code.append>|. \begin{tzcode}{.3} -% \tzlines +% \tzlines: <code.append> \begin{tikzpicture} \tzhelplines(4,3) \tzlines[red,thick,<->,text=blue] @@ -2431,7 +2478,7 @@ You can extend the path of |\tzlines| by writing \Tikz\ code in the last (even \ \end{tikzpicture} \end{tzcode} -You can close the path by |<--cycle>|. +You can close the path with a straight line by |<--cycle>|. \begin{tzcode}{.3} % \tzlines: closed path @@ -2470,16 +2517,17 @@ It is also required to enter a \xem{semicolon} to indicate when the coordinate i \begin{tztikz}{} -\tzlines+(1,1)(2,2)(3,1)(4,3); % works like: - \draw (1,1) -- ++(2,2) -- ++(3,1) -- ++(4,3); +\tzlines+(0,1)(1,1)(2,-1)(1,2); % works like: + \draw (0,1) -- ++(1,1) -- ++(2,-1) -- ++(1,2); \end{tztikz} \begin{tztikz}{} -\tzlines+[dashed]"AA"(1,1){A}(2,2){B}(3,1){C}[below]; % works like: +\tzlines+[dashed]"AA"(0,1){A}(1,1){B}(2,-1){C}(1,2){D}[right]; % works like: \draw [dashed,name path=AA] - (1,1) -- node {A} ++(2,2) - -- node {B} ++(3,1) node [below] {C} ; + (0,1) -- node {A} ++(1,1) + -- node {B} ++(2,-1) + -- node {C} ++(1,2) node [right] {D} ; \end{tztikz} @@ -2488,12 +2536,15 @@ It is also required to enter a \xem{semicolon} to indicate when the coordinate i \begin{tikzpicture} \tzhelplines(4,3) \tzlines+[red,thick,<->,text=blue] - (0,1){Up} - (1,1){Down}[a,sloped] - (2,-1){Up} - (1,2){line A} ; + (0,1){Up} + (1,1){Down}[a,sloped] + (2,-1){Up} + (1,2){line A} ; \tzlines+[dashed,auto,text=red] - (0,0){A}(1,1){B}(1,0){C}(1,-1){line B}[blue,draw,r] ; + (0,0){A} + (1,1){B} + (1,0){C} + (1,-1){line B}[blue,draw,r] ; \end{tikzpicture} \end{tzcode} @@ -2507,7 +2558,7 @@ It is also required to enter a \xem{semicolon} to indicate when the coordinate i \section{\protect\cmd{\tzto}: Two points} \label{s:tzto} -\icmd{\tzto} connects two points with a straight or curved line, using \Tikz\ |to| operation. +\icmd{\tzto} connects two points with a straight or curved line, using \Tikz's |to| operation. So |\tzto| is more general than |\tzline|, which connects points only with a straight line. \begin{tzdef}{} @@ -2517,28 +2568,19 @@ So |\tzto| is more general than |\tzline|, which connects points only with a str \tzto[<opt>](<coor>){<text>}[<node opt>](<coor>){<text>}[<node opt>] % syntax: full \tzto[<opt>]<shift coor>"<path name>" - (<coor>){<text>}[<node opt>](<coor>){<text>}[<node opt>]<code.append> + (<coor>){<text>}[<node opt>] + (<coor>){<text>}[<node opt>]<code.append> % defaults []<>""(<m>){}[above](<m>){}[]<> \end{tzdef} \begin{tztikz}{} -\tzto(1,1)(3,2) % works like: - \draw (1,1) to (3,2); +\tzto[dashed](1,1)(3,2) % works like: + \draw [dashed] (1,1) to (3,2); \end{tztikz} - -\begin{tztikz}{} -\tzto[->,bend right](1,1){A}[near start](3,2) % works like: - \draw [->,bend right] (1,1) to node [near start] {A} (3,2); - -\tzto[->,bend right](1,1){A}[near start](3,2){B}[right] % works like: - \draw [->,bend right] (1,1) to node [near start] {A} - (3,2) node [right] {B}; -\end{tztikz} - \paragraph{Line styles} You can control line styles with the first optional argument |[<opt>]|. @@ -2554,7 +2596,17 @@ You can control line styles with the first optional argument |[<opt>]|. \paragraph{Adding text} -You can add text \xem{next to the line} (|[midway,above]|, by default) by specifying the options |{<text>}| and |[<node opt>]| \xem{inbetween} the two coordinates. +You can add text \xem{next to the line} (|[midway,above]|, by default) by specifying the options |{<text>}| and |[<node opt>]| \xem{in-between} the two coordinates. + +\begin{tztikz}{} +\tzto[->,bend right](1,1){A}[near start](3,2) % works like: + \draw [->,bend right] (1,1) to node [near start] {A} (3,2); + +\tzto[->,bend right](1,1){A}[near start](3,2){B}[right] % works like: + \draw [->,bend right] (1,1) to node [near start] {A} + (3,2) node [right] {B}; +\end{tztikz} + You can also add text \xem{at or around} the last coordinate by the options |{<text>}| and |[<node opt>]| \xem{immediately after} the last coordinate. @@ -2569,7 +2621,8 @@ You can also add text \xem{at or around} the last coordinate by the options |{<t \end{tzcode} \paragraph{Shift} -You can move the line by specifying the option |<shift coor>| before the first coordinate or immediately before the option |"<path name>"| (if any). +You can move the line by specifying the option |<shift coor>| before the first coordinate or immediately before the option |"<path name>"| if it exists. +(The empty shift option |<>| is not allowed.) \begin{tzcode}{.3} % \tzto: shift @@ -2653,31 +2706,32 @@ The \iisw{plus version} \icmd{\tzto+} uses the second coordinate relative to the \section{\protect\cmd{\tztos}: Multiple points: Semicolon version} \label{s:tztos} -\icmd{\tztos} takes an arbitrary number of coordinates as arguments to connect them by \Tikz\ |to| operation. Since this is a \xem{semicolon version}, you need to enter a \xem{semicolon} to indicate when the coordinate iteration ends. -So the quadruple |(<coor>)[<to opt>]{<text>}[<node opt>]| is -the whole repeating pattern. -Here, |[<to opt>]| is for the options of |to| operation such as |[bend right]|, |[bend left=<angle>]|, |[out=<angle>,in=<angle>]|and so on. +\icmd{\tztos} takes an arbitrary number of coordinates as arguments to connect them by \Tikz's |to| operation. Since this is a \xem{semicolon version}, you need to enter a \xem{semicolon} to indicate when the coordinate iteration ends. \begin{tzdef}{} % syntax \tztos[<opt>]<shift coor>"<path name>" (<coor1>)[<to opt>]{<text>}[<node opt>]..repeated..()[]{}[] ; <code.append> % defaults - []<0,0>""(<m>)[]{}[]..repeated..()[]{}[]<> + []<>""(<m>)[]{}[]..repeated..()[]{}[]<> \end{tzdef} +The quadruple |(<coor>)[<to opt>]{<text>}[<node opt>]| is +the whole repeating pattern. +Here, |[<to opt>]| is for the options of \Tikz's |to| operation such as |[bend right]|, |[bend left]|, |[bend left=<angle>]|, |[out=<angle>,in=<angle>]| and so on. + \begin{tztikz}{} \tztos(0,0)(1,2)(3,1); % works like: \draw (0,0) to (1,2) to (3,1); \end{tztikz} \begin{tztikz}{} -\tztos[blue] (0,0)[bend right] (1,2)[out=-60] (3,1); % works like: - \draw [blue] (0,0) to [bend right] (1,2) to [out=-60,in=45] (3,1); +\tztos[blue] (0,0) [bend right] (1,2) [out=-60,in=45] (3,1); % works like: + \draw[blue] (0,0) to [bend right] (1,2) to [out=-60,in=45] (3,1); \end{tztikz} \paragraph{How to connect coordinates} -You can use \Tikz's |to| operation option to connect the coordinates with different types of curves. +You can use the options of \Tikz's |to| operation to connect the coordinates with different types of curves. \begin{tzcode}{.3} % \tztos @@ -2693,25 +2747,24 @@ You can use \Tikz's |to| operation option to connect the coordinates with differ \end{tzcode} \paragraph{Adding text} -You can add text next to lines or curves by specifying the options |{<text>}| and |[<node opt>]| inbetween coordinates or after the option |[<to opt>]|, if it exists. +You can add text next to lines or curves by specifying the options |{<text>}| and |[<node opt>]| \xem{in-between} coordinates or \xem{after} the option |[<to opt>]|, if it exists. You can also add text at or around the last coordinate by the last options |{<text>}| and |[<node opt>]|. -It has its |+| verison |\tztos+|. - \begin{tzcode}{.3} % \tztos: adding text \begin{tikzpicture} \tzhelplines(4,3) \tztos(0,1)[bend right]{A} - (1,2){Ben}[red,sloped,a] + (1,2) {Ben}[red,sloped,a] (3,1)[bend right]{Cate}[sloped,near end] - (4,3){Name}[draw,blue,a] ; + (4,3) {Name}[draw,blue,a] ; \end{tikzpicture} \end{tzcode} \paragraph{Shift} You can move the line or curve of |\tztos| -using the option |<shift coor>| before the first coordinate or immediately before |"<path name">|, if any. +using the option |<shift coor>| before the first coordinate or immediately before the option |"<path name">|, if any. +(The empty shift option |<>| is not allowed.) \begin{tzcode}{.3} % \tztos: shift @@ -2728,11 +2781,11 @@ using the option |<shift coor>| before the first coordinate or immediately befor -\paragraph{\texttt{name path}} +\paragraph{\texttt{name path} for intersections} You can name the path of |\tztos| by specifying |"<path name>"| immediately before the first mandatory coordinate. \begin{tzcode}{.3} -% \tztos: intersection points +% \tztos: name path, intersection points \begin{tikzpicture} \tzhelplines(4,3) \tztos[blue,<->]"AA"(0,1)(1,2)(3,1)(4,3); @@ -2748,7 +2801,7 @@ You can name the path of |\tztos| by specifying |"<path name>"| immediately befo \end{tzcode} -\paragraph{Extending the path} +\paragraph{Extending paths} You can extend the path of |\tztos| from the last coordinate, by writing \Tikz\ code in the last (after the semicolon) optional argument |<code.append>|. @@ -2789,46 +2842,39 @@ The \iisw{plus version} \icmd{\tztos+} takes each coordinate (except the first c %%================================== -\chapter{Filling area} +\chapter{Filling Area} \label{c:fillingarea} %%------------------------------------------------------------ -\section{\protect\cmd{\tzpath} and \protect\cmd{\tzpath*}: Semicolon versions} +\section{\protect\cmd{\tzpath}: Semicolon version} \label{s:tzpath} \icmd{\tzpath} creates a path connecting an arbitrary number of coordinates, but it does not stroke the path. You can visualize the path with |\tzpath[draw]|. -Since |\tzpath| is a \ixsw{semicolon version} macro, you need to enter a \xem{semicolon} |;| to indicate where the coordinate iteration ends. - - -The main purpose of |\tzpath| is to fill an enclosed area with color or pattern. -You can use |\tzpath[fill]| or |\tzpath[pattern=<...>]| to do it. +Since |\tzpath| is a \iisw{semicolon version} macro, you need to enter a \xem{semicolon} `|;|' to indicate where the coordinate iteration ends. -The starred version \icmd{\tzpath*} fills the interior of |\tzpath| with |black!50| with |fill opacity=.3|, by default. -|\tzpath*| is equivalent to |\tzpath[fill=black!50,fill opacity=.3]|. -You can change the defaults by \icmd{\settzfillcolor} and \icmd{\settzfillopacity}. -The effect remains valid until the end of the |tikzpicture| environment, unless changed again. \begin{tzdef}{} % syntax: minimal -\tzpath (<coor>)(<coor>)..repeated..(<coor>) ; -\tzpath*(<coor>)(<coor>)..repeated..(<coor>) ; {<fill opacity>} -% syntax -\tzpath*{<path style>}[<opt>]<shift coor>"<path name>" - (<coor>)[<path style>]{<text>}[<node opt>] - .. repeated .. ()[]{}[] ; {<fill opacity>}<code.append> +\tzpath (<coor>)(<coor>) ..repeated.. (<coor>) ; +% syntax: full +\tzpath{<path style>}[<opt>]<shift coor>"<path name>" + (<coor>)[<path style>]{<text>}[<node opt>] + ..repeated.. ()[]{}[] ; {<fill opacity>} <code.append> % defaults: \tzpath - {to}[]<>""(<m>)[]{}[]<>..repeated..()[]{}[]<>;{}<> -% defaults: \tzpath* - *{to}[fill=black!50,fill opacity=.3]<>""(<m>)[]{}[]<>..repeated..()[]{}[]<>;{.3}<> + {to}[]<>"" (<m>)[]{}[] ..repeated.. ()[]{}[] ; {}<> \end{tzdef} +The main purpose of |\tzpath| is to fill an enclosed area with color or pattern. +You can use |\tzpath[fill]| or |\tzpath[pattern=<...>]| to do it. + + \paragraph{Path construction operation} (If you are not an experienced user of \Tikz\, just skip this part.) |\tzpath| is similar to |\tztos|, but it is more flexible in constructing paths. -|\tzpath| allows you to choose how to construct a path using the |[<path style>]| option \xem{inbetween} coordinates. \xem{Path extension operation} can be selected from `|--|', `|to|', `\verb+|-+', `\verb+-|+', etc. -You can use the first brace option |{<path style>}| to change all the |<path style>| inbetween coordinates. The default path style is `|to|' and can be change by \icmd{\settzpathstyle}, like |\settzpathstyle{--}|. It remains valid until the end of |tikzpicture| environment unless changed again. +|\tzpath| allows you to choose how to construct a path using the |[<path style>]| option \xem{in-between} coordinates. \xem{Path extension operation} can be selected from `|--|', `|to|', `\verb+|-+', `\verb+-|+', etc. +You can use \xem{the first brace option} |{<path style>}| to change all the |<path style>| in-between coordinates. \begin{tzcode}{.3} @@ -2844,8 +2890,10 @@ You can use the first brace option |{<path style>}| to change all the |<path sty \end{tikzpicture} \end{tzcode} +The default path style is `|to|' and can also be changed by \icmd{\settzpathstyle}, like, for example, |\settzpathstyle{--}|. The effect remains valid until the end of |tikzpicture| environment unless changed again. + \begin{tzcode}{.3} -% \tzpath: path construction +% \tzpath: \settzpathstyle \begin{tikzpicture} \tzhelplines(4,3) \settzpathstyle{to[bend right]} @@ -2859,6 +2907,7 @@ You can use the first brace option |{<path style>}| to change all the |<path sty \end{tzcode} You can extend the path of |\tzpath| by writing \Tikz\ code in the last (after the semicolon) optional argument |<code.append>|. +So |<--cycle>| closes the path with a straight line. \begin{tzcode}{.3} % \tzpath: <code.append> @@ -2874,6 +2923,27 @@ You can extend the path of |\tzpath| by writing \Tikz\ code in the last (after t \end{tikzpicture} \end{tzcode} +\section{\protect\cmd{\tzpath*}: Semicolon version} +\label{s:tzpath*} + +The starred version \icmd{\tzpath*} additionally fills the interior of |\tzpath| with |black!50| with |fill opacity=.3| and |text opacity=1|, by default. + +|\tzpath*| works like |\tzpath[fill=black!50,fill opacity=.3,text opacity=1]|. +You can change the defaults by \icmd{\settzfillcolor} and \icmd{\settzfillopacity}. + +\begin{tzdef}{} +% syntax: minimal +\tzpath*(<coor>)(<coor>) ..repeated.. (<coor>) ; {<fill opacity>} +% syntax: full +\tzpath*{<path style>}[<opt>]<shift coor>"<path name>" + (<coor>)[<path style>]{<text>}[<node opt>] + ..repeated.. ()[]{}[] ; {<fill opacity>} <code.append> +% defaults: \tzpath* + *{to}[fill=black!50,fill opacity=.3,text opacity=1]<>"" + (<m>)[]{}[] ..repeated.. ()[]{}[] ; {.3}<> +\end{tzdef} + + \paragraph{Filling the interior} You can optionally change the opacity of fill color using the \Tikz\ option |fill opacity|. @@ -2889,8 +2959,7 @@ You can optionally change the opacity of fill color using the \Tikz\ option |fil \end{tikzpicture} \end{tzcode} -The starred version |\tzpath*| fill the interior of |\tzpath| with the defaults |black!50| and |fill opacity=.3|. You can change the opacity by specifying the last (after the semicolon) optional argument |{<fill opacity>}|. -You can also use |\settzfillcolor| and |\settzfillopacity| to change the defaults. +You can also change the fill opacity by specifying the \xem{last} curly brace optional argument |{<fill opacity>}|, \xem{after the semicolon}. \begin{tzcode}{.3} % \tzpath* @@ -2903,14 +2972,17 @@ You can also use |\settzfillcolor| and |\settzfillopacity| to change the default \end{tikzpicture} \end{tzcode} +You can also use the macros |\settzfillcolor| and |\settzfillopacity| to change the defaults. +The effect remains valid until the end of the |tikzpicture| environment, unless changed again. \begin{tzcode}{.3} -% \tzpath* +% \tzpath*: \settzfillcolor \begin{tikzpicture} \tzhelplines(4,3) +\settzfillcolor{red} \tzpath*[blue](0,1)(1,2)[-|](3,1)(4,3); < to [bend right=60] (0,1) > -\tzpath*[red] +\tzpath* (0,0)[to[bend right]] (1,1) (2,1)[to[out=-135,in=45]] @@ -2948,7 +3020,7 @@ The \iisw{plus version} \icmd{\tzpath+} uses each coordinate (except for the fir \tzline[red,very thick](0,3)(4,0) \tzpath*+(0,0)(3,1)(-1,2)(-2,-1); \tzpath*+[fill=green] - <1,-1>(0,0)(3,1)(-1,2)(-2,-1); {.5} %% + <1,-1>(0,0)(3,1)(-1,2)(-2,-1); {.5} %% \end{tikzpicture} \end{tzcode} @@ -2962,10 +3034,10 @@ There are many ways to draw curves. %%----------------------------------- %%------------------------------------------------------------ -\section{Bezier curves} +\section{B\'{e}zier curves} \label{s:beziercurves} -\icmd{\tzbezier} draws a bezier curve with one or two control points. +\icmd{\tzbezier} draws a B\'{e}zier curve with one or two control points. \subsection{\protect\cmd{\tzbezier}} \label{ss:tzbezier} @@ -2985,7 +3057,7 @@ There are many ways to draw curves. \paragraph{Control points} You can specify one or two control points, |(<cntl-coor>)|. -So |\tzbezier| accepts three or four coordinates. +So |\tzbezier| accepts three or four coordinates as arguments. \begin{tztikz}{} % three coordinates: one control point @@ -3026,7 +3098,7 @@ You can also change the dotted line style, like |tzshowcontrols={dashed,green}|. \paragraph{Adding text} You can add text next to the curve or at the last coordinate -by specifying the options |{<text>}| and |[node opt]| immediately after the last coordinate. +by specifying the options |{<text>}| and |[<node opt>]| immediately after the last coordinate. \begin{tzcode}{.3} @@ -3039,7 +3111,8 @@ by specifying the options |{<text>}| and |[node opt]| immediately after the last \end{tzcode} \paragraph{Shift} -You can move the curve by specifying the option |<shift coor>| before the first coordinate or immediately before the option |"<path name>"|, if any. +You can move the curve of |\tzbezier| by specifying the option |<shift coor>| before the first coordinate or immediately before the option |"<path name>"|, if any. +The empty shift option |<>| is not allowed. \begin{tzcode}{.3} % \tzbezier: shift @@ -3060,7 +3133,7 @@ You can move the curve by specifying the option |<shift coor>| before the first You can name the path of |\tzbezier| by specifying the option |"<path name>"| immediately before the first coordinate. \begin{tzcode}{.3} -% \tzbezier: name path +% \tzbezier: name path, intersection \begin{tikzpicture} \tzhelplines(4,4) \tzbezier[blue,dashed,thick]<1,1>"curve" @@ -3072,7 +3145,7 @@ You can name the path of |\tzbezier| by specifying the option |"<path name>"| im \end{tikzpicture} \end{tzcode} -\paragraph{Extending the path} +\paragraph{Extending paths} You can extend the path of |\tzbezier| from the last coordinate, by writing \Tikz\ code in the last optional argument |<code.append>|. @@ -3092,7 +3165,7 @@ in the last optional argument |<code.append>|. \subsection{\protect\cmd{\tzbezier+}: Relative coordinates} \label{ss:tzbezier+} -For the \iisw{plus version}, |\tzbezier+(A)(B)(C)|, |(B)| and |(C)| are relative to |(A)|, as in \Tikz. +For the \iisw{plus version} |\tzbezier+(A)(B)(C)|, |(B)| and |(C)| are relative to |(A)|, as in \Tikz. For |\tzbezier+(A)(B)(C)(D)|, |(B)| and |(D)| are relative to |(A)|, and |(C)| is relative to |(D)|, as in \Tikz. @@ -3157,7 +3230,7 @@ In the case of three coordinates, the parabola bends at the second coordinate. \end{tzdef} \paragraph{Parabolas} -|\tzplot| draws the graph of $f(x)=ax^2+bx+c$ for appropriate values of $a$, $b$, and $c$. +|\tzplot| draws the graph of a quadratic function $f(x)=ax^2+bx+c$ for appropriate values of $a$, $b$, and $c$. \begin{tzcode}{.3} % \tzparabola: two coordinates @@ -3195,6 +3268,7 @@ You can add text at or around the last coordinate by specifying the options |{<t \paragraph{Shift} You can move the parabola by specifying the option |<shift coor>| before the first coordinate or immediately before the option |"<path name>"|, if any. +The empty shift option |<>| is not allowed. \begin{tzcode}{.3} % \tzparabola: shift @@ -3210,7 +3284,7 @@ You can move the parabola by specifying the option |<shift coor>| before the fir You can name the path of |\tzparabola| by specifying the option |"<path name>"| immediately before the first coordinate. \begin{tzcode}{.3} -% \tzparabola: name path +% \tzparabola: name path, intersection \begin{tikzpicture} \tzhelplines(4,3) \tzparabola[blue]"AC"(0,3)(2,1)(4,2){AC}[r] @@ -3221,7 +3295,7 @@ You can name the path of |\tzparabola| by specifying the option |"<path name>"| \end{tikzpicture} \end{tzcode} -\paragraph{Extending the path} +\paragraph{Extending paths} You can extend the path of |\tzparabola| from the last coordinate by writing \Tikz\ code in the last optional argument |<code.append>|. \begin{tzcode}{.3} @@ -3272,18 +3346,26 @@ For the \iisw{plus version} \icmd{\tzparabola+}, the second and the third coordi \section{\protect\cmd{\tzplotcurve}} \label{s:tzplot} -See Section \ref{s:tzplotcurve} on page \pageref{s:tzplotcurve} for more details on |\tzplotcurve|. +See Section \ref{s:tzplotcurve} on page \pageref{s:tzplotcurve}, for more details on |\tzplotcurve|. %%------------------------------------------------------------ \section{\protect\cmd{\tzto}, \protect\cmd{\tztos}} -\label{s:curvetzto} +\label{s:curves:tzto} + +See Section \ref{s:tzto} on page \pageref{s:tzto}, for more details on |\tzto|. -See Section \ref{s:tzto} on page \pageref{s:tzto} for more details on |\tzto|. +See Section \ref{s:tztos} on page \pageref{s:tztos}, for more details on |\tztos|. + + +%%------------------------------------------------------------ +\section{\protect\cmd{\tzfn}} +\label{s:curves:tzfn} -See Section \ref{s:tztos} on page \pageref{s:tztos} for more details on |\tztos|. +With \icmd{\tzfn}, you can plot functions such as $f(x)=\frac13(x-1)^3+1$, $g(x)=\sin x$, $h(x)=\sqrt{x-1}$, and so on. +See Section \ref{s:tzfn} on page \pageref{s:tzfn}, for more details on |\tzfn|. @@ -3303,13 +3385,13 @@ See Section \ref{s:tztos} on page \pageref{s:tztos} for more details on |\tztos| % syntax: minimum \tzpolygon(<coor>)(<coor>)..repeated..(<coor>) ; % syntax: medium -\tzpolygon (<coor>){<text>}[<node opt>]..repeated..(<coor>){<text>}[<node opt] ; -% syntax +\tzpolygon (<coor>){<text>}[<node opt>]..repeated..(<coor>){<text>}[<node opt>] ; +% syntax: full \tzpolygon[<opt>]<shift coor>"<path name>" (<coor>){<text>}[<node opt>] ..repeated.. (){}[] ; <code.append> % defaults - []<>""(<m>){}[] .. repeated.. (){}[] ; {} <> + []<>""(<m>){}[] ..repeated.. (){}[] ; <> \end{tzdef} \begin{tztikz}{} @@ -3317,7 +3399,7 @@ See Section \ref{s:tztos} on page \pageref{s:tztos} for more details on |\tztos| \draw (1,1) -- (2,2) -- (3,1) -- (4,3) -- cycle; \end{tztikz} -You can add text next to lines by specifying the options |{<text>}| and |[<node opt>]| \xem{inbetween} coordinates. +You can add text next to lines by specifying the options |{<text>}| and |[<node opt>]| \xem{in-between} coordinates. \begin{tzcode}{.3} % \tzpolygon @@ -3333,6 +3415,7 @@ You can add text next to lines by specifying the options |{<text>}| and |[<node \end{tzcode} You can also move the polygon by specifying the option |<shift coor>| before the first coordinate. +The empty shift option |<>| is not allowed. \begin{tzcode}{.3} % \tzpolygon: shift @@ -3354,22 +3437,23 @@ You can also move the polygon by specifying the option |<shift coor>| before the \section{\protect\cmd{\tzpolygon*}: Semicolon version} \label{s:tzpolygon*} -\icmd{\tzpolygon*} paints the interior of the polygon with |black!50| with |fill opacity=.3|, by default. +\icmd{\tzpolygon*} paints the interior of the polygon with |black!50| with |fill opacity=.3| but with |text opacity=1|, by default. \begin{tzdef}{} % syntax: minimum \tzpolygon*(<coor>)(<coor>)..repeated..(<coor>) ; % syntax: medium \tzpolygon*(<coor>){<text>}[<node opt>]..repeated..(<coor>){<text>}[<node opt] ; -% syntax +% syntax: full \tzpolygon*[<opt>]<shift coor>"<path name>" - (<coor>){<text>}[<node opt>] - ..repeated.. (){}[] ; {<fill opacity>} <code.append> + (<coor>){<text>}[<node opt>] + ..repeated.. (){}[] ; {<fill opacity>} <code.append> % defaults - *[fill=black!50,fill opacity=.3]<>""(<m>){}[] .. repeated.. (){}[] ; {} <> + *[fill=black!50,fill opacity=.3,text opacity=1]<>"" + (<m>){}[] .. repeated.. (){}[] ; {} <> \end{tzdef} -You can change the opacity by specifying the the last optional argument |{<fill opacity>}| immediately after the semicolon. +You can change the fill opacity by specifying the the last curly brace option |{<fill opacity>}| immediately \xem{after the semicolon}. \begin{tzcode}{.3} % \tzpolygon: shift @@ -3392,7 +3476,7 @@ You can also change the defaults using |\settzfillcolor| and |\sttzfillopacity|. \section{\protect\cmd{\tzpolygon+} and \protect\cmd{\tzpolygon*+}: Relative coordinates: Semicolon verion} \label{s:tzpolygon} -The plus version \icmd{\tzpolygon+} uses each coordinate (except the first one) relative to the previous coordinate. +The plus version \icmd{\tzpolygon+} uses each coordinate (except the first one) relative (with |++|) to the previous coordinate. \xem{Everything else is the same as in} |\tzpolygon|. @@ -3404,9 +3488,7 @@ The plus version \icmd{\tzpolygon+} uses each coordinate (except the first one) \end{tztikz} \begin{tztikz}{} -\tzpolygon+[dashed]"AA"(1,1)(2,2){A}(3,1){B}[below]; - % is an abbreviation (with defaults) of: - +\tzpolygon+[dashed]"AA"(1,1)(2,2){A}(3,1){B}[below]; % works like: \draw [dashed,name path=AA] (1,1) -- ++(2,2) -- ++(3,1) node {A} @@ -3441,18 +3523,20 @@ The plus version \icmd{\tzpolygon+} uses each coordinate (except the first one) % syntax: minimum \tzframe(<coor>)(<coor>) % syntax: full -\tzframe[<opt>]<shift coor>"<path name>"(<coor1>)(<coor2>) +\tzframe[<opt>]<shift coor>"<path name>"(<coor1>)(<coor2>)<code.append> % defaults - []<>""(<m>)(<m>) + []<>""(<m>)(<m>)<> \end{tzdef} +\icmd{\tzrectangle} is an alias of |\tzframe|. + \begin{tztikz}{} \tzframe(0,1)(3,2) % works like: \draw (0,1) rectangle (3,2); \end{tztikz} -The plus version \icmd{\tzframe+} uses the second coordinate as the coordinate relative (with |++|) to the first. +The plus version \icmd{\tzframe+} uses the second coordinate as the coordinate relative (with |++|) to the first. \icmd{\tzrectangle+} is an alias of |\tzframe+|. \begin{tztikz}{} \tzframe+(0,1)(3,2) % works like: @@ -3470,14 +3554,17 @@ The plus version \icmd{\tzframe+} uses the second coordinate as the coordinate r The starred version \icmd{\tzframe*} fills the interior with |black!50| with |fill opacity=.3|, by default. +(\icmd{\tzrectangle*} is an alias of |\tzframe*|.) |\tzframe+| has also its starred version \icmd{\tzframe*+}. +(\icmd{\tzrectangle*+} is an alias of |\tzframe*+|.) \begin{tzdef}{} % syntax -\tzframe*[<opt>]<shift coor>"<path name>"(<coor1>)(<coor2>){<fill opacity>} +\tzframe*[<opt>]<shift coor>"<path name>" + (<coor1>)(<coor2>){<fill opacity>}<code.append> % defaults - *[fill=black!50,fill opacity=.3]<>""(<m>)(<m>){.3} + *[fill=black!50,fill opacity=.3]<>""(<m>)(<m>){.3}<> \end{tzdef} With the starred versions, you can change the fill opacity using the last option |{<fill opacity>}|. @@ -3491,12 +3578,13 @@ With the starred versions, you can change the fill opacity using the last option \end{tikzpicture} \end{tzcode} -You can move |\tzframe| and its friends by specifying the option |<shift coor>| immediately before the first mandatory coordinate. +You can move |\tzframe| and its variants by specifying the option |<shift coor>| immediately before the first mandatory coordinate. +The empty shift option |<>| is not allowed. \begin{tzcode}{.3} % \tzframe(*)(+): shift \begin{tikzpicture} -\tzhelplines(4,4) +\tzhelplines*(4,4) \tzframe(0,0)(3,2) \tzframe[blue,dashed]<1,1>(0,0)(3,2) \tzcoors(1,3)(A)(1,-2)(B); @@ -3506,18 +3594,32 @@ You can move |\tzframe| and its friends by specifying the option |<shift coor>| \end{tikzpicture} \end{tzcode} +You can extend the path by the option |<code.append>|. + +\begin{tzcode}{.3} +% \tzframe(*), \tzrectangle(*): <code.append> +\begin{tikzpicture} +\tzhelplines(4,4) +\tzcoors(2,2)(A)(3,1)(B); +\tzrectangle*[blue,even odd rule](0,0)(3,2) + <(.5,.5) rectangle (2.5,1.5)> +\tzframe[fill=green,even odd rule](2,1)(4,4) + <(2.3,1.2) rectangle (3.5,3.6)> +\end{tikzpicture} +\end{tzcode} %%------------------------------------------------------------ \section{\protect\cmd{\tzcircle} and \protect\cmd{\tzcircle*}} \label{s:tzcircle} \icmd{\tzcircle} draws a circle around a specified coordinate with a specified radius. +The coordinate and the radius are mandatory. \begin{tzdef}{} % syntax -\tzcircle[<opt>]<shift coor>"<path name>"(<coor>)(<radius>) +\tzcircle[<opt>]<shift coor>"<path name>"(<coor>)(<radius>)<code.append> % defaults - []<>""(<m>)(<m>) + []<>""(<m>)(<m>)<> \end{tzdef} \begin{tztikz}{} @@ -3531,9 +3633,10 @@ You can change the fill opacity using the last option |{<fill opacity>}|. \begin{tzdef}{} % syntax -\tzcircle*[<opt>]<shift coor>"<path name>"(<coor>)(<radius>){<fill opacity>} +\tzcircle*[<opt>]<shift coor>"<path name>" + (<coor>)(<radius>){<fill opacity>}<code.append> % defaults - *[fill=black!50,fill opacity=.3]<>""(<m>)(<m>){.3} + *[fill=black!50,fill opacity=.3]<>""(<m>)(<m>){.3}<> \end{tzdef} \begin{tzcode}{.3} @@ -3548,6 +3651,7 @@ You can change the fill opacity using the last option |{<fill opacity>}|. \end{tzcode} You can move the circle by specifying the option |<shift coor>| immediately before the center coordinate. +The empty shift option |<>| is not allowed. \begin{tzcode}{.3} % \tzcircle(*): shift @@ -3561,6 +3665,20 @@ You can move the circle by specifying the option |<shift coor>| immediately befo \end{tikzpicture} \end{tzcode} +You can extend the path by the option |<code.append>|. + +\begin{tzcode}{.3} +% \tzcircle(*): <code.append> +\begin{tikzpicture} +\tzhelplines(4,4) +\tzcoors(2,2)(A)(3,1)(B); +\tzcircle*[blue,even odd rule](2,2)(1) + <(2,2) circle (1.5)> +\tzcircle[fill=green,even odd rule](3,1)(1) + <(3,1) circle (.7)> +\end{tikzpicture} +\end{tzcode} + %%------------------------------------------------------------ \section{\protect\cmd{\tzellipse} and \protect\cmd{\tzellipse*}} @@ -3570,11 +3688,13 @@ You can move the circle by specifying the option |<shift coor>| immediately befo \begin{tzdef}{} % syntax -\tzellipse[<opt>]<shift coor>"<path name>"(<coor>)(<x and y radius>) +\tzellipse[<opt>]<shift coor>"<path name>"(<coor>)(<x and y radius>)<code.append> % defaults - []<>""(<m>)(<m>) + []<>""(<m>)(<m>)<> \end{tzdef} +\icmd{\tzoval} is an alias of |\tzellipse|. + \begin{tztikz}{} \tzellipse(0,0)(1 and .5) % works like: \draw (0,0) ellipse (1 and .5); @@ -3586,9 +3706,10 @@ You can change the fill opacity using the last option |{<fill opacity>}|. \begin{tzdef}{} % syntax -\tzellipse*[<opt>]<shift coor>"<path name>"(<coor>)(<x and y radius>){<fill opacity>} +\tzellipse*[<opt>]<shift coor>"<path name>" + (<coor>)(<x and y radius>){<fill opacity>}<code.append> % defaults - *[fill=black!50,fill opacity=.3]<>""(<m>)(<m>){.3} + *[fill=black!50,fill opacity=.3]<>""(<m>)(<m>){.3}<> \end{tzdef} \begin{tzcode}{.3} @@ -3603,6 +3724,7 @@ You can change the fill opacity using the last option |{<fill opacity>}|. \end{tzcode} You can move the ellipse by specifying the option |<shift coor>| immediately before the mandatory coordinate. +The empty shift option |<>| is not allowed. \begin{tzcode}{.3} % \tzellipse(*): shift @@ -3616,6 +3738,20 @@ You can move the ellipse by specifying the option |<shift coor>| immediately bef \end{tikzpicture} \end{tzcode} +You can extend the path by the option |<code.append>|. +Note also that \icmd{\tzoval*} is an alias of |\tzellipse*|. + +\begin{tzcode}{.3} +% \tzellipse(*), \tzoval(*): <code.append> +\begin{tikzpicture} +\tzhelplines(4,4) +\tzcoors(2,2)(A)(3,1)(B); +\tzoval*[blue,even odd rule](2,2)(1.5 and 1) + <(2,2) ellipse (2 and 1.5)> +\tzellipse[fill=green,even odd rule](3,1)(1 and 1) + <(3,1) ellipse (.5 and .8)> +\end{tikzpicture} +\end{tzcode} %%================================== @@ -3629,7 +3765,7 @@ You can move the ellipse by specifying the option |<shift coor>| immediately bef \subsection{Arcs} \label{ss:tzarc} -\icmd{\tzarc} draws an arc around a specified center. +\icmd{\tzarc} draws an arc around a specified center coordinate. \begin{tzdef}{} % syntax: minimum @@ -3747,7 +3883,7 @@ You can also extend the path of |\tzarc| by specifying the last option |<code.ap \section{\protect\cmd{\tzarcfrom(')}: Arcs as in \Tikz} \label{s:tzarcfrom} -\icmd{\tzarcfrom} draws an arc starting from a point, like \Tikz\ does. +\icmd{\tzarcfrom} draws an arc starting from a specified point, like \Tikz\ does. \begin{tzdef}{} % syntax: minimum @@ -3777,7 +3913,7 @@ You can also extend the path of |\tzarc| by specifying the last option |<code.ap \tzdots*(1,1)(3,2); \tzarcfrom [blue,->] (1,1)(-45:180:1){A}[r] \tzarcfrom'[dashed,->](1,1)(-45:180:1) -\tzarcfrom[->] (3,2)(-45:180:1){arc}[midway,sloped] +\tzarcfrom[->](3,2)(-45:180:1){arc}[midway,sloped] \tzarcfrom'[dashed,->](3,2)(-45:180:1) \end{tikzpicture} \end{tzcode} @@ -3788,22 +3924,24 @@ You can also extend the path of |\tzarc| by specifying the last option |<code.ap \section{\protect\cmd{\tzarcsfrom}: Connected arcs: Semicolon version} \label{s:tzarcsfrom} -\icmd{\tzarcsfrom} accepts an arbitrary number of |(<angA:AngB:radius>)| following the start coordinate. You need to enter a \xem{semicolon} to indicate when the repetition ends. +The macro \icmd{\tzarcsfrom} (i.e. |\tzarcs + from|) accepts an arbitrary number of parenthesis arguments in the form of |(<angA:AngB:radius>)| following the start coordinate. You need to enter a \xem{semicolon} to indicate when the repetition ends. \begin{tzdef}{} -% syntax -\tzarcsfrom[<opt>]<shift coor>"<path name>"(<start coor>) - (<angA:angB:radius>){<text>}[<node opt>] - ..repeated..(){}[] ; <code.append> +% syntax: minimum +\tzarcsfrom(<start coor>) + (<angA:angB:radius>)..repeated..(<angA:angB:radius>) ; +% syntax: full +\tzarcsfrom[<opt>]<shift coor>"<path name>" + (<start coor>)(<angA:angB:radius>){<text>}[<node opt>] + ..repeated..(){}[] ; <code.append> % defaults - []""(<m>)(<m>){}[]..repeated..(){}[];<> + []<>""(<m>)(<m>){}[]..repeated..(){}[] ; <> \end{tzdef} \begin{tzcode}{.4} % \tzarcfrom: adding text, <code.append> \begin{tikzpicture} -\edef\x{atan(2/3)} \tzhelplines(4,4) \tzcoor*(3,2)(A) \tzarcsfrom[->,auto](A) @@ -3856,7 +3994,25 @@ You can also extend the path of |\tzarc| by specifying the last option |<code.ap \edef\x{atan(2/3)} \tzarcsfrom[draw=none,fill=flagred](0,0) (-\x:-\x-180:1) - (-\x+180:-\x:2); + (-\x+180:-\x:2) + (-\x:-\x+180:1);<-- cycle> +\tzarcsfrom[draw=none,fill=flagblue](0,0) + (180-\x:-\x:1) + (-\x:-\x-180:2) + (-\x+180:-\x+360:1);<-- cycle> +\end{tikzpicture} +\end{tzcode} + + +\begin{tzcode}{.4} +% flag: shift +\definecolor{flagred}{RGB}{205,48,57} +\definecolor{flagblue}{RGB}{17,73,156} +\begin{tikzpicture}[scale=1] +\edef\x{atan(2/3)} +\tzarcsfrom[draw=none,fill=flagred]<.1,.3>(0,0) + (-\x:-\x-180:1) + (-\x+180:-\x:2) (-\x:-\x+180:1);<-- cycle> \tzarcsfrom[draw=none,fill=flagblue](0,0) (180-\x:-\x:1) @@ -3881,25 +4037,19 @@ You can also extend the path of |\tzarc| by specifying the last option |<code.ap \begin{tzdef}{} % syntax \tzwedge[<opt>]<shift coor>"<path name>" - (<coor>)(<angA:angB:radius>){<text>}[<pos>] + (<coor>)(<angA:angB:radius>){<text>}[<node opt>] % defaults []<>""(<m>)(<m>){}[midway] \end{tzdef} -\begin{tzdef}{} -% syntax -\tzwedge*[<opt>]<shift coor>"path name"(<coor>)(<angA:angB:radius>) - {<text>}[<pos>]{<fill opacity>} -% defaults - []<>""(<m>)(<m>){}[midway]{.3} -\end{tzdef} \begin{tztikz}{} \tzwedge(1,1)(30:120:1) % works like: \draw (1,1) -- ++(30:1) arc (30:120:1) -- cycle; \end{tztikz} -The \iisw{swap version} \icmd{\tzwedge'} switches the drawing direction from \ixxw{counterclockwise} to \ixxw{clockwise} and vice versa. +The macro \icmd{\tzwedge'} is the \iisw{swap version} of \icmd{\tzwedge}. +It switches the drawing direction from \ixxw{counterclockwise} to \ixxw{clockwise} and vice versa. \begin{tztikz}{} @@ -3940,15 +4090,16 @@ The \iisw{swap version} \icmd{\tzwedge'} switches the drawing direction from \ix \subsection{\protect\cmd{\tzwedge*(')}} \label{ss:tzwedge*} -\icmd{\tzwedge*} works just like |\tzwedge|, but it fills wedges with |black!50| with |fill opacity=.3|, by default. +The starred version \icmd{\tzwedge*} works just like |\tzwedge|, but it fills wedges with |black!50| with |fill opacity=.3| and |fill opacity=1|, by default. You can change the defaults with |\settzfillcolor| and |\settzfillopacity|. +You can also change the fill opacity by specifying the last optional argument |{<fill opacity>}|. \begin{tzdef}{} % syntax \tzwedge*[<opt>]<shift coor>"<path name>" - (<coor>)(<angA:angB:radius>){<text>}[<pos>] + (<coor>)(<angA:angB:radius>){<text>}[<node opt>]{<fill opacity>} % defaults - [fill=black!50,fill opacity=.3]<>""(<m>)(<m>){}[midway] + [fill=black!50,fill opacity=.3,text opacity=1]<>""(<m>)(<m>){}[midway]{.3} \end{tzdef} \icmd{\tzwedge*'} is the \iisw{swap version} of |\tzwedge*|. @@ -3966,7 +4117,7 @@ You can change the defaults with |\settzfillcolor| and |\settzfillopacity|. \end{tzcode} \begin{tzcode}{.3} -% \tzwedge*('): shift +% \tzwedge*('): shift, fill opacity \begin{tikzpicture} \tzdot*(1,1) \tzhelplines(3,3) @@ -3974,7 +4125,7 @@ You can change the defaults with |\settzfillcolor| and |\settzfillopacity|. \tzwedge[red,very thick]<.5,.5>(1,1)(30:120:1.5) \tzwedge'[dashed](1,1)(0:135:1.5) \tzwedge*[fill=blue](1,1)(300:240:1){B}[b] -\tzwedge*[fill=red]<2,0>(1,1)(300:240:1){B}[b] +\tzwedge*[blue]<2,0>(1,1)(300:240:1){B}[b]{.7} \end{tikzpicture} \end{tzcode} diff --git a/graphics/pgf/contrib/tzplot/tzplot-doc-D-v1.0.tex b/graphics/pgf/contrib/tzplot/tzplot-doc-D-v1.0.1.tex index 3f76a7cb3e..d493e6ecf6 100644 --- a/graphics/pgf/contrib/tzplot/tzplot-doc-D-v1.0.tex +++ b/graphics/pgf/contrib/tzplot/tzplot-doc-D-v1.0.1.tex @@ -19,16 +19,16 @@ \label{ss:tzaxes} Basically, \cmd{\tzaxes}|(<x1,y1>)(<x2,y2>)| draws the $x$ axis from |<x1>| to |<x2>| and the $y$ axis from |<y1>| to |<y2>|. -The coordinate |(<x1,y1>)| represents the origin and |(<x2,y2>)| represents the opposite corner of the rectangle. +The coordinate |(<x1,y1>)| represents the origin and |(<x2,y2>)| represents the opposite corner of the rectangle formed by the two coordinates. -|\tzaxes| takes only one coordinate |(<x2,y2>)| as a mandatory argument, in which case |(<x1,y1>)| is considered as |(0,0)|. +|\tzaxes| takes only one coordinate |(<x2,y2>)| as a mandatory argument, in which case the coordinate |(<x1,y1>)| is considered as |(0,0)|. \begin{tzdef}{} % syntax: minimal \tzaxes(<x2,y2>){<x-axis name>}{<y-axis name>} % syntax: full \tzaxes[<opt>]<x-shift,y-shift>(<x1,y1>)(<x2,y2>) - {<x-axis label>}[<node opt>]{<y-axis name>}[<node opt>] + {<x-axis name>}[<node opt>]{<y-axis name>}[<node opt>] % defaults [->]<0,0>(0,0)(<m>){}[right]{}[above] % arguments @@ -62,9 +62,9 @@ Specifying the option |<x-shift,y-shift>| moves the axes to intersect at $(\text \begin{tikzpicture}[scale=.5] \tzhelplines(-1,-1)(7,7) \tzshoworigin* -\tzaxes[thick,blue]<1,2>(7,7){$x$}{$y$} +\tzaxes[thick,blue]<1,2>(7,7){$x$}{$y$} %% \tzaxes[-,dashed](7,7){$X$}[below]{$Y$}[left] -\tzaxes<6,1>(6,1)(3,6){$a$}[left]{$b$} +\tzaxes<6,1>(6,1)(3,6){$a$}[left]{$b$} %% \end{tikzpicture} \end{tzcode} @@ -72,7 +72,7 @@ Specifying the option |<x-shift,y-shift>| moves the axes to intersect at $(\text \subsection{\protect\cmd{\tzaxes*}} \label{ss:tzaxes*} -The starred version \icmd{\tzaxes*} sets the current state to a \iisw{bounding box} when |\tzaxes| is executed. It is recommended for you to use |\tzaxes*| as the first graphics command in |tikzpicture| environment or before any larger graphics. +The starred version \icmd{\tzaxes*} sets the current state to a \iisw{bounding box} when the macro |\tzaxes| execution is complete. It is recommended for you to use |\tzaxes*| as the first graphics command in |tikzpicture| environment or before any larger graphics. \begin{tzcode}{.3} \begin{tikzpicture}[scale=.5] @@ -161,14 +161,14 @@ The starred version \icmd{\tzaxes*} sets the current state to a \iisw{bounding b % syntax \tzshoworigin<shift coor>(<origin>){<text>}[<node opt>] % default - <>(0,0)<>{0}[below left,text height=1.25ex,text depth=.25ex] + <>(0,0){0}[below left,text height=1.25ex,text depth=.25ex] \end{tzdef} All arguments of |\tzshoworigin| are optional. \begin{tzcode}{.3} % \tzshoworigin -\begin{tikzpicture}[scale=.5] +\begin{tikzpicture}[scale=.45] \tzhelplines(8,5) \tzshoworigin \tzaxes(8,5) @@ -181,12 +181,12 @@ Specifying the option |<shift coor>| also moves the origin. \begin{tzcode}{.3} -% \tzshoworigin -\begin{tikzpicture}[scale=.5] +% \tzshoworigin: shift +\begin{tikzpicture}[scale=.45] \tzhelplines(-2,-1)(8,6) -\tzshoworigin{$O_1$} +\tzshoworigin{$O_1$} %% \tzaxes(8,6){$x$}{$y$} -\tzshoworigin<2,1>{$O_2$}[red] +\tzshoworigin<2,1>{$O_2$}[red] %% \tzaxes[dashed]<2,1>(8,6) \end{tikzpicture} \end{tzcode} @@ -201,14 +201,14 @@ Internally the dot is processed by |\tzdot*|. All arguments are optional. \begin{tzdef}{} % syntax -\tzshoworigin*[<dot opt>]<shift coor>(<origin>){<text>}[<node opt>](<dotsize>) +\tzshoworigin*[<dot opt>]<shift coor>(<origin>){<text>}[<node opt>](<dot size>) % default - *[]<>(0,0)<>{}[below left,text height=1.25ex,text depth=.25ex](2.4pt) + *[]<>(0,0){}[below left,text height=1.25ex,text depth=.25ex](2.4pt) \end{tzdef} \begin{tzcode}{.3} % \tzshoworigin* -\begin{tikzpicture}[scale=.5] +\begin{tikzpicture}[scale=.45] \tzhelplines(-2,-1)(6,4) \tzshoworigin* \tzaxes(-2,-1)(6,4) @@ -216,7 +216,7 @@ Internally the dot is processed by |\tzdot*|. All arguments are optional. \end{tzcode} You can add text with the option |{<text>}|. -The default size of the dot is |2.4pt|, and it can be changed it with the last option |(<dot size)|. You can change the dot style using the first optional argument |[<dot opt>]|. +The default size of the dot is |2.4pt|, and it can be changed with the last option |(<dot size>)|. You can change the dot style using the first optional argument |[<dot opt>]|. You can also move the dot by specifying the option |<shift coor>|. \begin{tzcode}{.3} @@ -232,11 +232,11 @@ You can also move the dot by specifying the option |<shift coor>|. \remark For |\tzshoworigin*|, text for the origin and the dot are placed independently. In other words, the position of node text does not depend on the size of a node dot. -(In fact, the node text for the origin should look good with the `ticks', so it was not designed as a |label| for the node dot. This also means that the origin text cannot be positioned by an |<angle>|.) +(In fact, the node text for the origin should look good with the `ticks labels', so it was not designed as a |label| for the node dot. This also means that the origin text cannot be positioned by an |<angle>|.) \begin{tzcode}{.3} -% \tzshoworigin* (with ticks) +% \tzshoworigin* (with tick labels) \begin{tikzpicture}[scale=.5] \tzhelplines(-2,1)(6,5) \tzshoworigin*{0}(5pt) @@ -271,7 +271,7 @@ Those two coordinates are mandatory. [#8]: y-axis name option %% node option \end{tzdef} -The swap version \icmd{\tzaxesL'} swaps |(x1,y1)| and |(x2,y2)| from |\tzaxesL|. +The \iisw{swap version} \icmd{\tzaxesL'} swaps |(<x1,y1>)| and |(<x2,y2>)|. That is, |\tzaxesL'(A)(B)| is equivalent to |\tzaxesL(B)(A)|. \begin{tzcode}{.3} @@ -287,6 +287,7 @@ That is, |\tzaxesL'(A)(B)| is equivalent to |\tzaxesL(B)(A)|. \end{tzcode} The option |<shift coor>| moves the whole L-type axes. +The empty option |<>| is not allowed. \begin{tzcode}{.3} % \tzaxesL, \tzaxesL': shift @@ -312,7 +313,7 @@ The option |<shift coor>| moves the whole L-type axes. \section{\protect\cmd{\tzticks}: Tick labels} \label{s:tzticks} -By default, \icmd{\tzticks} prints tick labels and draw zero length tick marks, i.e. from |(0pt)| to |(0pt)|. +By default, \icmd{\tzticks} prints tick labels and draws zero length tick marks, i.e. from |(0pt)| to |(0pt)|. \begin{tzdef}{} % syntax: minimal @@ -331,7 +332,7 @@ By default, \icmd{\tzticks} prints tick labels and draw zero length tick marks, \paragraph{Tick labels} Internally, |\tzticks| uses \Tikz's |foreach| operation. So you need to provide comma separated lists to print tick labels. -If only one comma separated is used, it is for $x$ tick labels. +If only one comma separated list is specified, it is for $x$ tick labels. \begin{tzcode}{.3} % \tzticks @@ -342,7 +343,7 @@ If only one comma separated is used, it is for $x$ tick labels. \end{tikzpicture} \end{tzcode} -You change the numbered labels to a different format slashes and other text, as follows: |<number>/<other text>|. +You can change the numbered labels to a different format with slashes and other text, as follows: |<number>/<other text>|. \begin{tzcode}{.3} % \tzticks: tick labels @@ -358,14 +359,14 @@ You change the numbered labels to a different format slashes and other text, as To prints tick marks you need to specify |(<x-from:x-to>)| for $x$ ticks and/or |(<y-from:y-to>)| for $y$ ticks. (The default is |(0pt:0pt)|.) \begin{tzcode}{.3} -% \tzticks: tick marks +% \tzticks: tick marks with (<a pt:b pt>) \begin{tikzpicture}[scale=.4,font=\scriptsize] \tzhelplines(10,10) \tzshoworigin \tzaxes(-1,-1)(10,10) \tzticks[draw=red,thick] (-5pt:10pt){1,...,7,8/$\alpha$} - (0pt:3cm){2,...,6,7/$\beta$} + (0pt:3cm) {2,...,6,7/$\beta$} \end{tikzpicture} \end{tzcode} @@ -383,7 +384,7 @@ To change the position, use the option |<x-shift,y-shift>|, where |<x-shift>| is \tzaxes[dashed]<4,2>(-1,-1)(10,10) \tzticks[draw=red]<4,2> (-5pt:10pt){5,...,8} - (0pt:3cm){3,...,7} + (0pt:3cm) {3,...,7} \end{tikzpicture} \end{tzcode} @@ -404,10 +405,10 @@ The starred version \icmd{\tzticks*} always ignores all tick labels and draws ti \tzticks*(<x-from:x-to>){<x-ticks pos>}(<y-from:y-to>){<y-ticks pos>} % syntax: full \tzticks*[<opt>]<x-shift,y-shift> - (<x-from:x-to>){<x-ticks pos/labels>}(<y-from:y-to>){<y-ticks pos/labels>} + (<x-from:x-to>){<x-ticks pos>}(<y-from:y-to>){<y-ticks pos>} % defaults []<0,0>(0pt:3pt){<m>}(0pt:3pt){} -% starred(*) version always ignores tick labels +% starred(*) version always suppresses tick labels \end{tzdef} \begin{tzcode}{.3} @@ -422,16 +423,20 @@ The starred version \icmd{\tzticks*} always ignores all tick labels and draws ti \end{tikzpicture} \end{tzcode} -\begin{tzcode}{.5} -% \tzticks* +\begin{tzcode}{.4} +% \tzticks(*) \begin{tikzpicture}[scale=.5] \tzhelplines(10,8) \tzaxes(-1,-1)(10,8) -\tzticks*{0,0.2,...,8} - {0,0.2,...,7} % default -\tzticks*(0pt:10pt){1,...,8} - (0pt:10pt){1,...,7} -\tzticks{1,...,8}{2,...,7} +\tzticks* + {0,0.2,...,8} + {0,0.2,...,7} % default (0pt:3pt) +\tzticks* + (0pt:10pt){1,...,8} + (0pt:10pt){1,...,7} +\tzticks + {1,...,8} + {2,...,7} % default (0pt:0pt) \end{tikzpicture} \end{tzcode} @@ -482,7 +487,7 @@ To prints tick marks you need to specify |(<x-from>:<x-to>)|. \begin{tzdef}{} % syntax -\tzticksy*[<opt>]<x-shift>(from:to){<yticks pos>} +\tzticksy*[<opt>]<x-shift>(<from:to>){<yticks pos>} % defaults []<>(0pt:0pt){<m>} % starred(*) version suppresses tick labels @@ -541,14 +546,16 @@ The options |<y-shift>| and |<x-shift>| move x-ticks and y-ticks, respectively. \tzproj*[<opt>]<x-shift,y-shift>(<coor>) {<x-text>}[<node opt>]{<y-text>}[<node opt>](<dot size>) % defaults - *[]<0,0>(<m>){}[text height=1.25ex,text depth=.25ex,below]{}[left](2.4pt) + *[dotted]<0,0>(<m>){}[text height=1.25ex,text depth=.25ex,below]{}[left](2.4pt) \end{tzdef} -\icmd{\tzproj*} additionally prints a black node dot of the size |2.4pt|, by default. +\icmd{\tzproj*} additionally prints a `black node dot' of the size |2.4pt|, by default. +Internally, the node dot is processed by |\tzdot*|. +The first option |<opt>| does not control the node dot. \paragraph{Dot size} -You can only control the size of by |(<dot size>)| or by the \threeways\ on page \pageref{ss:threeways}. -If you want to control |fill| or |color|, use |\tzdot*|. +You can only control the size of dots by the last optional argument |(<dot size>)| or by the \threeways\ on page \pageref{ss:threeways}. +If you want to control |fill| or |color| of dots, use |\tzdot*| separately. \begin{tzcode}{.3} %\tzproj(*) @@ -590,7 +597,7 @@ Specifying the option |<x-shift,y-shift>| moves the projection point and text on \tzproj[dashed,blue](2,3){$x$}{$y$} \tzcoors(30:7)(A)(50:6)(B); \tzaxes[blue]<3,1>(8,6) -\tzproj*[dashed,text=blue]<3,1>(A){$a_1$}{$a_2$} +\tzproj*[dashed,text=blue]<3,1>(A){$a_1$}{$a_2$} %% \end{tikzpicture} \end{tzcode} @@ -599,36 +606,37 @@ Specifying the option |<x-shift,y-shift>| moves the projection point and text on \section{\protect\cmd{\tzprojx(*)} and \protect\cmd{\tzprojy(*)}} \label{s:tzprojx} -\icmd{\tzprojx} draw a dotted line, which is perpendicular to the x axis. +\icmd{\tzprojx} draws a dotted line, which is perpendicular to the x axis. -\icmd{\tzprojx*} additionally prints a black node dot of the size |2.4pt|, by default. +\icmd{\tzprojx*} additionally prints a `black node dot' of the size |2.4pt|, by default. \begin{tzdef}{} % syntax: \tzprojx[<opt>]<x-shift,y-shift>(<coor>){<x-text>}[<node opt>](<dot size>) % defaults - []<0>(<m>){}[text height=1.25ex,text depth=.25ex,below](2.4pt) + []<0,0>(<m>){}[text height=1.25ex,text depth=.25ex,below](2.4pt) \end{tzdef} \icmd{\tzprojy} draws a dotted line, which is perpendicular to the y axis. -\icmd{\tzprojy*} additionally prints a black node dot of the size |2.4pt|, by default. +\icmd{\tzprojy*} additionally prints a `black node dot' of the size |2.4pt|, by default. \begin{tzdef}{} % syntax: \tzprojy[<opt>]<x-shift,y-shift>(<coor>){<y-text>}[<node opt>](<dot size>) % defaults - []<0>(<m>){}[left](2.4pt) + []<0,0>(<m>){}[left](2.4pt) \end{tzdef} -You can only control the size of by |(<dot size>)|. -If you want to control |fill| or |color|, use |\tzdot*|. +You can only control the size of dots by the last option |(<dot size>)|. +If you want to control |fill| or |color| of dots, use |\tzdot*| separately. You can also add text around the projection point on each axis by specifying the option |{<x-text>}| or |{<y-text>}| followed by the option |[<node option>]|. \begin{tzcode}{.3} +% \tzprojx(*), \tzprojy(*) \begin{tikzpicture}[scale=.5,font=\scriptsize] \tzhelplines(-1,-2)(6,6) \tzshoworigin @@ -642,6 +650,7 @@ You can also add text around the projection point on each axis by specifying the Specifying the option |<x-shift,y-shift>| with |\tzprojx(*)| and |\tzprojy(*)| moves the projection point and text accordingly. \begin{tzcode}{.3} +% \tzprojx(*), \tzprojy(*): shift \begin{tikzpicture}[scale=.5,font=\scriptsize] \tzhelplines(-1,-2)(6,6) \tzshoworigin @@ -674,7 +683,7 @@ Specifying the option |<x-shift,y-shift>| with |\tzprojx(*)| and |\tzprojy(*)| m \tzfn{<fn of \x>}[<domain>] % syntax: medium \tzfn{<fn of \x>}[<domain>]{<text>}[<pos>] -% syntax +% syntax: full \tzfn[<opt>]<shift coor>"<path name>" {<fn of \x>}[<domain>]{<text>}[<node opt>]<code.append> % [<domain>] should be of the form [<from num:to num>] @@ -708,7 +717,7 @@ by specifying |{<text>}| and |[<node opt>]| immediately after the domain. \end{tikzpicture} \end{tzcode} -You can also use the predefined functions of \Tikz such as |sin|, |cos|, |ln|, |log10|, |log2|, |exp|, |sqrt|, and so on. (See \Tikz\ manual.) +You can also use the predefined functions of \Tikz\ such as |sin|, |cos|, |ln|, |log10|, |log2|, |exp|, |sqrt|, and so on. (See \Tikz\ manual.) \begin{tzcode}{.3} % \tzfn @@ -725,14 +734,27 @@ You can also use the predefined functions of \Tikz such as |sin|, |cos|, |ln|, | \end{tzcode} \subsection{Name paths: \texttt{name path}} +\label{ss:tzfn:namepath} You can name the path of |\tzfn| by specifying the option |"<path name>"| immediately before the mandatory argument |{<fn of \x>}|. You can use the path name to find intersection points. \begin{tztikz}{} \tzfn"mypath"\Fx[1:5] % works like: - \draw [samples=200,,domain=1:5,name path=mypath] plot (\x,{\Fx}}; + \draw [samples=200,,domain=1:5,name path=mypath] plot (\x,{\Fx}); \end{tztikz} +\remark +Suppose that the function's expression |<fn of \x>| consists \xem{only of a macro name}, say |\Fx|. Then +\begin{itemize} +\item The macro name |Fx| (\xem{without the backslash}) is \xem{automatically assigned} to |<path name>|, unless you give another name. +\item That is, |\tzfn\Fx| is equivalent to |\tzfn"Fx"\Fx|. +(\xem{You don't need to type the same thing twice}.) +\begin{tztikz}{} +\tzfn\Fx[1:5] % works like: + \draw [samples=200,domain=1:5,name path=Fx] plot (\x,{\Fx}); +\end{tztikz} +\end{itemize} + \begin{tzcode}{.3} % \tzfn: name path: intersection point \begin{tikzpicture}[scale=.5] @@ -740,27 +762,17 @@ You can name the path of |\tzfn| by specifying the option |"<path name>"| immedi \tzaxes(8,8) \def\Dx{7-2/3*\x} \def\Sx{1+\x} -\tzfn"Dx"\Dx[0:7]{$D$}[r] -\tzfn"Sx"\Sx[0:7]{$S$}[blue,r] +\tzfn"Dx"\Dx[0:7]{$D$}[r] % name path = Dx +\tzfn \Sx[0:7]{$S$}[blue,r] % name path = Sx \tzXpoint*{Dx}{Sx}(E){E} \end{tikzpicture} \end{tzcode} -\remark -Suppose that the mandatory argument |<fn of \x>| is represented by a macro name only, say |\Fx|. Then -\begin{itemize} -\item The name |Fx| (without the backslash) of the macro can be used as |<path name>|, unless you specify another name. -\item That is, |\tzfn\Fx| is equivalent to |\tzfn"Fx"\Fx|. -(You don't need to type the same thing twice.) -\begin{tztikz}{} -\tzfn\Fx[1:5] % works like: - \draw [samples=200,domain=1:5,name path=Fx] plot (\x,{\Fx}); -\end{tztikz} -\end{itemize} \subsection{Move graphs: \texttt{shift}} -You can move the graph of |\tzfn| by specifying the option |<shift coor>| before the mandatory argument |{<fn of \x>}| or immediately after the option |"<path name">|, if any. +You can move the graph of |\tzfn| by specifying the option |<shift coor>| \xem{before} the mandatory argument |{<fn of \x>}| or \xem{immediately before} the option |"<path name>"|, if it exists. +The empty shift option |<>| is not allowed. \begin{tzcode}{.3} % \tzfn: shift @@ -782,7 +794,7 @@ You can move the graph of |\tzfn| by specifying the option |<shift coor>| before \label{ss:tzfn:atbegin} \paragraph{\texttt{<code.append>}} -You can extend the path created by |\tzfn| from the end of the graph, by writing \Tikz\ code in the \xem{last optional argument} |<code.append>|. Internally it add the \Tikz\ code after the text node |{<text>}| and |[<node opt>]|. +You can extend the path created by |\tzfn| from the end of the graph, by writing \Tikz\ code in the \xem{last optional argument} |<code.append>|. Internally it adds the \Tikz\ code to the path \xem{after} the options |{<text>}| and |[<node opt>]|. \begin{tzcode}{.3} % \tzfn: <code.append> @@ -797,10 +809,10 @@ You can extend the path created by |\tzfn| from the end of the graph, by writing \paragraph{\texttt{\bs tzfnAtEnd}} You can also extend the path with \icmd{\tzfnAtEnd}. -Internally it adds \Tikz\ code immediately before the options |{<text>}| and |[<node opt>]|. But you have to use |\tzfnAtEnd| (immediately) \xem{before each} |\tzfn|. +Internally it adds \Tikz\ code immediately \xem{before} the options |{<text>}| and |[<node opt>]|. But you have to use |\tzfnAtEnd| (immediately) \xem{before each} |\tzfn|. \begin{tzcode}{.3} -% \tzfnAtEnd +% \tzfnAtEnd (before \tzfn) \begin{tikzpicture}[scale=.5] \tzhelplines(-2,-2)(8,6) \tzaxes*(-2,-2)(8,6) @@ -816,7 +828,7 @@ Internally it adds \Tikz\ code immediately before the options |{<text>}| and |[< You can use \icmd{\tzfnAtBegin} (immediately) \xem{before each} |\tzfn| to insert \Tikz\ code before the path of |\tzfn|. \begin{tzcode}{.3} -% \tzfnAtBegin +% \tzfnAtBegin (before \tzfn) \begin{tikzpicture}[scale=.5] \tzhelplines(-2,-2)(8,6) \tzaxes*(-2,-2)(8,6) @@ -837,10 +849,10 @@ You can use \icmd{\tzfnAtBegin} (immediately) \xem{before each} |\tzfn| to inser \begin{itemize} \item When you know two coordinates on a line, -|\tzLfn(<coor1>)(<coor2>)| draws the line. +|\tzLFn(<coor1>)(<coor2>)| draws the line. \item When you know one coordinate and the slope of a line, -|\tzLfn(<coor1>){<slope>}| draws the line. +|\tzLFn(<coor1>){<slope>}| draws the line. \item If you specify all the three arguments |(<coor1>)(<coor2>){<slope>}|, then the slope is ignored. \end{itemize} @@ -853,14 +865,14 @@ If you specify all the three arguments |(<coor1>)(<coor2>){<slope>}|, then the s []<>""(<m>)(){1}[<m>]{}[]<> \end{tzdef} -|\tzLFn| accepts two mandatory arguments: |(<coor1>)| and |<domain>|. +|\tzLFn| accepts two mandatory arguments: |(<coor1>)| and |[<domain>]|. \begin{itemize} \item The domain should be of the form |[<from num:to num>]|. \item If just one coordinate is specified without a slope, the slope is regarded as |1|, by default. \end{itemize} For example, |\tzLFn(1,1)(2,3)[0:4]| draws a line passing through two points: $(1,1)$ and $(2,3)$, over $0\leq x\leq 4$. -|\tzdefLFn\Gx(1,1){.5}[0:4]| draws a line passing through a point $(1,1)$ with the slope |.5|, over $0\leq x\leq 4$. +|\tzLFn(1,1){.5}[0:4]| draws a line passing through a point $(1,1)$ with the slope |.5|, over $0\leq x\leq 4$. You can add text at the end of the line of |\tzLFn| by the options |{<text>}| and |[<node opt>]|. You can also name the path of |\tzLFn| by specifying the option |"<path name>"| immediately before the mandatory coordinate. @@ -875,7 +887,7 @@ You can add text at the end of the line of |\tzLFn| by the options |{<text>}| an \end{tikzpicture} \end{tzcode} -You can move the line by specifying the option |<shift coor>| immediately before |"<path name">|. +You can move the line of |\tzLFn| by specifying the option |<shift coor>| immediately before the option |"<path name>"|. (The empty shift option |<>| is not allowed.) You can also expand the path of |\tzLFn| by writing \Tikz\ code in the last optional argument |<code.append>|. \begin{tzcode}{.3} @@ -894,7 +906,7 @@ You can also expand the path of |\tzLFn| by writing \Tikz\ code in the last opti \section{Horizontal lines} \label{s:tzhfn} -\subsection{\protect\cmd{\tzvfnat}} +\subsection{\protect\cmd{\tzhfnat}} \label{ss:tzhfnat} \icmd{\tzhfnat} draws a horizontal line at a specified value of $y$. @@ -904,16 +916,17 @@ You can also expand the path of |\tzLFn| by writing \Tikz\ code in the last opti % syntax: minimal \tzhfnat{<y-val>}[<domain>] % syntax: full - \tzhfnat[<opt>]<shift coor>"<path name>"{<y-val>}[<domain>]{<text>}[<pos>]<code.append> +\tzhfnat[<opt>]<shift coor>"<path name>" + {<y-val>}[<domain>]{<text>}[<node opt>]<code.append> % defaults - []<>""{<m>}[left:right (of current bonding box)]{}[]<> + []<>""{<m>}[west:east (of current bounding box)]{}[]<> \end{tzdef} |\tzhfnat| accepts only one mandatory argument |{<y-val>}|. The domain is optional and should be of the form |[<from num:to num>]|. The default domain is from left to right of the \ixxw{current bounding box}. -\remark Internally, the default domain of |\tzhfn| depends on \ixxw{current bounding box}. +\remark Internally, the default domain of |\tzhfnat| depends on the \ixxw{current bounding box}. \begin{itemize} \item Each |\tzhfnat| may draw a line with a (slightly) different length. \item If an appropriate |current bounding box| is not formed before |\tzhfnat| is executed, you will probably get an unexpected result. @@ -937,9 +950,9 @@ You can move the line by the option |<shift coor>|. You can also expand the path from the end of the line by writing \Tikz\ code in the last optional argument |<code.append>|. \begin{tzcode}{.3} -% \tzhfnat: shift +% \tzhfnat: shift, <code.append> \begin{tikzpicture} -\tzhelplines*(4,4) % bonding box +\tzhelplines*(4,4) % bounding box \tzfn"XX"{\x}[0:4] \tzhfnat[blue,thick]{0} \tzhfnat[red,thick]<-.5,.5>"AA"{1}[1:3]{line A'}[r] @@ -963,15 +976,16 @@ For example, |\tzhfn(<x>,3)|, ignoring |<x>|, is equivalent to |\tzhfnat{3}|. % syntax: minimal \tzhfn(<coor>)[<domain>] % syntax: full - \tzhfn[<opt>]<shift coor>"<path name>"(<coor>)[<domain>]{<text>}[<pos>]<code.append> + \tzhfn[<opt>]<shift coor>"<path name>" + (<coor>)[<domain>]{<text>}[<node opt>]<code.append> % defaults - []<>""{<m>}[left to right of current bonding box]{}[]<> + []<>""(<m>)[west:east (of current bounding box)]{}[]<> \end{tzdef} \begin{tzcode}{.3} -% \tzhfn: shift +% \tzhfn: shift, <code.append> \begin{tikzpicture} -\tzhelplines*(4,4) % bonding box +\tzhelplines*(4,4) % bounding box \tzcoors(0,1)(A)(0,2)(B); \tzfn"XX"{\x}[0:4] \tzhfn[blue,thick](5,0) % x=5 ignored @@ -984,9 +998,6 @@ For example, |\tzhfn(<x>,3)|, ignoring |<x>|, is equivalent to |\tzhfnat{3}|. - - - %%------------------------------------------------------------ \section{Vertical lines} \label{s:tzvfn} @@ -1001,9 +1012,10 @@ For example, |\tzhfn(<x>,3)|, ignoring |<x>|, is equivalent to |\tzhfnat{3}|. % syntax: minimal \tzvfnat{<x-val>}[<domain>] % syntax: full - \tzvfnat[<opt>]<shift coor>"<path name>"{<x-val>}[<domain>]{<text>}[<pos>]<code.append> +\tzvfnat[<opt>]<shift coor>"<path name>" + {<x-val>}[<domain>]{<text>}[<node opt>]<code.append> % defaults - []<>""{<m>}[bottom:top (of current bonding box)]{}[]<> + []<>""{<m>}[south:north (of current bounding box)]{}[]<> \end{tzdef} |\tzvfnat| accepts only one mandatory argument |{<x-val>}|. @@ -1027,9 +1039,9 @@ You can move the line by the option |<shift coor>|. You can also expand the path from the end of the line by writing \Tikz\ code in the last optional argument |<code.append>|. \begin{tzcode}{.3} -% \tzvfnat: shift +% \tzvfnat: shift, <code.append> \begin{tikzpicture} -\tzhelplines*(4,4) % bonding box +\tzhelplines*(4,4) % bounding box \tzfn"XX"{\x}[0:4] \tzvfnat[blue,thick]{0} \tzvfnat[red,thick]<.5,-.5>"AA"{1}[1:3]{line A'}[a] @@ -1039,6 +1051,7 @@ You can also expand the path from the end of the line by writing \Tikz\ code in \end{tikzpicture} \end{tzcode} +In the previous example, |\tzhelplines*| is used to fix a bounding box. (See Section \ref{s:tzhelplines} on page \pageref{s:tzhelplines}, for more details.) \subsection{\protect\cmd{\tzvfn}} @@ -1053,15 +1066,16 @@ For example, |\tzvfn(3,<y>)|, ignoring |<y>|, is equivalent to |\tzvfnat{3}|. % syntax: minimal \tzvfn(<coor>)[<domain>] % syntax: full -\tzvfn[<opt>]<shift coor>"<path name>"(<coor>)[<domain>]{<text>}[<pos>]<code.append> +\tzvfn[<opt>]<shift coor>"<path name>" + (<coor>)[<domain>]{<text>}[<node opt>]<code.append> % defaults - []<>""{<m>}[bottom:top (of current bonding box)]{}[]<> + []<>""(<m>)[south:north (of current bounding box)]{}[]<> \end{tzdef} \begin{tzcode}{.3} -% \tzvfn: shift +% \tzvfn: shift, <code.append> \begin{tikzpicture} -\tzhelplines*(4,4) % bonding box +\tzhelplines*(4,4) % bounding box \tzcoors(1,0)(A)(2,0)(B); \tzfn"XX"{\x}[0:4] \tzvfn[blue,thick](0,5) % y=5 ignored @@ -1084,7 +1098,7 @@ For example, |\tzvfn(3,<y>)|, ignoring |<y>|, is equivalent to |\tzvfnat{3}|. \section{\protect\cmd{\tzXpoint(*)}: Intersection points} \label{s:intersections} -\icmd{\tzXpoint} finds intersection points of two paths and save them as coordinate names for later use. +\icmd{\tzXpoint} finds intersection points of two paths and saves them as coordinate names for later use. \begin{tzdef}{} % syntax: minimal @@ -1092,15 +1106,15 @@ For example, |\tzvfn(3,<y>)|, ignoring |<y>|, is equivalent to |\tzvfnat{3}|. % syntax: medium \tzXpoint{<path>}{<path>}(<coor name>){<label>}[<angle>] % syntax: full -\tzXpoint[<opt>]{<path>}{<path>}(<coor name>)[<nth>]{<label>}[<[<label opt>]angle>] +\tzXpoint[<opt>]{<path>}{<path>}(<coor name>)[<nth>]{<label>}[<[label opt]angle>] % defaults - []{<m>}{<m>}()[1]{}[] + []{<m>}{<m>}(intersection)[1]{}[] \end{tzdef} -For example, |\tzXpoint{path1}{path2}(A)| determines an intersection of the two paths and names the point |(A)| or |(A-1)|. (By default the name is |(intersection)| as in \Tikz.) +For example, |\tzXpoint{path1}{path2}(A)| determines an intersection of the two paths and names the point |(A)| or |(A-1)|. (By default, the name is |(intersection)| as in \Tikz.) If there are two or more intersection points, they are named as follows: |(A)=(A-1)|, |(A-2)|, |(A-3)|, etc. -You can determine which intersection point is named by specifying the option |[<nth>]|. If you select the second intersection point to be named |(A)| out of multiple intersections, they are named as follows: |(A-1)|, |(A)=(A-2)|, |(A-3)|, |(A4)|, etc. +You can determine which intersection point is named directly by specifying the option |[<nth>]|. If you select the second intersection point to be named |(A)| out of multiple intersections, they are named as follows: |(A-1)|, |(A)=(A-2)|, |(A-3)|, |(A-4)|, etc. You can label intersection points by specifying the option |{<label>}| and |[<angle>]|. @@ -1127,13 +1141,12 @@ The default dot size is |2.4pt| and it can be changed by the last option |(<dot \tzXpoint*{<path>}{<path>}(<coor name>){<label>}[<angle>] % syntax: \tzXpoint*[<opt>]{<path>}{<path>} - (<coor name>)[<nth>]{<label>}[<[<label opt>]angle>](<dotsize>) + (<coor name>)[<nth>]{<label>}[<[label opt]angle>](<dot size>) % defaults - [tzdot=2.4pt]{<m>}{<m>}()[1]{}[](2.4pt) + [tzdot=2.4pt]{<m>}{<m>}(intersection)[1]{}[](2.4pt) \end{tzdef} - \begin{tzcode}{.3} % \tzXpoint* \begin{tikzpicture}[scale=.5] @@ -1153,8 +1166,6 @@ The default dot size is |2.4pt| and it can be changed by the last option |(<dot \end{tzcode} - - %%------------------------------------------------------------ \section{Vertical intersection points} \label{s:tzvXpointat} @@ -1166,8 +1177,8 @@ The default dot size is |2.4pt| and it can be changed by the last option |(<dot So it takes |{<path>}| and |{<x-val>}| as mandatory arguments. \remark -Internally, |\tzvXpointat| depends on |current bounding box|, which generally does not cause a problem because it is used after paths to be intersected is drawn. -In case of any problem of no intersection point, you can use |\tzbbox| or |\tzaxes*| or \Tikz's |\useasboundingbox| to fix a bounding box. +Internally, |\tzvXpointat| depends on the |current bounding box|, which generally does not cause a problem because it is used after paths to be intersected are formed. +In case of any problem of no intersection point, you may want to fix a bounding box using |\tzbbox| or |\tzaxes*| or \Tikz's |\useasboundingbox|. \begin{tzdef}{} % syntax: minimal @@ -1175,14 +1186,12 @@ In case of any problem of no intersection point, you can use |\tzbbox| or |\tzax % syntax: medium \tzvXpointat{<path>}{<x-val>}(<coor name>){<label>}[<angle>] % syntax: full -\tzvXpointat[<opt>]{<path>}{<x-val>}(<coor name>)[<n>]{<label>}[<[<opt>]angle>] +\tzvXpointat[<opt>]{<path>}{<x-val>}(<coor name>)[<n>] + {<label>}[<[label opt]angle>] % defaults - []{<m>}{<m>}()[1]{}[] + []{<m>}{<m>}(intersection)[1]{}[] \end{tzdef} -\xem{Everything else is the same as in} |\tzXpointat|. - - The starred version \icmd{\tzvXpointat*} additionally prints a node dot of the size |2.4pt|, by default, at the (first) intersection point. \begin{tzdef}{} @@ -1191,10 +1200,10 @@ The starred version \icmd{\tzvXpointat*} additionally prints a node dot of the s % syntax: medium \tzvXpointat*{<path>}{<x-val>}(<coor name>){<label>}[<angle>] % syntax: full -\tzvXpointat*[<opt>]{<path>}{<x-val>} - (<coor name>)[<n>]{<label>}[<[<opt>]angle>](<dot size>) +\tzvXpointat*[<opt>]{<path>}{<x-val>}(<coor name>)[<n>] + {<label>}[<[label opt]angle>](<dot size>) % defaults - [tzdot=2.4pt]{<m>}{<m>}()[1]{}[](2.4pt) + [tzdot=2.4pt]{<m>}{<m>}(intersection)[1]{}[](2.4pt) \end{tzdef} \begin{tzcode}{.3} @@ -1210,6 +1219,7 @@ The starred version \icmd{\tzvXpointat*} additionally prints a node dot of the s \end{tikzpicture} \end{tzcode} + %%------------------------------------------------------------ \subsection{\protect\cmd{\tzvXpoint(*)}} \label{ss:tzvXpoint} @@ -1221,19 +1231,20 @@ For example, |\tzvXpoint{mypath}(3,<y>)|, ignoring |<y>|, is equivalent to |\tzv \begin{tzdef}{} % syntax -\tzvXpoint[<opt>]{<path>}{<coor>}(<coor name>)[<n>]{<label>}[<[<opt>]angle>] +\tzvXpoint[<opt>]{<path>}(<coor>)(<coor name>)[<n>] + {<label>}[<[label opt]angle>] % defaults - []{<m>}(<m>)[1]{}[]() + []{<m>}(<m>)(intersection)[1]{}[] \end{tzdef} The starred version \icmd{\tzvXpoint*} just adds a node dot to |\tzvXpoint|. \begin{tzdef}{} % syntax -\tzvXpoint*[<opt>]{<path>}(<coor>) - (<coor name>)[<n>]{<label>}[<[<opt>]angle>](<dot size>) +\tzvXpoint*[<opt>]{<path>}(<coor>)(<coor name>)[<n>] + {<label>}[<[<opt>]angle>](<dot size>) % defaults - [tzdot=2.4pt]{<m>}(<m>)()[1]{}[](2.4pt) + [tzdot=2.4pt]{<m>}(<m>)(intersection)[1]{}[](2.4pt) \end{tzdef} |\tzvXpoint*| prints, at the first intersection point, a node dot of the size 2.4pt by default. @@ -1254,11 +1265,6 @@ The starred version \icmd{\tzvXpoint*} just adds a node dot to |\tzvXpoint|. - - - - - %%------------------------------------------------------------ \section{Horizontal intersection points} \label{s:tzhXpointat} @@ -1266,7 +1272,7 @@ The starred version \icmd{\tzvXpoint*} just adds a node dot to |\tzvXpoint|. \subsection{\protect\cmd{\tzhXpointat(*)}} \label{ss:tzhXpointat} -\icmd{\tzhXpointat} determines vertical intersection points of a path at a specified value of $y$. +\icmd{\tzhXpointat} determines horizontal intersection points of a path at a specified value of $y$. So it takes |{<path>}| and |{<y-val>}| as mandatory arguments. \begin{tzdef}{} @@ -1275,15 +1281,13 @@ So it takes |{<path>}| and |{<y-val>}| as mandatory arguments. % syntax: medium \tzhXpointat{<path>}{<y-val>}(<coor name>){<label>}[<angle>] % syntax: full -\tzhXpointat[<opt>]{<path>}{<y-val>}(<coor name>)[<n>]{<label>}[<[<opt>]angle>] +\tzhXpointat[<opt>]{<path>}{<y-val>}(<coor name>)[<n>]{<label>}[<[label opt]angle>] % defaults - []{<m>}{<m>}()[1]{}[] + []{<m>}{<m>}(intersection)[1]{}[] \end{tzdef} -\xem{Everything else is the same as in} |\tzXpoint|. - -The starred version \icmd{\tzhXpoint*} additionally prints a node dot of the size 2.4pt by default at the intersection point. +The starred version \icmd{\tzhXpointat*} additionally prints a node dot of the size 2.4pt, by default, at the intersection point. \begin{tzdef}{} % syntax: minimum @@ -1291,10 +1295,10 @@ The starred version \icmd{\tzhXpoint*} additionally prints a node dot of the siz % syntax: medium \tzhXpointat*{<path>}{<y-val>}(<coor name>){<label>}[<angle>] % syntax: full -\tzhXpointat*[<opt>]{<path>}{<y-val>} - (<coor name>)[<n>]{<label>}[<[<opt>]angle>](<dot size>) +\tzhXpointat*[<opt>]{<path>}{<y-val>}(<coor name>)[<n>] + {<label>}[<[label opt]angle>](<dot size>) % defaults - [tzdot=2.4pt]{<m>}{<m>}()[1]{}[](2.4pt) + [tzdot=2.4pt]{<m>}{<m>}(intersection)[1]{}[](2.4pt) \end{tzdef} \begin{tzcode}{.3} @@ -1315,29 +1319,29 @@ The starred version \icmd{\tzhXpoint*} additionally prints a node dot of the siz \subsection{\protect\cmd{\tzhXpoint(*)}} \label{ss:tzhXpoint} -\icmd{\tzhXpoint} accepts |{<path>}| and |(<coor>)| as mandatory arguments to find vertical intersection points of a path at the $y$ value of the coordinate, ignoring the $x$ value. +\icmd{\tzhXpoint} accepts |{<path>}| and |(<coor>)| as mandatory arguments to find horizontal intersection points of a path at the $y$ value of the coordinate, ignoring the $x$ value. For example, |\tzhXpoint{mypath}(<x>,3)|, ignoring |<x>|, is equivalent to |\tzhXpointat{mypath}{3}|. \xem{Everything else is the same as in} |\tzhXpointat|. \begin{tzdef}{} % syntax -\tzhXpointat[<opt>]{<path>}{<y-val>}(<coor name>)[<n>]{<label>}[<[<opt>]angle>] +\tzhXpoint[<opt>]{<path>}(<coor>)(<coor name>)[<n>]{<label>}[<[label opt]angle>] % defaults - []{<m>}{<m>}()[1]{}[]() + []{<m>}(<m>)(intersection)[1]{}[] \end{tzdef} The starred version \icmd{\tzhXpoint*} just adds a node dot to |\tzhXpoint|. \begin{tzdef}{} % syntax -\tzhXpoint*[<opt>]{<path>}(<coor>) - (<coor name>)[<n>]{<label>}[<[<opt>]angle>](<dot size>) +\tzhXpoint*[<opt>]{<path>}(<coor>)(<coor name>)[<n>] + {<label>}[<[label opt]angle>](<dot size>) % defaults - [tzdot=2.4pt]{<m>}(<m>)()[1]{}[](2.4pt) + [tzdot=2.4pt]{<m>}(<m>)(intersection)[1]{}[](2.4pt) \end{tzdef} -|\tzhXpoint*| prints, at the first intersection point, a node dot of the size |2.4pt|, by default. +|\tzhXpoint*| prints, at the (first) intersection point, a node dot of the size |2.4pt|, by default. \begin{tzcode}{.3} % \tzhXpoint(*) @@ -1356,8 +1360,6 @@ The starred version \icmd{\tzhXpoint*} just adds a node dot to |\tzhXpoint|. - - %%================================== \chapter{Secant and Tangent Lines} \label{c:tangent} @@ -1369,7 +1371,7 @@ The starred version \icmd{\tzhXpoint*} just adds a node dot to |\tzhXpoint|. \subsection{\protect\cmd{\tzsecantat}} \label{ss:tzsecantat} -\icmd{\tzsecantat} draws a chord or a secant line of a curve, on the |behind| layer by default. +\icmd{\tzsecantat} draws a line segment or a secant line of a curve, on the |behind| layer by default. You need to specify a path name and two values of $x$. With \icmd{\settzsecantlayer}, you can change the layer, like |\settzsecantlayer{main}|. @@ -1387,7 +1389,7 @@ With \icmd{\settzsecantlayer}, you can change the layer, like |\settzsecantlayer \paragraph{Domain} The domain should be of the form |[<from num:to num>]|. -Without specifying the optional domain, |\tzsecantat| draws a chord. +Without specifying the optional domain, |\tzsecantat| draws a line segment connecting two points on the (curved) path. \begin{tzcode}{.3} % \tzsecantat @@ -1431,10 +1433,10 @@ You can move |\tzsecantat| by specifying the option |<shift coor>|. \end{tzcode} \paragraph{Naming paths} -By specifying the option |"<path name">| you can name a path of |\tzsecantat|. +By specifying the option |"<path name>"| you can name a path of |\tzsecantat|. \begin{tzcode}{.3} -% \tzsecantat: shift +% \tzsecantat: shift, name path (intersection) \begin{tikzpicture}[scale=.5] \tzhelplines(8,6) \tzaxes(-1,-1)(8,6){$x$}{$y$} @@ -1468,7 +1470,7 @@ You can extend the path of |\tzsecantat| by writing \Tikz\ code in the last opti \subsection{\protect\cmd{\tzsecant}} \label{ss:tzsecant} -\icmd{\tzsecant} uses two \xem{coordinates instead of two values} to draw a chord or a secant line of a curve, on the |behind| layer by default. +\icmd{\tzsecant} uses two \xem{coordinates instead of two values of $x$} to draw a line segment or a secant line of a curve, on the |behind| layer by default. You need to specify a path name and two coordinates, then |\tzsecant| uses the $x$ values of the two coordinates. \xem{Everything else is the same as in} |\tzsecantat|. @@ -1484,11 +1486,11 @@ You can change the layer with \icmd{\settzsecantlayer}. \tzsecant[<opt>]<shift coor>"path name" {<path>}(<coor>)(<coor>)[<domain>]{<text>}[<node opt>]<code.append> % defaults - []<>""{<m>}{<m>}{<m>}[]{}[]<> + []<>""{<m>}(<m>)(<m>)[]{}[]<> \end{tzdef} The domain should be of the form |[<from num:to num>]|. -Without specifying the optional domain, |\tzsecant| draws a chord. +Without specifying the optional domain, |\tzsecant| draws a line segment connecting two points on the (curved) path. \begin{tzcode}{.3} % \tzsecant: domain @@ -1506,7 +1508,7 @@ Without specifying the optional domain, |\tzsecant| draws a chord. You can move the secant line and extend the path. \begin{tzcode}{.3} -% \tzsecantat: <code.append> +% \tzsecant: shift, <code.append> \begin{tikzpicture}[scale=.5] \tzhelplines(8,6) \tzaxes(-1,-1)(8,6){$x$}{$y$} @@ -1531,6 +1533,10 @@ You can move the secant line and extend the path. \icmd{\tztangentat} draws a tangent line to a curve at a specified value of $x$. By default, the tangent line is drawn on the |behind| layer, which can be changed by \icmd{\settztangentlayer}, like |\settztangentlayer{main}|. +\remark +To calculate the slope at $x$, $x$ varies over the interval $(x-\varepsilon_1,x+\varepsilon_2)$ and $\varepsilon_1=\varepsilon_2=0.01$, by default. +So the slope of tangent line is only \xem{approximate}. + \begin{tzdef}{} % syntax: minimum \tztangentat{<path>}{<x-val>}[<domain>] @@ -1538,14 +1544,13 @@ By default, the tangent line is drawn on the |behind| layer, which can be change \tztangentat{<path>}{<x-val>}[<domain>]{<text>}[<node opt>] % syntax: full \tztangentat[<opt>]<shift coor>"<path name>" - {<path>}{<x-val>}(<epsilon1>,<epsilon2>) - [<domain>]{<text>}[<node opt>]<code.append> + {<path>}{<x-val>}(<epsilon1>,<epsilon2>)[<domain>] + {<text>}[<node opt>]<code.append> +% The domain should be of the form [<from:to>] % defaults - []""<>{<m>}{<m>}(.01,.01)[<m>]{}[]<> + []<>""{<m>}{<m>}(.01,.01)[<m>]{}[]<> \end{tzdef} -To calculate the slope at $x$, $x$ varies over the interval $(x-\varepsilon_1,x+\varepsilon_2)$ and $\varepsilon_1=\varepsilon_2=0.01$ by default. -So the slope of tangent line is only \xem{approximate}. \paragraph{Domain} |\tztangentat| takes three mandatory arguments: |{<path>}|, |{<x-val>}|, and |[<domain>]|. The mandatory argument |[<domain>]| should be of the form |[<from num:to num>]|. @@ -1582,10 +1587,10 @@ You can move the tangent line by specifying the option |<shift coor>|. \end{tzcode} \paragraph{Naming paths} -By specifying the option |"<path name">|, you can name the path of |\tztangentat|. +By specifying the option |"<path name>"|, you can name the path of |\tztangentat|. \begin{tzcode}{.3} -% \tztangentat: name path +% \tztangentat: name path (intersection) \begin{tikzpicture}[scale=.5,font=\footnotesize] \tzhelplines(9,8) \tzaxes(9,8) @@ -1623,8 +1628,8 @@ You can extend the path of |\tztangentat| by writing \Tikz\ code in the last opt \paragraph{Variations} The slope of the tangent line is approximate, so sometimes you may want to change the variation interval to get better results. -You can change $\varepsilon_1$ and $\varepsilon_2$ by specifying the option |(epsilon1,epsilon2)| immediately after the mandatory argument |<x-val>|. -Or you can change the variations with the macro \icmd{\settztangentepsilon}, +You can change $\varepsilon_1$ and $\varepsilon_2$ by specifying the option |(<epsilon1,epsilon2>)| immediately after the mandatory argument |{<x-val>}|. +Or you can change the variations by the macro \icmd{\settztangentepsilon}, like |\settztangentepsilon{|$\varepsilon_1$|}{|$\varepsilon_2$|}|. The effect remains until the end of |tikzpicture| environment unless changed again. \begin{tzcode}{.3} @@ -1634,9 +1639,9 @@ like |\settztangentepsilon{|$\varepsilon_1$|}{|$\varepsilon_2$|}|. The effect re \tzaxes(9,8) \tzplotcurve"AA"(1,7)(3,3)(8,1); \tztangentat[blue!50,dashed]{AA}{4}[1:7] -\settztangentepsilon{0.005}{0.01} +\settztangentepsilon{0.005}{0.01} %% \tztangentat[blue]{AA}{4}[1:7]{corrected}[r] -\tztangentat[red]<0,1>{AA}{4}[1:7]{shifted}[r] +\tztangentat[red]<0,1>{AA}{4}[1:7]{shifted}[r] %% \end{tikzpicture} \end{tzcode} @@ -1648,7 +1653,7 @@ like |\settztangentepsilon{|$\varepsilon_1$|}{|$\varepsilon_2$|}|. The effect re \icmd{\tztangent} uses a \xem{coordinate instead of a value} of $x$ to draw a tangent line. -For example, |\tztangent{curve}(4,0)| is equivalent to |\tztangentat{curve}{4}|. +For example, |\tztangent{curve}(4,<y>)| is equivalent to |\tztangentat{curve}{4}| for any |<y>|. \xem{Everything else is the same as in} |\tztangentat|. @@ -1659,13 +1664,15 @@ For example, |\tztangent{curve}(4,0)| is equivalent to |\tztangentat{curve}{4}|. \tztangent{<path>}(<coor>)[<domain>]{<text>}[<node opt>] % syntax: full \tztangent[<opt>]<shift coor>"<path name>" - {<path>}(<coor>)(<epsilon1>,<epsilon2>) - [<domain>]{<text>}[<node opt>]<code.append> + {<path>}(<coor>)(<epsilon1>,<epsilon2>)[<domain>] + {<text>}[<node opt>]<code.append> +% The domain should be of the form [<from:to>] % defaults - []""<>{<m>}(<m>)(.01,.01)[<m>]{}[]<> + []<>""{<m>}(<m>)(.01,.01)[<m>]{}[]<> \end{tzdef} +|\tztangent| accepts three mandatory arguments: |{<path>}|, |(<coor>)|, and |<domain>|. \begin{tzcode}{.3} % \tztangent @@ -1681,6 +1688,7 @@ For example, |\tztangent{curve}(4,0)| is equivalent to |\tztangentat{curve}{4}|. \end{tikzpicture} \end{tzcode} +You can shift the tangent line and extend its path. \begin{tzcode}{.3} % \tztangent: shift, <code.append> @@ -1699,6 +1707,8 @@ For example, |\tztangent{curve}(4,0)| is equivalent to |\tztangentat{curve}{4}|. \end{tikzpicture} \end{tzcode} +You can control the interval of variations of $x$ by the option |(<epsilon1,epsion2>)| or the marcro |\settztangentepsilon|. + \begin{tzcode}{.3} % \tztangent: variations, shift \begin{tikzpicture}[scale=.5,font=\footnotesize] @@ -1706,9 +1716,9 @@ For example, |\tztangent{curve}(4,0)| is equivalent to |\tztangentat{curve}{4}|. \tzaxes(9,8) \tzplotcurve"AA"(1,7)(3,3)(8,1); \tztangent[blue!50,dashed]{AA}(4,0)[1:7] -\settztangentepsilon{0.005}{0.01} +\settztangentepsilon{0.005}{0.01} %% \tztangent[blue]{AA}(4,0)[1:7]{corrected}[r] -\tztangent[red]<0,1>{AA}(4,0)[1:7]{shifted}[r] +\tztangent[red]<0,1>{AA}(4,0)[1:7]{shifted}[r] %% \end{tikzpicture} \end{tzcode} @@ -1721,7 +1731,7 @@ For example, |\tztangent{curve}(4,0)| is equivalent to |\tztangentat{curve}{4}|. \section{\protect\cmd{\tzbrace(')}} \label{s:tzbrace} -\icmd{\tzbrace} takes two coordinates as mandatory arguments to draw a calligraphic brace connecting them. +\icmd{\tzbrace} takes two coordinates as mandatory arguments to draw a \xem{calligraphic brace} connecting them. \begin{tzdef}{} % syntax: minimum @@ -1735,17 +1745,19 @@ For example, |\tztangent{curve}(4,0)| is equivalent to |\tztangentat{curve}{4}|. []{5pt}[amplitude=5pt]<>(<m>)(<m>){}[] \end{tzdef} -The amplitude of a brace is |5pt| by default. The |raise| value of a brace is |5pt| by default and the value can be changed by the first curly brace optional argument |{<raise>}|. +The |amplitude| of a brace is |5pt| by default. You can control the amplitude by writing the option |amplitude=<dim>| in the second bracket option |[<decoration opt>]|. + \begin{tztikz}{} \tzbrace[thick](0,0)(3,1) % works like: \draw [thick,decorate,decoration={calligraphic brace, amplitude=5pt, raise=5pt}] (0,0) to (3,1); \end{tztikz} -The swap version \icmd{\tzbrace'} swaps the coordinates. +The \iisw{wap version} \icmd{\tzbrace'} swaps the coordinates. So it prints a mirror image of |\tzbrace|. +For example, |\tzbrace'(0,0)(3,1)| is equivalent to |\tzbrace(3,1)(0,0)|. \begin{tzcode}{.3} % \tzbrace(') @@ -1766,14 +1778,17 @@ The color of the calligraphic brace can be changed by the option |pen colour| in \begin{tikzpicture}[sloped] \tzhelplines(4,3) \tzline(0,0)(3,1) -\tzbrace [very thick,pen colour=blue][amplitude=10pt] +\tzbrace [very thick,pen colour=blue] + [amplitude=10pt] (0,0)(3,1){AAA}[a=15pt] -\tzbrace'[red,very thick]{10pt}[brace,amplitude=10pt] +\tzbrace'[red,very thick]{10pt} + [brace,amplitude=10pt] (0,0)(3,1){BBB}[b=20pt] \end{tikzpicture} \end{tzcode} You can also move a brace by specifying the option |<shift coor>| immediately before the the first mandatory coordinate. +The empty shift option |<>| is not allowed. \begin{tzcode}{.3} % \tzbrace('): shift diff --git a/graphics/pgf/contrib/tzplot/tzplot-doc.pdf b/graphics/pgf/contrib/tzplot/tzplot-doc.pdf Binary files differindex 0e4633ea06..1c1b26fa8d 100644 --- a/graphics/pgf/contrib/tzplot/tzplot-doc.pdf +++ b/graphics/pgf/contrib/tzplot/tzplot-doc.pdf diff --git a/graphics/pgf/contrib/tzplot/tzplot-doc.tex b/graphics/pgf/contrib/tzplot/tzplot-doc.tex index ea53095183..7c2394ee7a 100644 --- a/graphics/pgf/contrib/tzplot/tzplot-doc.tex +++ b/graphics/pgf/contrib/tzplot/tzplot-doc.tex @@ -5,9 +5,9 @@ % arara: xelatex: {shell: yes, synctex: yes} % arara: xelatex: {shell: yes, synctex: yes} -%% 2021/02/28 v1.0 -\def\tmpdate{2021/02/28} -\def\tmpversion{1.0} +%% 2021/03/20 v1.0.1 +\def\tmpdate{2021/03/20} +\def\tmpversion{1.0.1} %------------------------------------------------------ \def\myincludeonly{% @@ -262,7 +262,13 @@ projection, ticks, intersections, tangent lines \addcontentsline{toc}{chapter}{Version history} \begin{itemize} -\item v\tmpversion (\tmpdate) upload to CTAN +\item v\tmpversion (\tmpdate) + \begin{itemize} + \item revised the document with typo corrections + \item added the option |<code.append>| to |\tzframe|, |\tzcircle|, and |\tzellipse| + \item added aliases: |\let\tzrectangle\tzframe| and |\let\tzoval\tzellipse| + \end{itemize} +\item v1.0 (2021/02/28) uploaded to CTAN \item v0.999a (2021/02/27) \begin{itemize} \item writing document @@ -353,7 +359,7 @@ projection, ticks, intersections, tangent lines \chapter*{Acknowledgement} \addcontentsline{toc}{chapter}{Acknowledgement} -I am grateful to Kangsoo Kim of KTUG (Korean TeX Users Group) who wrote many packages including |oblivoir.cls| for helping to implement the idea of the semicolon version with |expl3|. +I am grateful to Kangsoo Kim of KTUG (Korean TeX Users Group) who has written many packages including |oblivoir.cls| for helping to implement the idea of the semicolon version with |expl3|. \chapter*{References} \addcontentsline{toc}{chapter}{Reference} diff --git a/graphics/pgf/contrib/tzplot/tzplot.sty b/graphics/pgf/contrib/tzplot/tzplot.sty index 593659b03f..c5a1413a14 100644 --- a/graphics/pgf/contrib/tzplot/tzplot.sty +++ b/graphics/pgf/contrib/tzplot/tzplot.sty @@ -11,7 +11,7 @@ %% http://www.latex-project.org/lppl.txt. %% %% ------------------------------------------------- -\ProvidesPackage{tzplot-v1.0}[2021/02/28 v1.0 Plot Graphs with TikZ Abbreviations] +\ProvidesPackage{tzplot-v1.0.1}[2021/03/20 v1.0.1 Plot Graphs with TikZ Abbreviations] % expl3,xparse: LPPL % tikz: LPPL and/or GNU GPL @@ -1488,7 +1488,7 @@ calligraphy, % for calligraphic brace (load after decorations.pathreplacing) \IfValueT { #3 } { \renewcommand\tzpathstyle{ #3 } } - \IfBooleanTF { #1 } % (*) or not (NOT USED!) + \IfBooleanTF { #1 } % (*) or not { \bool_set_true:N \l_tmpa_bool } { \bool_set_false:N \l_tmpa_bool } @@ -1576,7 +1576,7 @@ calligraphy, % for calligraphic brace (load after decorations.pathreplacing) \tl_set:Nn \l_tzpath_STYLE_B_tl { ~ node [ #4 ] { #3 } } } - \IfValueTF { #5 } + \IfValueTF { #5 } % <+ or ++ or none> (NOT USED!) { \tl_set:Nn \l_tzpath_STYLE_C_tl { #5 } } @@ -1927,7 +1927,7 @@ calligraphy, % for calligraphic brace (load after decorations.pathreplacing) %%% \tzcircle \NewDocumentCommand\tzcircle - { s O{} d<> D""{} r() r() G{\tz@initial@fill@opacity} } + { s O{} d<> D""{} r() r() G{\tz@initial@fill@opacity} D<>{} } { \renewcommand\tzfillopacity{#7} \IfBooleanTF { #1 } @@ -1936,25 +1936,27 @@ calligraphy, % for calligraphic brace (load after decorations.pathreplacing) {% if shift \draw [ fill = \tzfillcolor , fill~opacity = #7 , text~opacity = 1 , - name~path = #4 , #2 ] ([shift={(#3)}]#5) circle (#6) ; + name~path = #4 , #2 ] ([shift={(#3)}]#5) circle (#6) + #8 ; } {% no shift (normal) \draw [ fill = \tzfillcolor , fill~opacity = #7 , text~opacity = 1 , - name~path = #4 , #2 ] (#5) circle (#6) ; + name~path = #4 , #2 ] (#5) circle (#6) + #8 ; } } { \IfValueTF { #3 } - { \draw [ #2 ] ([shift={(#3)}]#5) circle (#6) ; } - { \draw [ #2 ] (#5) circle (#6) ; } + { \draw [ #2 ] ([shift={(#3)}]#5) circle (#6) #8 ; } + { \draw [ #2 ] (#5) circle (#6) #8 ; } } } %%% \tzellipse \NewDocumentCommand\tzellipse - { s O{} d<> D""{} r() r() G{\tz@initial@fill@opacity} } + { s O{} d<> D""{} r() r() G{\tz@initial@fill@opacity} D<>{} } { \renewcommand\tzfillopacity{#7} \IfBooleanTF { #1 } @@ -1963,26 +1965,32 @@ calligraphy, % for calligraphic brace (load after decorations.pathreplacing) {% if shift \draw [ fill = \tzfillcolor , fill~opacity = #7 , text~opacity = 1 , - name~path = #4 , #2 ] ([shift={(#3)}]#5) ellipse (#6) ; + name~path = #4 , #2 ] ([shift={(#3)}]#5) ellipse (#6) + #8 ; } {% no shift (normal) \draw [ fill = \tzfillcolor , fill~opacity = #7 , text~opacity = 1 , - name~path = #4 , #2 ] (#5) ellipse (#6) ; + name~path = #4 , #2 ] (#5) ellipse (#6) + #8 ; } } { \IfValueTF { #3 } - { \draw [ name~path = #4 , #2 ] ([shift={(#3)}]#5) ellipse (#6) ; } - { \draw [ name~path = #4 , #2 ] (#5) ellipse (#6) ; } + { \draw [ name~path = #4 , #2 ] ([shift={(#3)}]#5) ellipse (#6) #8 ; } + { \draw [ name~path = #4 , #2 ] (#5) ellipse (#6) #8 ; } } } +%%% --- end of \tzellipse + +\let\tzoval\tzellipse + %%% \tzframe \NewDocumentCommand\tzframe - { s t+ O{} d<> D""{} r() r() G{\tz@initial@fill@opacity} } + { s t+ O{} d<> D""{} r() r() G{\tz@initial@fill@opacity} D<>{} } { \renewcommand\tzfillopacity{#8} \IfBooleanTF { #1 } @@ -1994,13 +2002,15 @@ calligraphy, % for calligraphic brace (load after decorations.pathreplacing) \draw [ fill = \tzfillcolor , fill~opacity = \tzfillopacity , text~opacity = 1 , name~path = #5 , #3 ] - ([shift={(#4)}]#6) rectangle ++ (#7) ; + ([shift={(#4)}]#6) rectangle ++ (#7) + #9 ; } {% no shift \draw [ fill = \tzfillcolor , fill~opacity = \tzfillopacity , text~opacity = 1 , name~path = #5 , #3 ] - (#6) rectangle ++ (#7) ; + (#6) rectangle ++ (#7) + #9 ; } } { @@ -2009,13 +2019,15 @@ calligraphy, % for calligraphic brace (load after decorations.pathreplacing) \draw [ fill = \tzfillcolor , fill~opacity = \tzfillopacity , text~opacity = 1 , name~path = #5 , #3 ] - ([shift={(#4)}]#6) rectangle ([shift={(#4)}]#7) ; + ([shift={(#4)}]#6) rectangle ([shift={(#4)}]#7) + #9 ; } {% no shift \draw [ fill = \tzfillcolor , fill~opacity = \tzfillopacity , text~opacity = 1 , name~path = #5 , #3 ] - (#6) rectangle (#7) ; + (#6) rectangle (#7) + #9 ; } } } @@ -2025,24 +2037,29 @@ calligraphy, % for calligraphic brace (load after decorations.pathreplacing) \IfValueTF { #4 } {% if shift \draw [ name~path = #5 , #3 ] - ([shift={(#4)}]#6) rectangle ++ (#7) ; + ([shift={(#4)}]#6) rectangle ++ (#7) + #9 ; } {% no shift - \draw [ name~path = #5 , #3 ] (#6) rectangle ++ (#7) ; + \draw [ name~path = #5 , #3 ] (#6) rectangle ++ (#7) #9 ; } } { \IfValueTF { #4 } {% if shift \draw [ name~path = #5 , #3 ] - ([shift={(#4)}]#6) rectangle ([shift={(#4)}]#7) ; + ([shift={(#4)}]#6) rectangle ([shift={(#4)}]#7) + #9 ; } {% no shift - \draw [ name~path = #5 , #3 ] (#6) rectangle (#7) ; + \draw [ name~path = #5 , #3 ] (#6) rectangle (#7) #9 ; } } } } +%%% --- end of \tzframe + +\let\tzrectangle\tzframe %%% \tzparabola |