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)

222
votes
2answers
24k views

Create xkcd style diagram in TeX

The unique style of the diagrams at xkcd has an informative but nice hand-drawn touch. I guess they are actually drawn by hand but just recently on our partner site for Mathematica someone asked how ...
175
votes
4answers
27k views

Drawing on an image with TikZ

Recently I have learned how to draw simple stuff with TikZ. I really like it. Now I wonder if it is possible to draw with TikZ on a image. Instead of pasting a image in Illustrator and adding some ...
152
votes
11answers
22k views

How can we draw a Christmas tree with decorations, using TikZ?

I would like to use TikZ for drawing a christmas tree. Here's a start, I used the lindenmayersystems library for drawing a tree: \documentclass{article} \usepackage{tikz} ...
126
votes
8answers
31k views

Is it possible to change the size of an arrowhead in TikZ/PGF?

I'm trying to draw an arrow with a bigger head than normal. Is it possible without changing the style of the line itself?
103
votes
12answers
6k views

Can we make a love heart with LaTeX?

I understand that this post may cause some down votes because it seems a bit off-topic, but having seen the discussion on Christmas Tree with LaTeX I am still willing to try. My Girlfriend's birthday ...
93
votes
6answers
5k views

How productive are you with TikZ?

First, I must say I have very limited knowledge about PGF/TikZ. Most things I do are blind copy-pastes of examples I find on the Internet with lots of trial-and-error and googling around. After ...
83
votes
8answers
7k views

Simulating hand-drawn lines

I am working on a project that will have some vector graphics, perhaps using TikZ (or a similar tool). All of the graphics consists of lines, in shades of gray. However, the lines from TikZ appear too ...
82
votes
10answers
4k views

How can I draw an egg using TikZ?

I would like to draw an egg-format element, but I have only found ways of drawing ellipses.
78
votes
8answers
4k views

Sieve of Eratosthenes in tikz

I am writing notes for my students under the topic of prime factorization and I needed to illustrate the Sieve of Eratosthenes and this is what I came up with in tikz: \documentclass{article} ...
78
votes
5answers
7k views

How can we display fireworks?

Soon we can celebrate the New Year. How can we use TikZ for drawing fireworks? For example like this, photographed by Kurume-Shimin, found on Wikipedia: Click on Image search for getting further ...
74
votes
10answers
17k views

List of available TikZ libraries with a short introduction

Quick links: Summary ❧ Intersections library ❧ Arrow tips library ❧ Calc library ❧ Mindmap Library ❧ Shapes library ❧ Paper Folding Library ❧ Chains Library ❧ Shapes library Very often I ...
71
votes
3answers
3k views

How to draw a Sankey Diagram using TikZ

I would like to draw something similar to this (not exactly): using TikZ. Ideally I would be able to set the width by variables and rejoin two flows into one again. Is there a good way to do this? ...
71
votes
1answer
3k views

pgf-Tikz QR code generator

I am looking for a Tikz QR code generator. I am aware of pst-barcode as well as several "local" programs, a luatex solution and web services to do this. Nevertheless, if at all possible, I would much ...
70
votes
11answers
7k views

What are the advantages of TikZ/PGF over PSTricks?

The first time I saw the PSTricks' 3D Galleries, I immediately felt in love with it. I have spent much time to learn and use it. In this forum, I see many people using TikZ. I have not used TikZ yet. ...
69
votes
3answers
3k views

Fundamental differences : PSTricks, TikZ/PGF and others

OK, since this is a pretty vague and subjective question. I need to set up some borders around the discussion that I intend to benefit from. But before anything, I certainly do NOT want to excite the ...
69
votes
4answers
5k views

How to create magnified subfigures and corresponding boxes for portions of a large image

Updated Below I hope the title gets at what I'm trying to do. I have a large image for a thesis on an image processing topic, and I want show the large image, with zoomed in boxes (typically with the ...
67
votes
2answers
11k views

Should \tikzset or \tikzstyle be used to define TikZ styles?

