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.
130
votes
3answers
16k 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 ...
44
votes
2answers
5k 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 ...
92
votes
6answers
20k 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?
41
votes
5answers
20k 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 ...
55
votes
5answers
9k 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 ...
14
votes
2answers
2k views
Mindmap tikzpicture in beamer (reveal step by step)
I want to include a tikzpicture (mindmap) in beamer and I want, that the childs appear one after another.
So I use \visible but it don't works -- also not with \pause command. I get errors regarding ...
26
votes
6answers
9k 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 ...
23
votes
6answers
2k views
+500
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}
...
21
votes
4answers
2k 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}) ...
50
votes
10answers
15k 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 ...
21
votes
2answers
876 views
tikzmark to have different behaviour if first run (and mark locations not yet available)
The macro \tikzmark has been incredibly useful to me, but do not like the default behavior upon first run.
So, I would like to be able to determine if this is a first run (where there coordinates of ...
15
votes
1answer
1k views
Background coloring with overlay specification in algorithm2e + beamer package
I want to highlight some portion of my pseudo codes in my slides during the course of presentation. It's easy in powerpoint and I've made a sample slide:
However, I couldn't manage to get a similar ...
46
votes
7answers
12k 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 ...
19
votes
3answers
2k 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
...
19
votes
1answer
7k views
Export eps figures from TikZ
Section 32 Externalization Library of the pgfmanual (v2.10) explains how to generate PDF figures and EPS figures. I successfully tried it with PDF output (there is an example with a full explanation ...
34
votes
1answer
3k 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 ...
122
votes
9answers
12k 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}
...
57
votes
4answers
3k 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 ...
29
votes
3answers
5k views
pgfplots: how can I scale to text width?
This question led to a new package:
tikzscale
When I try to scale a plot with: width=\textwidth there is some horizontal space between the
start/end of the plot and the start/end of the ...
35
votes
4answers
4k views
How do you draw the “snake” arrow for the connecting homomorphism in the snake lemma?
How does one draw the "snake" arrow for the connecting homomorphism when using the snake lemma?
I'd also be interested in drawing similar arrows act as "carriage returns" when considering a long ...
24
votes
2answers
1k 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 ...
10
votes
2answers
665 views
Highlighting in beamer using TikZ nodes
Is it possible to alter the code in the following MWE to the effect that “ABCD” is visible on both slides but only on the second it has the red node as background?
\documentclass{beamer}
...
16
votes
9answers
2k views
TikZ: changing colour of a path half way along
Here's the problem:
\documentclass{minimal}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
[scale = 3,
foo/.style={line width = 5pt}]
\draw[foo,red] (0,0) -- (0,1);
\draw[foo,blue] (0,1) -- ...
11
votes
1answer
2k views
TikZ \foreach loop with macro-defined list
I have a small problem with the TikZ \foreach loop whenever the list, over which we loop, is defined my a macro. The following code example will show my problem:
\documentclass{scrartcl}
...
8
votes
2answers
582 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 ...
44
votes
4answers
2k 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 ...
41
votes
10answers
5k views
35
votes
2answers
4k 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 ...
60
votes
3answers
2k 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 ...
20
votes
4answers
1k 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) {};
...
26
votes
2answers
6k 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 ...
15
votes
2answers
2k views
How do I add an image in the upper, left-hand corner using TikZ and graphicx
This is perhaps a simple question with a simple answer, but I'm stumped as a tikz novice. What would be the best method to add an image (logo) file to the upper left-hand corner of my document?
...
18
votes
2answers
2k views
Using opacity in TikZ causes strange rendering in Acrobat.
I have a problem using opacity in TikZ. Whenever I use it somewhere in a picture,
I get weird side-effects: colors in (some) other parts of the documents are changed apparently randomly and it makes ...
26
votes
3answers
2k views
Applying a postaction to every path in TikZ
Sometime, for example in a solution to a recent question, one wants to apply a postaction (like a decoration) to a group of paths. A naive solution is to use every path/.style={}. Unfortunately this ...
18
votes
2answers
2k views
Unknown error using tikz matrix of nodes 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 ...
9
votes
1answer
1k 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 ...
71
votes
8answers
5k 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 ...
67
votes
8answers
3k 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}
...
13
votes
1answer
4k views
Absolute positioning in beamer
It's easy to absolute position something using remember picture with TikZ, but it only works with pdfLaTeX.
I can get something working by using negative vskip and hskips (trial and error), but that ...
11
votes
1answer
3k 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 ...
9
votes
2answers
1k 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}
...
12
votes
2answers
2k views
Is plotting exponential graphs a known source of bugs in TikZ?
I want to plot $y = 2^x$ over a small domain. Unfortunately, even though tikz (v 2.1) seems to be able to calculate 2^{negative numbers} it is not plotting them correctly.
My minimal example is:
...
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. ...
45
votes
5answers
4k 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 ...
38
votes
6answers
2k 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 ...
23
votes
1answer
3k views
TikZ matrix as a replacement for tabular
I would like to use TikZ matrices to for some drawings. I am currently using nodes and positioning them manually to simulate a tabular. That helps in positioning arrows and shading.
However, if I ...
19
votes
4answers
3k views
Faded drop-shadow using tikz-based rounded rectangle?
Background
Epigraphs are in a box with rounded corners. The boxes have a drop-shadow.
Example
Picture #1 shows a shadow, while Picture #2 shows a shadow that fades out (soft blur):
Problem
...
23
votes
2answers
972 views
Parametrize shading in table through TikZ
I wanted to do some shading in a table according to its values. For example, if you see the table below:
a b c d
a 90 10 0 0
b 0 80 10 10
c 0 0 95 5
d 0 10 5 85
I want to ...
10
votes
3answers
305 views
Macro to access a specific member of a list
I want to be able to have a macro access a specific element of a list. The following code works, however requires me to have two separate macros: one that accepts a list, and the other that accepts ...
6
votes
3answers
688 views
use of tikzpicture matrix in align or gather environment
So far I have found using the matrix command in the TikZ package is the only way of drawing a T-shape around the bottom row and middle column of entries in a matrix. I now need to use this matrix in ...
