TikZ is a higher-level drawing language built on top of the PGF graphics framework. For questions specifically about the PGF layer use {pgf-core} instead. Both tags are possible on the same question. The tag {diagrams} is also compatible with this tag.

learn more… | top users | synonyms (3)

8
votes
5answers
3k views

Line segments with text in the middle in TikZ

Another exam, another image. I am trying to create the following image in TikZ Now. I am looking for some feedback on my code. I am trying to learn TikZ as fast as I can, but still I feel I am ...
11
votes
0answers
2k views

MacTeX pgfkeys/tikz package fails [closed]

the document listed below, (taken from here: texample.net) fails on my system (running MacTeX 2011) with the error: Package pgfkeys Error: I do not know the key '/tikz/drop shadow' and I am going to ...
13
votes
1answer
3k views

pgfplots and calculations; without fpu 'dimension too large', with fpu 'Illegal unit of measure (pt inserted)'

I'm trying to multiply some numbers that will end up in the legend of a plot. I can't get it to work: If I naively try \pgfmathmultiply, I get a dimension too large error, with the code in MWE 1 ...
16
votes
5answers
1k views

TikZ Grid Without Edges

I have a TikZ grid \draw[step=0.5cm,color=gray] (0,0) grid (3.5,3.5); But I'd like to draw the grid without edges, or with half of the edges cells missing, so that it appears to be a small section ...
7
votes
3answers
404 views

Global Coordinates