The PGF/TikZ manual states in section 12.4 Using Graphic Options, page 120 (v2.10), that TikZ styles can be set using: \tikzset{my style/.style={<tikz options>},...} However, in several ...
66
votes
1answer
4k views

PowerPoint's “Smart Art” for TikZ?

This question led to a new package: smartdiagram I haven't been using PowerPoint for years, but today I immediately fell in love with its "Smart Art" feature (2010 version of PowerPoint). The ...
66
votes
6answers
3k views

What is the minimum one needs to know to use TikZ?

I am fed up with the poor quality of the pictures in the papers written by my graduate students and am trying to convince them to use TikZ. I know of three ways to begin learning TikZ: The TikZ ...
65
votes
5answers
16k views

Cool Text Highlighting in LaTeX

LaTeX has soul. ConTeXt, of course, has beautifully marked up "sharpie" highlighting, where you can put sweet hightligher under your text for free! In the pictured example, you can see highlights ...
64
votes
2answers
2k views

What are the new features in TikZ/pgf 3.0?

Since the December 20, 2013, we have new major release of the wonderful TikZ/pgf package: version 3.0.0! 1 Unfortunately, I was not able to find a nice human readable list of changes, that goes to ...
61
votes
11answers
25k views

Good way to make \textcircled numbers?

I'm trying to make some good-looking numbers in a circle, using the simple command: \textcircled{1} However, the circle is misaligned vertically with the number, and look a bit sloppy: Any ...
59
votes
6answers
2k views

Curve through a sequence of points with Metapost and TikZ

This question led to a new package: hobby I found Metapost best for drawing complex smooth curves (i.e., Bezier, splines), since you do not have to directly specify Bezier control points. ...
59
votes
3answers
11k views

Putting a timeline for dates in moderncv

This question led to a new package: moderntimeline I just had the idea of using a timeline to specify dates in my CV. I've made a mockup in Inkscape: The idea, as you see it, is to display ...
56
votes
3answers
23k views

Correctly scaling a tikzpicture

I was wondering which is the correct way to scale a tikzpicture. I tried with \begin{tikzpicture}[scale=0.50] but what I obtain is that distances between elements are scaled but not their sizes or ...
56
votes
2answers
2k views

Summary of Tikz commands

Many times, when I'm coding a tikz-picture, I don't remember the command syntax or the name of one option, and I have to look in pgf-manual is not very short. Does anybody has a summary of Tikz ...
56
votes
5answers
33k views

How to install a current version of TikZ?

TikZ is undergoing lots of development with new features being added, but the versions distributed with standard TeX releases are often a little old. How do I get the latest version? If I want to be ...
56
votes
2answers
15k views

Easy curves in TikZ

I find myself needing to draw lots of elegantly curved paths in TikZ. Ideally, I'd just specify a series of points, and TikZ would calculate the extra data itself to draw a nice series of curves ...
56
votes
3answers
27k views

How to scale a tikzpicture including texts?

It seems that the scale option scales only the length of lines, but not the size of texts. For instance, 1 and true and not scaled in the following code. \begin{tikzpicture}[thick, scale=0.6] \draw ...
54
votes
5answers
6k views

How can I create a pdf document exactly as big as my tikz picture?

I often create pictures in tikz that I want to either send to someone, or include in an email. The problem with that is that there is a big white space around and and especially below my pictures. To ...
53
votes
5answers
5k views

What are the relative strengths of TikZ and Asymptote?

I want to compare TikZ and Asymptote for their abilities in 2D & 3D functional plot and other general purpose, simple drawings. What are the strong aspects of TikZ over Asymptote?
51
votes
7answers
18k views

How to draw Venn diagrams (especially: complements) in LaTeX

What I am up to is to write some exercises dealing with logical formulas for my students, like: And the students should draw these formulas on Venn diagrams. At the end of the lesson, I really ...
51
votes
2answers
2k views

Torn paper: matching up the torn edges

I recently asked a question on creating a torn paper effect. JLdiaz provided an absolutely beautiful answer, which I have used (with a very minor modification) to indicate the way in which a document ...
50
votes
4answers
3k views

