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)

30
votes
2answers
8k views

How to draw a poset Hasse Diagram using TikZ?

I need to draw an Hasse Diagram using LaTeX. TikZ is the solution I would like to use. I tried with a simple structure involving trees but obviously when I need to join two nodes, it is not possible. ...
30
votes
4answers
3k views

Creating playing cards using TikZ

I'm creating a card game, specifically a computer science Fluxx variant, and want to generate the cards through *TeX. They should look like this: In some of them I want to put some graphics or ...
30
votes
2answers
5k views

Rounded corners on only one side of a TikZ node

How can I make rounded corners on one side of my node (only right, only left)? \documentclass{minimal} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node [fill=gray, rounded ...
30
votes
2answers
1k views

Draw 3D intersecting surfaces

Problem This is a shameless "just do it for me" graphics question, but honestly I have no idea where to start. I'd like to reproduce this figure The image shows the intersection of two ...
30
votes
1answer
655 views

Randomly bouncing balls with constant tails in a spherical constraint

How easy is the following animation made with TikZ, PSTricks, and Asymptote? Use the following as a starting template to save your time. \documentclass[border=12pt]{standalone} \begin{document} . ...
30
votes
1answer
2k views

Topological Quantum Field Theory diagrams with pstricks or tikz

This question led to a new package: tqft — Blog: The TQFT Package I'm going to write a brief note about topological quantum field theories, so I need to draw some copies of the "pair of ...
30
votes
1answer
479 views

How can I know if a node is already defined?

I think I've seen this question before, but I can't find it. The problem is simple; before I assign a name to a node I would like to know if the name is already used. I think when a node is created ...
30
votes
2answers
871 views

Equation connected by lines

I have written a code that defines a new environment in which aligned equation are connected by lines as in the image: I think it is useful when, inside the align environment, there is the need of ...
30
votes
2answers
912 views

An Example from the Microtype Documentation

While exploring the depths of the microtype package with regard to LuaTeX I came across this innocent looking page 18 from the microtype.pdf 2.5 beta-08. As the blue note in the margins hints a ...
29
votes
2answers
5k views

Draw a bivariate normal distribution in TikZ

For a small class I want to draw a bivariate normal distribution and show where the means from the two variables meet in the space. Has anyone done this in TikZ?
29
votes
2answers
5k views

Mindmap tikzpicture in beamer (reveal step by step)

I want to include a tikzpicture (mindmap) in beamer and I want the children to appear one after the other. So I use \visible but it don't works -- also not with \pause command. I get errors regarding ...
29
votes
2answers
3k views

How to draw Brownian motions in tikz/pgf

Here I want to draw some Brownian motions in tikz, like this: Furthermore, I want to truncate the trajectory of Brownian motion, like this: I have tried many times with random functions in tikz, ...
29
votes
5answers
3k views

How can I fix jumping TikZ pictures in beamer?

The problem of stuff jumping in beamer is a common one, (see e.g. Avoiding jumping frames in beamer) and we've seen it here from time to time (I imagine the "related" list at the side will be quite ...
29
votes
2answers
2k views

How to plot a lattice of points on the surface of a torus?

I am doing a report on the Ising model, without going into the complex details of the model, in its two-dimensional form it involves a lattice of points. Which, when periodic boundary conditions ...
29
votes
5answers
3k views

How to draw the region of inequality?

Everyone, I would like to draw the region \begin{align*} x_1 + x_2 &\ge 3 \\ 2x_1 - x_2 &\le 5 \\ -x_1 + 2x_2 &\le 3 \end{align*} Here is my code to draw the region of inequality: ...
29
votes
3answers
1k views

How to pimp my tube?

How can I pimp my tube? \documentclass{scrartcl} % needs logicpuzzle bundle v1.8 % http://mirrors.ctan.org/graphics/pgf/contrib/logicpuzzle/logicpuzzle.sty % or replace logicpuzzle -> battleship ...
29
votes
3answers
27k views

Tikz: Multi-line text in the node description [duplicate]

I use tikz to create pictures in latex. My picture consists of set of nodes. Every node has its own text inside the node, for example, "This node is valuable": \node (mynode) [mystyle,right=of ...
29
votes
2answers
4k views

Stroke with variable thickness

Can you create lines with variable thickness (line width) in Tikz?
29
votes
3answers
7k views

Using math in TikZ

I know it has been asked and answered before, and I need to put { and } around it, but for some reason this doesn't work: \draw (0,0) -- ({atan(1)}:{sqrt(2)}); Any idea why?
29
votes
4answers
11k views

Node shapes in TikZ

I want to draw a block diagram for a software app and I need two shapes which I couldn't find on the Internet. The shapes are a parallelogram and a rectangle with double side margins. One is for data ...
29
votes
1answer
889 views

Polar histograms

I recently stumbled upon this post, that explains how to make polar histogramms with R. An improved version of R-package can be found here. Even though it looks unfamiliar, the result of is quite nice ...
29
votes
1answer
14k views

How to set default style for arrow tips in TikZ?

I am creating multiple TikZ pictures within one document and would like to set the default style of arrow heads for all the pictures to the latex style, i.e. like -latex does, so that I don't have to ...
29
votes
1answer
5k views

Transparent node with opaque text?

Is there a simple way to create a transparent node with opaque text? Preferably without having to use a postaction or redraw the node. In the example below I'd like to achieve the effect of the first ...
29
votes
2answers
1k views

3D solids with Tikz - or an alternative?

I want to draw 3D shapes in latex. I have tried out different strategies, but nothing has led me to a good solution yet. First what I want to do, then what I have done so far. In prioritized order, ...
29
votes
1answer
6k views

How to draw a decorated rectangle with rounded corners?

As the title says, I was trying to draw a rectangle with rounded corners, and then decided it needed decorating. Well, the result looks awesome, but isn't really what I had in mind. a) What happened? ...
28
votes
6answers
2k views

Design of an asteroid belt in TikZ

How can I construct an asteroid belt in TikZ? That is my question: I get everything right, but I do not know how to make the asteroid belt. I have no code to add besides the preamble with TikZ ...
28
votes
8answers
1k views

Creating a Polar Grid with Tikz

I am trying to recreate the following image using tikz: So far, this is my code \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[>=latex] \fill[fill=lightgray] ...
28
votes
3answers
17k views

Tikz - How to Draw Boxes Around Set of Nodes

How to draw the boxes as shown in the attached image? I could only manage to draw the chart but could not highlight the desired node / nodes with a rectangle box. Preferably dotted. I could not draw ...
28
votes
6answers
4k views

What's the easiest way to draw the arc defined by three points in TikZ?

An ordered set of three points uniquely defines a circular arc, and I'd like to be able to draw that arc in TikZ. I know about the arc drawing command, which does the job given a radius, two angles, ...
28
votes
3answers
2k views

How can I draw nucleosomes with wrapped DNA in tikz or pstricks?

The nucleosome is the fundamental unit of DNA packing in cells, and I am trying to generate some figures for regular use in manuscripts and presentations. The nucleosome is commonly abstracted to a ...
28
votes
3answers
3k views

Arrow with two colors with TikZ

I want to create with TikZ a yellow arrow with black margin (border, edge). I thought I could do this by using two arrows which lie on the top of each other, e.g. with: \documentclass[12pt,twoside, ...
28
votes
4answers
22k views

Define a variable in TikZ

I guess this is a very simple question, but I couldn't find the answer... How can I define a variable in TikZ? I want to have something like, for example: \draw[->] (x1,y1)--(x2,y2); Such that ...
28
votes
4answers
6k views

Script to automate externalizing TikZ graphics

Is there a script to automate externalizing TikZ graphics? (As suggested by Scott here)
28
votes
2answers
2k views

How can I create new commands in TikZ?

I am new to the use of TikZ. I have been evaluating the TikZ-KTikZ combination, over the last 2 days, as an alternative to Xfig, which I have used for 17 years. I have managed to create a grid ...
28
votes
1answer
10k views

Custom and built in TikZ fill patterns

I can't find much information about creating TikZ fill patterns or even using the custom built-in patterns. Look to do all the common fills like lines, hatches, dots, stars, etc... I need to be able ...
28
votes
2answers
785 views

What is the correct way to get a pgfkey value?

This is my first foray into the pgfkeys package and I found the following behavior really odd. The Tikz/pgfkeys manual mentions two ways for setting key values: \pgfkeys{key=value} and ...
28
votes
2answers
3k views

How can I improve this family tree in TikZ?

To answer a question about how to draw family tree on LaTeX-Community.org, I created an example: \documentclass{minimal} \usepackage{tikz} \usetikzlibrary{trees} \begin{document} ...
27
votes
9answers
7k views

Drawing polyhedra using TikZ with semi-transparent and shading effect

I would like to draw an Octahedron using TikZ, I found nowhere to start, I tried drawing 6 points and then connecting them properly, but this method gives no 3D feel at all, this is my drawing: ...
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}) ...
27
votes
4answers
1k views

Crop jpeg into circular tikz node

\documentclass[demo]{article} \usepackage{graphicx} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node[circle,draw,inner sep=2cm]{\includegraphics{myimage.jpg}}; \end{tikzpicture} ...
27
votes
4answers
1k views

Saturn rings with TikZ

The planet and a ring are easily drawn. The challenge is to layer them in such a way that the far side of the ring is hidden from view behind the planet, and the near side of the ring eclipses the ...
27
votes
4answers
15k views

TikZ: difference between \node and \coordinate?

What is the difference between \node and \coordinate in TikZ? Exchanging them does no visual effect in my (to be honest: still simple) pictures. When to use what?
27
votes
8answers
3k views

How to draw triangular grid in TikZ?

Is there an easy way to draw a triangular grid in TikZ, like this?
27
votes
3answers
6k views

Using TikZ, how to draw an elliptical arc starting from point A to point B with the origin as its center where both radii are given?

I am new to TikZ and reading its manual now. For the sake of exercises, I want to draw Batman's logo as follows: Using TikZ, how to draw an elliptical arc starting from point A to point B with the ...
27
votes
5answers
4k views

How to draw tangent line of an arbitrary point on a path in TikZ

Suppose I specify some node as occurring at some point on a path. Say for example the node (P) defined on the following path. \path[draw] (0,9) to[out=-90,in=180] (9,0) node[pos=0.7,circle] (P) {}; ...
27
votes
4answers
6k views

How to place a node in the middle of an arc?

I think it is a simple question, but I didn't find the answer yet. The code I'm using is the following: \draw[->](1,0) arc(0:-30:1) node[midway]{$30$}; But in this way the node is placed at the ...
27
votes
2answers
7k views

TikZ rectangular node with different rounded corners

This is my minimal example: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node[rounded corners=3pt, draw, fill=red!20]{Hallo!}; \end{tikzpicture} ...
27
votes
2answers
4k views

Recreating a logo (text around a circle)

My objective is to figure out how to put text around the circumference of a circle as shown below. I have read Calligraphic logo in tikz which answer part of my question but not completely as ...
27
votes
3answers
5k views

Drawing random paths in TikZ

I am looking for a way to draw with TikZ something that looks like a random path. Here is an inspiration: Is it possible to have TikZ generate something that would be similar to a random path ...
27
votes
2answers
3k views

Milestone graphic in TikZ

This question led to a new project for a TikZ based solution: timeline The author of the original artwork has posted his METAPOST based library: blueprint How could I implement a ...