How can I declare coordinates in a block and access them from outside of the block? \begin{tikzpicture} \foreach \x / \y in { 1 / 3, 2 / 8, 3 / 14, }{ \coordinate (N\x) at ...
3
votes
1answer
194 views

externalization and text export for tikz and pstricks

A feature similar to what is offered in Inkscape in terms of font export in figures for subsequent pdflatex/latex use would be a great addition to tikz and pstricks I think. We would then be able to ...
23
votes
2answers
1k views

Making TikZ nodes hyperlinkable

I have a TikZ tree. Now I want to make the nodes click-able directing to relevant sections in the document (or directed to URLs). Some of the content in the nodes are not text. Is it possible to turn ...
8
votes
1answer
1k views

TikZ: vertically aligning text in nodeparts

I can't seem to vertically align text in different nodeparts of the same node. This MWE \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes} \begin{document} \begin{tikzpicture} ...
4
votes
1answer
961 views

Drawing a multiplexer with tikz

I want to draw a logical circuit with a multiplexer. Is there any symbol provided by the TikZ package? I'm using the TikZ library circuits.logic to draw logical circuit symbols. Or is there any ...
14
votes
1answer
3k views

geographic maps with TikZ/pgfplots

I have recently discovered pgfplots and I love it. I'm converting the figures from my thesis to pgfplots, or at least the ones I have made myself. One of my figures is a map that I created using the ...
5
votes
2answers
495 views

Redraw a kernel scheme diagram

I'm trying to redraw a kernel scheme diagram for a university lecture note. This is how far I got: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} ...
11
votes
1answer
1k views

TikZ: connecting nodeparts

I'm new to TikZ. Last couple of hours in fact. I was wondering if there was a way of connecting nodeparts from different nodes. Here's an example \documentclass{article} \usepackage{tikz} ...
14
votes
3answers
868 views

How to find the length of a PGF array?

A few of my macros currently require the user to pass the length of an array along with the array itself. It would be nice if the length could be calculated for them, as the user in question (myself) ...
4
votes
1answer
1k views

How can I define a different style for edges and nodes?

Given this image (a simple edge between two nodes): \begin{tikzpicture}[>=latex,line join=bevel,] \node (a1) at (44bp,8bp) [draw,trapezium] {$A$}; \node (d1) at (44bp,82bp) [draw,trapezium, ...
3
votes
2answers
460 views

Can one pass a pgf array to a pgf math function?

I'd like to define: anglearray(\A,\I,\L) = array(\A,Mod(\I,\L)) + 360*floor((\I+0.1)/\L); but I get strange errors about "! Missing number, treated as zero." and the "array" part appears to ...
9
votes
1answer
1k views

Fancy Theorem Environment and Colors

I'm trying to make a boxed theorem environment with colors. I thought I had done it, but I was mistaken--lists were the wrong colors. In the picture above, I would like the "list" to be the same ...
6
votes
3answers
1k views

Divide a rectangle into n times k equal cells

Is there a way to divide a given rectangle in tikz into n times k equal cells and give a list of coordinates (n_i,k_i) of cells, which should get a colored background? Edit: I think I should ...
6
votes
1answer
1k views

Linebreak in ticks-labels

I'm using \symbolic y coords in a xbar-plot. Some of these coords are very long. There is a solution using nodes which is very ... hardcoded. And it would be nice to have it automated. How do I ...
10
votes
1answer
2k views

pgfplots from file: search path, looking for \graphicspath equivalent

I have recently discovered the wonderful pgfplots package and I've started coding my Python code to output tabular data of whatever is plotted (at least for simple plots). In my LaTeX source code, I ...
13
votes
2answers
1k views

How is the center point of an arc path determined?

I'm having some difficulty drawing an arc as part of a path. What I'd like to do is draw a whole ellipse then shade only part of it. The shaded part is defined by four points on the ellipse. I can ...
4
votes
2answers
1k views

tkz-graph : inconsistency between edge and loop

I'm discovering the great package tkz-graph and I am experiencing some trouble with the \Loop macro. There seem to be some inconsistencies between the \Loop macro and the \Edge macro. For example, in ...
27
votes
4answers
7k views

How to draw arrows between parts of an equation to show the Math Distributive Property (Multiplication)?

there is a part of my paper where I use the distributive property and it's not that clear for the reader to see (I'm using in proposional logic for a proof). The logic equation (part of) is: (l_{1}) ...
8
votes
1answer
1k views

TikZ: Positioning of multiline nodes

Do you know an elegant way to align multiline nodes according to first line, e.g. for use in a legend? Compare this example: \documentclass{article} \usepackage[% paperwidth=7.5cm,% ...
9
votes
3answers
1k views

Convert PNG image to TikZ code

I am trying to convert this image here into a somewhat clean TikZ code Now I downloaded potrace, and tried to convert the image to an eps, and then to use inkscape to convert it into TikZ code. ...
6
votes
2answers
5k views

Proper way to change axis in plot tikz

I am trying to reconstruct the image below in tikz, and I think I have done a fairly decent job. The problem is that my code is a mess. Is there any simple clean way to produce this image? My ...
4
votes
1answer
2k views

Undefined control sequence with pgfgantt package when creating Gantt chart

I'm attempting to make a Gantt chart in my LaTeX document with the pgfgantt package. However, when I try to compile, it gives me undefined control sequence at the first \gantttitle between the {7} and ...
13
votes
1answer
2k views

Tips for creating semi-random blob in tikz

I am somewhat starting to get acustomed to tikz now. But I am trying to reproduce the image below in tikz I have managed to make the triangle (I think?) using tikz, now I have no idea how to make ...
11
votes
3answers
6k views

TikZ tree sibling distance

I have been struggling a bit with TikZ and how to build trees. What I need now is some advice on how to improve the node placement. Right now I have these 2 trees: ...
10
votes
1answer
663 views

Point to a Verbatim Line using TikZ

I'm trying to use TikZ in beamer to point to a line of code. Here's what I have so far: \documentclass{beamer} \usepackage{tikz} \usepackage{fancyvrb} \begin{document} \begin{frame}[fragile,t] ...
5
votes
2answers
1k views

tkz-euclide changing labels and size (triangle, inscribed circle)

A friend of me Torbjørn, showed me how to build the image below using tikz with the following code. \documentclass{article} \usepackage{tkz-euclide} \usetkzobj{all} ...
15
votes
3answers
8k views

changing loop size and shape in tikz

I would like to make the small loop around the circle (loop above) a bit rounder and nicer. below is a short example of my code: \documentclass{scrbook} \usepackage{tikz} ...
7
votes
1answer
982 views

Compute asin from y-value of a coordinate or: Angle between two lines in tikz

Edit (The almost ultimate solution) After sorting everything out and having some nice code - thanks to cjorssen :) - I cam up with a general solution with which you are able to use the connector with ...
9
votes
2answers
3k views

Remove rows in a \addplot table command

Is there any way to adapt Show last N rows from input datafile only in \pgfplotstabletypeset to a \addplot table command ? This doesn't work: \documentclass{article} \usepackage{pgfplots} ...
4
votes
1answer
1k views

Drawing a Cube Using Tikz

I'm trying to simply use the example of a cube provided here \begin{tikzpicture}[ back line/.style={densely dotted}, cross line/.style={preaction={draw=white, -, line width=6pt}}] \matrix (m) ...
11
votes
3answers
1k views

Hexagon with exscribed triangle

I am learning tikz now, it is painfully slow, but I am slowly learning. I am trying to reproduce the image below. Here is my code so far. This is basically a rip of from the pgf manual. ...
20
votes
2answers
2k views

Tikz Polar Grid

I'm working on a Smith Chart using TikZ. Currently I'm writing it with everything scaled to a unit circle (centered on 0,0 with a radius of 1) without units. Then scaling so it's a reasonably sized ...
8
votes
2answers
6k views

How do you get two lines between nodes that have paths to each other instead of a double ended line? [duplicate]

Possible Duplicate: Double arrow in TIKZ? \begin{tikzpicture} [->,>=stealth',shorten >=1pt,auto,node distance=1.5cm,semithick,font=\tiny] \tikzstyle{every state}= ...
7
votes
2answers
2k views

Passing arguments to \def inside \newcommand (TikZ/PGF)

I'm having trouble passing an argument to \pgfmathparse inside a macro I defined. Here is the code: \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \newcommand{\drawmestg}[2]{ ...
4
votes
2answers
2k views

pgf-tikz problem with 'declare function'

I need to make a plot of a non-linear functions. To get familiar with the 'declare function' capability of pgf-tikz, I tried the following code: \documentclass[10pt]{article} \usepackage{amsmath} ...
19
votes
1answer
2k views

Maintaining layout of Tikz diagrams with TeX4ht (converting as single pictures)

A Tikz diagram such as \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \path (0,0) node[draw] (A) {A}; \path (2,0) node[draw] (B) {B}; \draw (A) -- (B) ...
5
votes
3answers
592 views

Making mixed trees with and without text-containing nodes

I’m using TikZ to draw linguistic syntax trees where some nodes have textual labels and some nodes don’t. I’d like the branch from a labelless node to continue at the same angle into the right hand ...
4
votes
1answer
245 views

Multiple listings using range markers and PGF's \foreach

I've been trying to include multiple code snippets from a unique source file by using listings's range markers (named lines) and PGF's \foreach macro: \foreach \x in {1,2,...,8} { ...
4
votes
1answer
1k views

String list in tikz foreach

I'm trying to draw some repeated with PGF/Tikz, and I'm using a foreach. Problem: each line has, on the right, a description, which is a string of text - which may be somewhat long and contain commas ...
8
votes
1answer
1k views

Tikz - Marking nodes in a binary tree?

I need help marking nodes in a binary tree. I've tried drawing this using the fitting library in tikz, but the fit would cover other undesired nodes as well. Please help. The code I tried is here ...
6
votes
1answer
928 views

User-defined math functions with pgf

I'm trying to use user-defined math functions with pgf to make a plot. The plot will consist of several straight lines given by a function of three arguments. (I know there are easier ways to do this, ...
20
votes
3answers
777 views

How to extend TikZ drawing commands

I would like to create a carc path macro (centered arc, that acts like circle, without changing the current position) in a way to be able to write : \draw (0,0) carc(30:90:1) carc(30:90:2) ...
11
votes
1answer
3k views

Drawing an arrow tip to every node of a path

I want to draw an arrow tip to every node/coordinate in a path. But tikz draws them only to the first and last point. Is there an option for that purpose? Or have I to splitt the path into its single ...
25
votes
2answers
1k views

Using the same picture over and over?

Suppose I have a complex figure made ​​with TikZ. How do I use it several times without having to repeat all the commands? \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{tikz} ...
1
vote
2answers
295 views

Why am I getting a frame number of 2? [closed]

Using tikz/matrix inside beamer, I have several slides with a wrong page/frame count. Why is that so, and how can I avoid it? MWE: \documentclass[14pt]{beamer} \usepackage{tikz} ...
10
votes
3answers
701 views

Not repeating myself so much in TikZ diagrams

I am writing a document which defines a network protocol. I illustrate key message exchanges with diagrams like this: The TikZ source for this diagram is: \documentclass{article} ...