Questions tagged [tikz-pgf]

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.

Filter by
Sorted by
Tagged with
513 votes
8 answers
172k 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 ...
nacho4d's user avatar
  • 11k
243 votes
2 answers
118k 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 places ...
Martin Scharrer's user avatar
136 votes
1 answer
41k 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 ...
Truong's user avatar
  • 1,775
67 votes
8 answers
15k views

How can I invert a 'clip' selection within TikZ?

I wish to draw an arc for a reflex angle on the outside of a triangle with coordinates (A), (B) and (C). If I wanted to draw the arc inside the triangle I could use something like \begin{scope} \...
bryn's user avatar
  • 10.2k
297 votes
2 answers
128k 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 ...
Jake's user avatar
  • 231k
135 votes
7 answers
58k 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 ...
Andrew Starks's user avatar
103 votes
10 answers
18k 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 lose ...
Tim's user avatar
  • 5,653
298 votes
17 answers
271k views

Good way to make \textcircled numbers?

This question led to a new package: circledsteps I'm trying to make some good-looking numbers in a circle, using the simple command: \textcircled{1} However, the circle is misaligned vertically ...
Martin Tapankov's user avatar
83 votes
2 answers
20k 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 ...
André's user avatar
  • 1,852
132 votes
9 answers
105k views

TikZ: How to draw an arrow in the middle of the line?

Like this: .------<------. | | v ^ | | '------>------' I am currently using \begin{scope}[very thick,->] \draw (-4,1)--(-4,0)--(0.1,0); \draw (0,0)--...
kennytm's user avatar
  • 6,302
37 votes
2 answers
7k views

Proper nesting of tikzpicture environments: Reset all PGF values to their defaults

Sometimes, nesting tikzpicture environments seems inevitable, e.g., if you want a node to contain a TikZ picture on its own. (Is it?) However, nesting tikzpicture environments is problematic, also ...
krlmlr's user avatar
  • 12.5k
352 votes
8 answers
267k 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?
yegor256's user avatar
  • 11.7k
57 votes
4 answers
21k views

Vertical and horizontal lines in pgf-tikz

