diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/tkz-base/TKZdoc-base-texte.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/tkz-base/TKZdoc-base-texte.tex | 146 |
1 files changed, 146 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/tkz-base/TKZdoc-base-texte.tex b/Master/texmf-dist/doc/latex/tkz-base/TKZdoc-base-texte.tex new file mode 100644 index 00000000000..50792842f9a --- /dev/null +++ b/Master/texmf-dist/doc/latex/tkz-base/TKZdoc-base-texte.tex @@ -0,0 +1,146 @@ +\section{Texts and Legends} + +\subsection{Placing a title} +Of course you can use \TIKZ, but the macro I propose to allow you to place the text using the units chosen for the drawing. + +The options are always those of \TIKZ, in particular the following ones: +\begin{NewMacroBox}{tkzText}{\oarg{local options}\parg{dot}\var{text}}% +The point can either be given by its coordinates or by its name. + +\begin{tabular}{lll}% +\toprule +options & default & definition\\ +\midrule +\TOline{color }{|black|}{current colour} +\TOline{text }{|black|}{text colour} +\TOline{fill }{|white|}{background colour} +\TOline{opacity }{|1| }{opacity} +\end{tabular} +\end{NewMacroBox} + +\subsubsection{A title} + +\begin{tkzexample}[latex=8cm] +\begin{tikzpicture} + \tkzInit[xmax = 6, ymin = 1000,% + ymax = 4000,ystep = 1000] + \tkzAxeXY + \tkzText[draw, + line width = 1pt,% + color = red,% + fill = orange!20](3,4000)% + {Revenue by month} +\end{tikzpicture} +\end{tkzexample} + +\subsubsection{Draft} + +\begin{tkzexample}[latex=8cm] +\begin{tikzpicture} + \tkzInit[xmax = 6, ymin = 1000,% + ymax = 4000,ystep = 1000] + \tkzGrid \tkzAxeXY + \tkzText[draw,opacity=.2, + rotate=45,inner sep=.6 cm, + line width = 1pt, + color = black, + fill = purple!20](3,2500) + {\Huge DRAFT} +\end{tikzpicture} +\end{tkzexample} + +\subsubsection{Text with a point} +It is possible to give the reference of a point instead of its coordinates. + +\begin{tkzexample}[latex=8cm] +\begin{tikzpicture} + \tkzInit[ymax=5,xmax=6] + \tkzAxeXY + \tkzDefPoint(3,3){A} + \tkzText[draw,opacity=.6, + inner sep=.6 cm, + line width = 1pt, + color = black, + fill = purple!20](A) + {My text} +\end{tikzpicture} +\end{tkzexample} + +\subsubsection{Text format} + The option \tkzname{text width} is interesting, see the pgfmanual for more information. +\begin{tkzexample}[latex=8cm,small] +\begin{tikzpicture} + \tkzInit[ymax=5,xmax=6] + \tkzAxeXY + \tkzText[draw,opacity=.6, + inner sep=.6 cm, + line width = 1pt, + color = black, + fill = purple!20, + text width=3cm](3,3) + {My text\\\ Reference} +\end{tikzpicture} +\end{tkzexample} + +\subsection{Placing legends} +There are two ways to use this macro. Either you can place legends for curves. Then you can represent lines with their own style, or you can differentiate symbols (mark). +\hypertarget{legend}{} +\begin{NewMacroBox}{tkzLegend}{\oarg{local options}\var{mark/color/size/text}}% +The arguments differ according to the boolean \tkzname{line}. + +\medskip +\begin{tabular}{lll}% +\toprule +options & default & definition\\ +\midrule +\TOline{line}{false}{Boolean: line or symbol} +\end{tabular} + +With |line=true| + +\begin{tabular}{lll} +\toprule +arguments & default & example\\ +\midrule +\TAline{style/line width/color/text}{no default}{dashed/1pt/red/Product Recipe B} +\end{tabular} + +\medskip +With |line=false| + +\begin{tabular}{lll} +\toprule +arguments & default & example\\ +\midrule +\TAline{mark/mark size/color/text}{no default}{heart/1ex/red!30/Product Recipe A} +\end{tabular} +\end{NewMacroBox} + +\subsubsection{Legends with symbols} +\begin{tkzexample}[vbox] +\begin{tikzpicture} +\tkzInit[xmax=12,ymin=1000,ymax=11000,ystep=2000] +\tkzGrid[color=orange!30] +\tkzDrawX[below right,label=Mois] +\tkzDrawY[above left,label=Recette] +\tkzLabelX +\tkzLabelY +\tkzDefSetOfPoints{1/2000,2/3000,3/2000,4/2500,5/4200,6/4800,7/4600, + 8/5200,9/6200,10/7000,11/7400,12/10000} +\tkzDefSetOfPoints[prefix=P]{1/3200,2/4100,3/3300,4/3300,5/5000,6/5500,7/5200,8/4000, + 9/3000,10/6000,11/8400,12/9000} +\tkzSetUpMark[mark=heart,color=black,fill=red!30,size=4pt] +\tkzJoinSetOfPoints[thick,color=brown,double] +\tkzDrawSetOfPoints +\tkzJoinSetOfPoints[prefix=P,thick,color=orange,double] +\tkzDrawSetOfPoints[prefix=P,mark=square*,mark size=4pt, + mark options={color=blue,fill=blue!40}] +\tkzLegend[draw,rounded corners,fill=orange!20,text=brown, + line width=2pt](5,10000){heart/1ex/red!30/Product Recipe A,% + square*/0.75ex/blue!40/Product Recipe B} +\end{tikzpicture} +\end{tkzexample} + + + +\endinput |