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)

23
votes
5answers
3k views

Lower and upper Riemann sums

I am trying to create a few images for educational purposes. Therefore I need to be able to illustrate the area under various functions, using lower and upper riemann sums (rectangles) Reason for not ...
13
votes
2answers
1k views

Draft mode in Tikz externalize hides graphics, but not without externalize

Maybe this is expected behaviour, but it's not documented in the manual, and it certainly surprised me. When you use the draft class option and use the tikz external library, all Tikz pictures are ...
11
votes
1answer
938 views

How to use \pgftransformcm and \inheritsavedanchors in a new shape (batman) from an ellipse

I try to make this shape but I have several problem. First to place the logo inside the ellipse, I used \pgftransformcm{1}{0}{0}{1}{\centerpoint} perhaps there is a better solution. I need to use ...
28
votes
3answers
7k 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 ...
16
votes
2answers
2k 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 ...
6
votes
1answer
2k views

How to typeset a TikZ picture inside a node?

The contents of a node are drawn in text mode. Is there a way, short of introducing a tikzpicture environment, to draw a picture inside a node? Nesting tikzpicture environments is problematic, also ...
2
votes
1answer
383 views

TikZ does not use square coordinates but polar one, how to change it in order to use Cartesian coordinates?

Consider the following: \begin{tikzpicture}[thick,scale=0.8] \node (v0) at (0,0) [label=right:$\emptyset$] {}; \node (v1) at (40:-2) [label=right:$v_1$] {}; \node (v2) at (70:-1.6) ...
32
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. ...
6
votes
1answer
251 views

Usage of a saved dimension in another saved dimension in a \pgfdeclareshape command

I have a question about \saveddimen usage inside of a \pgfdeclareshape command. My code is as follows: \documentclass{article} \usepackage{tikz} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % ...
7
votes
2answers
1k views

Figures in Latex: TikZ vs. eps

I usually use TikZ to generate graphics in LaTeX, but a new coauthor suggested to use Inkscape and EPS files for our graphics. He thinks that we should avoid using additional packages. I never thought ...
8
votes
3answers
755 views

How to create integer labels on TikZ grid when we don't know the grid size at compile time?

I want to put integer labels on the grid. The grid size depends on the image loaded. The real scenario is to vectorize a JPG image but I need a grid label for navigation as follows ...
7
votes
5answers
2k views

TikZ Node with multiple shapes

My use case is drawing a ticked box in line with normal text like this: "Hello ☒ World." (unicode example, your mileage may vary). One solution I managed to come up with is the following rather ...
5
votes
1answer
492 views

How to connect different own TikZ macros together + default names of node

I will ask you for solution about a little bit more complex problem. Maybe it isn't so hard as it seems to be but, for me it is hard one. Let's say that i want to create four own macros \objecta, ...
4
votes
1answer
1k views

Can't find TikZ library calc

I've been googling for some time now, and can't find the manual for the TikZ library calc. All I see is people using it. Where can I find the manual or some info? Is it the same as the LaTeX package ...
17
votes
2answers
6k views

What is the preferred way of defining a TikZ constant?

I'm drawing a TikZ figure and am going to need a couple of constant that I could easily change between compilations, e.g. a main radius, a proportion, a number of lines, etc. What is the preferred way ...
5
votes
1answer
445 views

What does the colon in Tikz coordinates mean?

\draw (0,0) -- (60:.75cm) arc (60:180:.75cm); What does the colon in (60:.75cm) mean? Normally, I'd define a normal point there.
3
votes
2answers
1k views

latex code for graphing rational function

I've seen in TikZ and pgf Manual for version 1.18 a code for graphing some functions but it does not provide an example for a rational function. Can someone help me graph $x+\frac{1}{x}$?
3
votes
1answer
566 views

tabular as matrix

I have the attached figure and I need to have arrows from the entries of the table on the right-hand-side (one which says Dimensions List DL) to nodes of the tree. I think the best way to do this is ...
6
votes
1answer
759 views

How to “fix baselines” in tikz nodes?

I want to define nodes which are shapes with some text in it using \ce{} from the mhchem package. How would I go around ensuring the baselines are the same between nodes, right now it shifts if I use ...
7
votes
2answers
1k views

How can I draw irregular shading area with tikz?

How can I draw with tikz the irregular shaded area and (similarly?) the irregular frame around nodes like the ones in the image?
9
votes
2answers
3k views

Is it possible to apply a style to all (tikz) rectangles?

I know that it's possible to apply styling to all tikz nodes or paths, as in the following example: \tikzset{ every node/.style={ text=red }, every path/.style={ ...
5
votes
3answers
621 views

How to scale and clip a path at the same time?

Again, i started a question here, and i found the solution. But i think this method maybe useful for others. The problem: i exported the TikZ code of one path from Inkscape; then, i wanted to use it ...
6
votes
1answer
419 views

Pass options to the scope that is internally created by preaction

In the reply to this question on shadows, it was suggested to use the backgrounds library so that the shadow of one object doesn't overlap another object drawn previously. If I understand the ...
4
votes
3answers
1k views

Tikz,PGFplots: drawing in node's cs placed on plot

I'm trying to place some arrows which should be placed alongside the graphs. I place nodes on the graph using node[pos=0.2,above] (point1) {} Then I want to draw in that coordinate system \draw ...
23
votes
2answers
3k views

Is there a way to compile tikz graphics outside a document?