It is easy to produce a path between two nodes consisting of a single horizontal and a single vertical line (from the manual): \begin{tikzpicture} \draw (0,0) node(a) [draw] {A} (1,1) node(b) [...
DrJay's user avatar
  • 1,162
24 votes
2 answers
13k views

Using a pgfplots-style legend in a plain-old tikzpicture

I am using a plain-old tikzpicture to produce a pie-chart-like plot. Now, all other plots in my paper are handled using pgfplots (which doesn't do pie charts) and have their legend typeset by pgfplots....
Andreas Sewe's user avatar
76 votes
4 answers
24k views

Axis break in pgfplots

Is there an easy way to 'break' the axis in a pgfplots environment? What I'm talking about is something like this Any minimal plot will do as an example...for example \documentclass{minimal} \...
TSGM's user avatar
  • 2,322
68 votes
5 answers
24k views

Extract x, y coordinate of an arbitrary point in TikZ

I need a macro to extract the x and y coordinates from an arbitrary point, like (3,4), or like (A), or like ([xshift=-2pt] A.north west), where A is the name of a node. I've seen the solution \...
Jamie Vicary's user avatar
20 votes
3 answers
7k views

Drawing Axis Grid in 3D with Custom Unit Vectors

I am trying to adjust the unit vectors for each of the axis, and draw a coordinate grid. I can get it to work without specifying the unit vectors, of specifying it as: x={(1.0cm,0.0cm)}, y={(0.0cm,1....
Peter Grill's user avatar
72 votes
2 answers
26k views

How to make beamer overlays with Tikz node

I have a diagram of 4 nodes in my beamer slide. \begin{figure}[h] \begin{centering} \begin{tikzpicture}[system/.style={draw,rectangle,rounded corners=3,minimum width=2cm,text width=1.8cm,text ...
Peter Smit's user avatar
  • 13.9k
58 votes
9 answers
19k 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) {}; ...
Murali Agastya's user avatar
183 votes
12 answers
27k views

Simulating hand-drawn lines

I am working on a project that will have some vector graphics, perhaps using TikZ (or a similar package). All of the graphics consists of lines, in shades of gray. However, the lines from TikZ appear ...
Village's user avatar
  • 13.3k
58 votes
2 answers
26k views

Tikz: Arrowheads in the center

For arrows I have gone through options like ->, ->>, <-, <<- but havent found one for making the arrowhead appear in the center of the line of the curve (something like ->-) How do I do it in ...
yayu's user avatar
  • 5,157
259 votes
3 answers
112k views

Design a custom Beamer theme from scratch

No matter how hard I search, I cannot find any information on creating a Beamer theme from scratch, as opposed to LEGOing it together from the built-in inner, outer and color themes, maybe modifying ...
marczellm's user avatar
  • 11.7k
89 votes
7 answers
120k 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 ...
Caramdir's user avatar
  • 88.3k
38 votes
6 answers
10k views

Bounding box is larger than expected when drawing a curved path

I have been working on logo for my department and I have the following code. The problem is that whenever I compile the diagram seems to be larger than the actual logo. I do not know what is the ...
azetina's user avatar
  • 28.7k
212 votes
5 answers
164k 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 ...
Jamie Vicary's user avatar
67 votes
3 answers
14k views

"Z-level" in TikZ

This is an idle question, but neverthless, I think it's interesting. Does TikZ have a simple way to implement a "z-level" specification. By this, I don't mean 3D drawing, I mean specifying which ...
Seamus's user avatar
  • 72.7k
119 votes
9 answers
136k 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 would ...
daroczig's user avatar
  • 1,556
41 votes
4 answers
18k 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 might not be clear to the reader to see the operation result (I'm using in proposional logic for a proof). The logic equation (...
Marcos Roriz Junior's user avatar
157 votes
7 answers
81k 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 ...
Peter Smit's user avatar
  • 13.9k
142 votes
8 answers
110k views

Draw arc in tikz when center of circle is specified

It would be convenient sometimes to be able to draw an arc in tikz by specifying the center of the corresponding circle its radius the initial/final angle i.e., the "natural" way an arc is defined, ...
niels's user avatar
  • 3,275
82 votes
2 answers
21k views

"Single ampersand used with wrong catcode" error using tikz matrix in beamer

I am having trouble getting a basic example of a matrix of notes to show up in my beamer presentation. I am using the code copied from the pgf manual. Here is a complete working example. The error I ...
user avatar
80 votes
3 answers
53k views

3D bodies in TikZ

Is there like a library that has default geometric figures like the ones shown below. Am not acquainted yet with 3D diagrams in TikZ.
azetina's user avatar
  • 28.7k
74 votes
3 answers
26k 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 ...
Jake's user avatar
  • 231k
58 votes
2 answers
33k 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 ...
Uiy's user avatar
  • 6,072
57 votes
6 answers
16k views

How can I draw an arc from point A -> B on a 3D sphere in TikZ?

I'm basing myself on http://www.texample.net/tikz/examples/spherical-and-cartesian-grids/ and now I need to add a arc from point P to Q. What I was able to get so far: \begin{tikzpicture}[scale=1,...
mhk's user avatar
  • 673
50 votes
3 answers
16k views

Drawing heatmaps using TikZ

Introduction I want to create a heatmap using TikZ. You can see the basic idea in the picture below: I basically have a table of values and each value is assigned a color. The picture is the result ...
Manuel's user avatar
  • 687
72 votes
12 answers
27k views

How to draw a torus

Is there an easy way to draw a contour image of torus below with tikz? Or for that matter with any other graphics package.
Caramdir's user avatar
  • 88.3k
43 votes
4 answers
18k views

Problem with babel and tikz using \draw

I'm trying the next code: \documentclass[pdftex,spanish]{article} \usepackage{babel} \usepackage{tikz} \begin{document} Simple arrow: \begin{tikzpicture} \draw[->] (-1.5,0) -- (1.5,0); \...
Mario's user avatar
  • 645
31 votes
3 answers
2k views

Is there a TikZ equivalent to the PSTricks \ncbar command?

Although I now use TikZ, every so often I find myself looking for very useful PSTricks commands which don't seem to exist in TikZ. The pst-node package has an \ncbar command which allows one to ...
Alan Munn's user avatar
  • 215k
322 votes
7 answers
343k 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 ...
Jack's user avatar
  • 3,323
77 votes
8 answers
86k views

What is the easiest way to draw a 3D cube with TikZ?

I'm trying to find the easiest way to draw a 3D cube (it's for my UML diagram) with TikZ. Could you please give an example? Like this:
yegor256's user avatar
  • 11.7k
38 votes
1 answer
10k 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? ...
Psirus's user avatar
  • 5,815
10 votes
8 answers
14k views

Draw an aircraft with Tikz

I want to draw a plane using the Tikz tool. You will find, attached, a screenshot.
physics's user avatar
  • 1,209
116 votes
4 answers
29k 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 ...
SSilk's user avatar
  • 3,722
27 votes
4 answers
4k views

Problem with defining shortcuts for TikZ matrices

For answering a question yesterday I wanted to define a shortcut for creating a matrix inside a tikzpicture. As a minimal example, consider \newcommand\mymatrix[1]{ \begin{tikzpicture} \...
Caramdir's user avatar
  • 88.3k
93 votes
8 answers
49k views

What You See is What You Get (WYSIWYG) for PGF/TikZ?

Are there any WYSIWYG editors for PGF/TikZ? Perhaps something similar to LyX but for PGF/TikZ? If there is no WYSIWYG editor for this tandem, is there one perhaps that allows the user to easily ...
Amelio Vazquez-Reina's user avatar
85 votes
2 answers
68k views

Positioning relative to page in TikZ

Consider the following: Let's say I have a dot. I would like to be able to position this dot anywhere on the page: at the corner, in the middle, anywhere. So far, despite poring over manuals and ...
Paul's user avatar
  • 1,413
40 votes
2 answers
7k views

Stroke with variable thickness

Can you create lines with variable thickness (line width) in Tikz?
Regis Santos's user avatar
  • 14.3k
25 votes
2 answers
15k views

TikZ: Line with large dots

Is there a simple way to draw a line like with \draw[dotted] (0,0) -- (1,0); but with larger (radius about 1mm) and more distant (about 4mm) dots? I've looked in the TikZ & PGF manual, section "...
siegi's user avatar
  • 907
17 votes
2 answers
3k views

Problem with overlay when a tikzpicture is inside another tikzpicture

update i discovered lately this question where Nickolay Kolev uses \tikz inside a tikzpicture environment. A lot of users think that is a wrong practice and I agree that is very strange but sometimes ...
Alain Matthes's user avatar

1
2 3 4 5
166