Tag Info

17

UPDATE, 11/10/11: I've posted the code at https://github.com/blerner/auc-tikz -- the most recent version is auc-tikz-struct.el (the other files are older experimental versions). I haven't had time to update the code in a while, so if people want to tinker with the code, have at it! It's still rough, but it should sorta work if you'd like to try it out. ...

13

Here is a general solution... but not completely since it can not manage the content of nodes (see below for a simpler solution but less general). I create a new homothety option usable with a path. This options can store the result of an homothetic transformation applied to this path. Some subkeys control the parameters: scale is used to specify the ...

10

As a typical counterpart to tikz drawings, here's a take on the pstricks version. \documentclass{article} \usepackage{pst-node}% http://ctan.org/pkg/pst-node \usepackage{multido}% http://ctan.org/pkg/multido \begin{document} \begin{pspicture}(10,10) \SpecialCoor \psset{unit=3cm,runit=3cm}% Scaling of x,y and r units \pnode(3,0){O}% Circle origin ...

10

tkz-euclide manual, although is written in french, is full of examples. On page 112 you will find command \tkzFillSector. Whitin your first example you can use \tkzFillSector[fill=blue,opacity=0.3](O,S1)(S2) to fill the sector with center on O from S1 to S2.

10

I don't know if it is possible to give a precise consideration on which package is more powerful (TikZ or the tkz bundle): what is true is that they have a different syntax, but I think there are cases in which TikZ provides a simpler programming solution and others when tkz is more straightforward. For example, the macro \tkzMarkAngle, is one of the latter ...

9

No there is nothing specific in tkz-fct. You need to use TikZ to do that. With simple functions like in your example, you can use fp. I think when you have complex functions , it's better to get the intersection with a real mathematics soft. Actually tkz-fct works only with gnuplot and perhaps it's possible to use tables created by gnuplot to find an ...

9

You can get the tangents to extend by adding shorten >=<negative length>, and use the intersections library to locate the points of intersection and add the appropriate labels: If you use \coordinates for the poitns then using a \foreach is a convienent way to mark each of the points. Code: \documentclass[11pt, oneside]{article} ...

8