How to scale a tikzpicture to \textwidth

I would like to scale my tikzpicture to exactly (or a proportion of) the \textwidth Of course I could play with the [scale=0.5] option until I found the right value, but I assume there must be an ...
49
votes
6answers
3k views

Materials for learning TikZ

I feel intimidated in learning TikZ. I was wondering if there are some nice materials (or just your replies) at different level: for providing big picture, which is important to beginners to not ...
47
votes
6answers
2k views

How to automatically draw tree diagram of prime factorization with LaTeX?

I want to have a simple interface to automatically draw tree diagrams of prime factorization. For example, by invoking the following code, \PrimeTree{36} \PrimeTree{90} \PrimeTree{112} ...
46
votes
5answers
2k views

Best way to draw matchstick pictures

I want to draw various matchstick pictures like this: or like this or other figures from: http://www.quizfragen4kids.de/figuren-sinnes-bilderraetsel/streichholz-spiele-knobeleien-1.html I want ...
46
votes
1answer
5k views

Difference between “right of=” and “right=of” in PGF/TikZ

In the PGF/TikZ manual, sometimes I see the option right of=somenode instead of right=of somenode. They look very similar, but the effects are different. The distance between nodes positioned with ...
45
votes
10answers
8k views

How can I speed up LaTeX compilation?

The slowest part is a dozen of diagrams in TikZ.
45
votes
1answer
1k views

Toward a Stamper Package

Imagine that you want to simulate a hand stamp on every page in some large documents. It must be an imperfect print, with random page-to-page variations in ink intensity, fading, rotation and blur. ...
44
votes
4answers
4k views

3-dimensional histogram in pgfplots

I have a simple 3d histogram which I want to import into pgfplots, e.g. using matlab2tikz or by hand. PGFplots does not offer 3d histograms. Is there an easy way to do this?
44
votes
1answer
3k views

Manual/automatic line breaks and text alignment in TikZ nodes

How can I insert a line break in a TikZ node? Simply putting \\ where I want the break doesn't work (see MWE). Is there a way to make lines break automatically at some specified width? And can I ...
44
votes
2answers
2k views

Recreating a guilloche with TikZ

One of my last questions talked about certificates and I got great answers. Now my questions is, can one recreate a guilloche in TikZ like the one shown below: or may be a border like
42
votes
13answers
2k views

What is the simplest way to draw this triangle exactly?

I want to see how we can exactly construct the following diagram as simple as possible. It means that the manual calculation should be avoided. Note that the angle marks attached to angles ...
42
votes
4answers
1k views

How to create a Caesar's encryption disk using LaTeX

How can I create a Caesar's encryption disk with LaTeX? I guess, the ultimate solution would take a arbitrary list of letters and calculate the spaces and angles for each letter automatically. So ...
42
votes
2answers
7k views

Drawing simple 3D cylinders in TikZ

I'm trying to draw some simple 3D objects in TikZ. I can do spheres and cuboids okay, but I'm struggling with circular cylinders: When rotating the scene (I use tikz-3dplot for this), the end faces ...
40
votes
2answers
2k views

Fitting text to a shape in TikZ

I am designing a poster, which has some geometrical shapes (TikZ paths) surrounded by some text. I would like the text to flow neatly around these shapes. I bet there's some clever TikZ magic that ...
40
votes
2answers
1k views

Text spirals with TikZ

I just ran across this, and I'm curious about whether it can be replicated in TeX... Ideally one would have the spiral getting tighter and tighter as one got to the centre, as in I know TikZ has ...
40
votes
1answer
2k views

AucTeX extension for TikZ

Is there an AucTeX extension which supports the TikZ syntax and that one of the tkz-collection as well? In particular I want thinks like: syntax highlighting proper indentation that ...
40
votes
2answers
398 views

producing embossed tactile graphics with Tikz for a student who is blind

I work at disability services at a university and recently started working with a student who is blind in upper level computer theory, automaton, and programming classes. I learned LaTeX about 3-4 ...