As my document grows, so does the number of drawings. I am using PGF/TikZ and each drawing is what is enclosed between \begin{tikzpicture} and \end{tikzpicture}. Every time the document is compiled, ...
3
votes
1answer
466 views

Grid customized

I would like to build a grid such as the figure shown below where each grid point is surrounded by some of the two curves that describe below. First curve: an outline around the point forming a ...
6
votes
1answer
2k views

TikZ: Large arrow tips at the end of smooth curves

I have problems with adding a large arrow tip to smooth curves. It works perfect with straight lines, but as soon as I use the edge command, the arrow tips are added to the beginning of the curve ...
36
votes
2answers
5k 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: ...
6
votes
3answers
2k views

tikz connection label and node distance

Is it possible to have tikz automatically determining the distance between two nodes based on a third node used to connect them? For instance, in the following picture the arrow used to connect the ...
11
votes
4answers
1k views

Tikz, tangent between two circles

I am trying to create the image below Here is my code \documentclass[10pt,a4paper]{article} \usepackage{tikz,tkz-euclide} \begin{document} \center \begin{tikzpicture} \tkzDefPoint(0,0){O} ...
19
votes
1answer
503 views

What are most important variables set at the beginning of a tikzpicture? of a scope?

I asked a lot of questions about nested tikzpicture environments and if I agree with Andrew and Martin that nesting TikZ pictures isn't a good idea, it's interesting to know why. I gave some examples ...
7
votes
1answer
1k views

Mathematica code into TikZ code

In my search to understand the creation of a guilloche and in relation to my post Recreating a guilloche with TikZ, I came about the code below, Guilloche[a_, b_, c_, d_, e_, f_] := ...
41
votes
5answers
2k views

How do we Draw a Bird in LaTeX

Yes, it's that time of the month again. It's time for somebody to ask how we can draw X in LaTeX. This time I'm asking the question and X is a bird. The reason why I'm interested in this question is ...
5
votes
2answers
5k views

Axis tick numbers overlap in TikZ

The following code can be used to create a TikZ plot: \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[% view={0}{90}, scale only axis, ...
7
votes
1answer
262 views

Why do some arguments in a macro need to be preceded by \noexpand?

I keep on studying the use of nested tikzpicture environments (sorry) and I discover the next problem. I'm not sure but it sounds like a problem with "fragile" commands. Perhaps, the problem is the ...
3
votes
2answers
394 views

Is there a way to make ChkTeX ignore TikZ code

ChkTeX does not like TikZ, and will report a bunch of errors. Is there a way to make ChkTex ignore TikZ code?
1
vote
0answers
3k views

pgfgantt: Can't get the examples work correctly [closed]

I need to make some Gantt Diagrams for a budget, and found on the web the pgfgantt package, which looks amazing. Unfortunately I can't make it work correctly with the examples of its documentation. ...
3
votes
1answer
824 views

Example of matrix node in trees in tikzpicture

I'm trying to recreate this image using tikz matrices in a tree. I can create the first node and can hook up to children, but I can't get the syntax for including more matrices as child nodes of ...
4
votes
1answer
1k views

tikz: connecting to a rectangle split shape

I want to draw a simple diagram using tikz to show the structure of a compiler front end. The compiler is being represented with a node using rectangle split shape containing three parts. The input ...
12
votes
1answer
5k views

tikz and beamer: shape rectangle split example from manual

The pgf manual has an example using the shape rectangle split on page 450 that is not working with the beamer class: \documentclass{beamer} \usepackage{tikz} \usetikzlibrary{shapes.multipart} ...
11
votes
5answers
2k views

Making a 3D colored pyramid in tikz

I am trying to recreate the following image in tikz Sorry for not including a MWE, but I have problems getting started drawing this. I tried simply writing in the coordinates, but even that turned ...
1
vote
1answer
1k views

How to include PDF absolute positioned and scaled?

Actually i started to write this question, but during the writing i discovered the answer. Althougth this information may useful also for others, so i send this question, after i'll answer it. I'm ...
6
votes
1answer
868 views

How do I make a path with a custom head in tikz?

I want to make a half circle border, as an arrow head in a tikz diagram. Does anyone have an idea how to make this style?
11
votes
2answers
1k 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 ...
11
votes
1answer
201 views

How can I check if the current code is inside a tikzpicture?

I read the answer for this question (inside a environment) but I would like to know if there is something more specific. LaTeX keeps the current environment in the macro \@currenvir but how do the ...
8
votes
5answers
1k views

Clipping a path using a node

I've searched, but I can't find a previous question sufficiently close to this one to find an answer. At the same time, this problem seems like it must have been solved by someone before now, so ...
4
votes
1answer
951 views

Alignment of node “groups” in TikZ using `\matrix` or other constructs?

I'm trying to align 2 groups of TikZ nodes but cannot figure out how to do this. I tried wrapping each group with \tikz{...} but that didn't work (probably because of \tikz inside tikzpicture ...
7
votes
1answer
517 views

tikz intersection fails in combination with the library calc

In the second example I am trying to work the the library intersection. It works fine as long as I don't use the calc library. The first example shows my intention. I am using ($2*(w1')$) which ...
4
votes
4answers
1k views

tabular side-by-side

I am trying to get two tabular constructs side-by-side with a tikz figure in between and can't seem to get what I want using the minipage construct. Here is the code I have ...
46
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