It is possible if you use TikZ directly to plot and combine it with the intersections library. \documentclass{article} \usepackage{tkz-fct} \usetikzlibrary{intersections} \tikzset{ name plot/.style={every path/.style={name path global=#1}} } \begin{document} \begin{tikzpicture} \tkzInit[ymax=15,xmax=4,ystep=5] \tkzAxeXY % \tkzFct[name ...

8

Some informations to complete Ignasi's answer. You can find in tkz-euclide some macros about arcs, some macro about sectors. Here it's possible to draw the sector and to fill it at the same time with \tkzDrawSector[color=blue, thick,fill=blue,fill opacity=0.3](O,S1)(S2) You need only to draw axis after. It's possible to use ...

8

run with xelatex or latex->dvips->ps2pdf \documentclass[pstricks,border=15pt]{standalone} \usepackage{pstricks-add} \begin{document} \begin{pspicture}[showgrid](-5,-5)(5,5) \pspolygon[linecolor=red!60,fillstyle=solid,fillcolor=red!40!white](-2,-3)(-1,-1)(1,-1)% ...

7

A friend of mine once needed kind of a cake to visualize fractions. Adding rotated nodes wasn't hard: \documentclass{scrartcl} \usepackage{tikz} \usetikzlibrary{intersections, calc, fpu, decorations.pathreplacing} \newcommand{\TikZFractionalCake}[5]{% Num, Denom, Color, Borders, Size \pgfmathsetmacro{\angle}{360/#2};% \foreach \x in {1,...,#1}% ...

7

Here is an attempt trying to stick closely to tkz-euclide commands. \documentclass[11pt]{standalone} \usepackage{tkz-euclide} \begin{document} \begin{tikzpicture} \tkzDefPoint(0,0){Origin} \tkzDefPoint(3.5,0){Q} \tkzDefPoint(14,0){O} \node [left] at (Origin) {$P$}; \node [right] at (O) {$O$}; \newcommand*{\Radius}{2cm}% ...

6

There are a few problems with the code: PGF uses degrees for trig functions Seems that the r at the end of the function f was intended to convert from radians to degree, but I changed it so that it is more obvious. Need to determine what happens at the end points of the piecewise domain, so note the slight tweaks for that. Not sure what the tkz portion of ...

6

You could use options when drawing, such as \tkzDrawCircle[R,very thick](S,\rSN pt) \tkzDrawPoints[color=black,shape=circle,fill=black](D,E,F,S) or set styles, such as by \tkzSetUpPoint and \tkzSetUpLine, which are explained in the tkz-euclide manual. Regarding the labels, you could set their style via an option to the tikzpicture or by \tikzset, such as ...

6

A workaround I've just seen possible, without modifying the graphics, is this: Include package bigstrut Use the other parameters of multirow: bigstruts: value 2. fixup: value 2mm Add a call of \bigstrut for each row being spanned. Increasing \arraystretch to 3. The code for the main tex file is this: \documentclass[]{article} \usepackage{amsmath} ...

6

Use the L= option for \Vertex to have a different label: \documentclass{article} \usepackage{tkz-berge} \usepackage{lipsum} \begin{document} \begin{figure} \centering \begin{tikzpicture}[scale=0.75,transform shape] \tikzstyle{LabelStyle}=[fill=white,sloped] \Vertex[x=0,y=0]{A} \Vertex[x=-2,y=-1]{B} \Vertex[x=2,y=-1,L=B]{C} ...

6

I give my personal answer because It's preferable to avoid to mix syntaxes ( tikz and euclide ) and I added some remarks. I take big parts from hpesoj626's answer. Firstly, I prefer to use several parts in my code, I created tkz-euclide to do this: definition, calculations, drawings and labels. If you study tikz enough, you will be able to use only tikz and ...

5

Stefan'answer is correct. I would like only elaborate some methods. First you can use generally most of the tikz's options, then specific macro for an object (here points) have two versions : tkzDrawPoint,and tkzDrawPoints. If all points use the same style (this is recommended) then you can use tkzDrawPoints else you need to use the first version. Finally I ...

5

You have several solutions : 1) you can mix tkz-euclide with tikz \documentclass{minimal} \usepackage{tkz-euclide} \begin{document} \begin{tikzpicture}[scale=1] \tkzDefPoint(0,0){O} \tkzDrawCircle[R](O,3 cm) \def\sectors{20} \foreach \i in {1,2,...,\sectors} { \tkzDefPoint({\i*360/\sectors}:3){P\i} \tkzDrawSegment[color=black](O,P\i) ...

5

The tkz-2d package has been replaced by the tkz-euclide package. You should download the latest version. When you unzip the folder you can move the contents to the the latex folder of your local texmf folder. See this answer for more details on how to set up your local folder, and where it is located.

5

You can use the shorten > and shorten < options. For example \documentclass{minimal} \usepackage{tikz} \begin{document} \begin{tikzpicture} \fill (0,0) circle (0.05); \fill (2,0) circle (0.05); \draw[shorten >=0.5cm,shorten <=1cm,->] (0,0) -- (2,0); \end{tikzpicture} \end{document} produces . However, there are few situations ...

5

There is a name conflict between nag.sty and tkz-tools-base.tex (which is input via tkz-euclide.sty). From nag.sty: \let\@xa\expandafter From tkz-tools-base.tex: \global\let\@xa\tkz@init@xmin Without one (or both) of the two package authors resolving the conflict by renaming things, I don't think you use the two packages together.

5

run with xelatex. All important points are marked as nodes, see documentation. \documentclass{article} \usepackage{pstricks-add} \begin{document} \begin{pspicture}[showgrid=false](-4,-2)(5,3) \pscircle*[linecolor=red!30!white!100](0,0){1} \pscircle*[linecolor=green!30!white!100](3,0){2} \psCircleTangents(0,0){1}(3,0){2}% coordinates/radius of the 2 circles ...

4

I don't know any official way to do this. TikZ seems to remembers the position of nodes between pictures, but I think this is mostly an unintended side-effect of the way nodes a stored, rather than anything officially supported. Anyway, you can write \tikz \tkzDefPoint(1,2){A}; and the position of A will be know in the next picture (or technically until ...

4

TkZ points are just coordinate nodes. As such you can use and define them in the same way. For example: \documentclass{article} \usepackage{tkz-euclide} \begin{document} \begin{tikzpicture} \tkzDefPoint(0,0){A} \tkzDefPoint(2,2){B} \path let \p1=(A), \p2=(B) in (\x1,\y2) node[coordinate] (C) {}; \tkzDrawPoints(A,B,C) \end{tikzpicture} ...

4

You can specify the length of the unit vectors using the keys x and y. In this case, you would use x=0.5cm, y=0.5cm/3 for the first plot and x=0.5cm, y=0.5cm/1.5. \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ samples=60, domain=0:10, xmax=10.5, restrict y to domain=0:10, axis ...

4

The line width is save in the command \tkzRatioLineGrid which is defined as follows. \def\tkzRatioLineGrid{0.75} So you can change this command. \listfiles \documentclass{article} \usepackage{tkz-base} \begin{document} \def\tkzRatioLineGrid{0.2} \begin{tikzpicture} \tkzInit[xmax=4, ymax=2] \tkzGrid[sub,line width=1.5] \tkzAxeXY ...

4

As, to be honest, I didn't feel like reading the tkz-berge manual, I threw together this example. The pgfonlayer is for drawing the edges in the background, thus behind the labels: \documentclass{article} \usepackage{tikz} \pgfdeclarelayer{background} \pgfsetlayers{background,main} \newcommand{\Vertex}[2]% pos, name { \node[circle,draw,minimum ...

4

I now managed to do the following. Any suggestions for improvements? \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \newcommand {\defPoly}[3] { \pgfmathsetmacro{\m}{#2};% \coordinate (Z) at #3;% \draw (Z) circle (1pt);% \path \foreach \coord [count=\ni] in {#1} {\coord coordinate (a\ni)}; \foreach \k [count=\ni] ...

4

Just another solution with PSTricks. Still Version: \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-eucl} \begin{document} \begin{pspicture}[showgrid](-4,-3)(8,6) % Setup the original polygon points \pstGeonode[PosAngle={135,135,135,-45}] (2,2){O} (4,5){A} (6,5){B} (7,3){C} % Setup the image points ...

Only top voted, non community-wiki answers of a minimum length are eligible