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)

9
votes
1answer
763 views

TikZ: Execute code at end of scope OR picture and access its bounding box

TikZ provides the two keys execute at end picture={<code>} and execute at end scope={<code>} which can be used to execute any code at the end of the picture and of the current scope, ...
2
votes
2answers
3k views

TikZ/PGF: I can't find file `tikzlibrarycircuit.code.tex' error

I am trying to use the circuit library from TikZ/PGF 2.1, but get the following error when I call LaTeX: ("C:\Documents and Settings\s0237326\Application Data\MiKTeX\2.9\tex\generic\pg ...
5
votes
1answer
3k views

Probability Tree-diagram with TikZ

Thanks for helping me out. How can I make the following tree-diagrams? http://www.vias.org/tmdatanaleng/cc_prob_cond_independ.html
5
votes
1answer
2k views

Flow (or block) diagram tips?

I've been working on a flow diagram or block diagram using Tikz to show a simplified camera transfer function. I've gotten as far as the code below, but I have a few questions remaining. I started ...
23
votes
4answers
3k views

Pascal's triangle in tikz

I would like to typeset the top part of Pascal's triangle. To get the triangle with the names of the binomial coefficients, i.e., {n \choose k}, I used the following code \begin{tikzpicture} \foreach ...
4
votes
1answer
297 views

How can I pass the body of a TikZ node to a font-changing macro?

After looking around at some other answers on this site, I'm trying to typeset a tree using the tikz-qtree package. It works great, but by design it does not let you use macros in the tree nodes, ...
9
votes
1answer
1k views

Conditional using non-integer numbers

I am trying to generate fractals using affine transformations. I need to generate a random number in the interval (0,1), and depending on the value of this random number choose a function to ...
3
votes
1answer
462 views

Using color variable in TikZ before they are declared

I want to use the color of a path to set the color of the nodes. But I want the nodes to be lighter than the path color. And I want to do this before knowing what the path color will be. Hence, how do ...
7
votes
2answers
2k views

Centering a TikZ picture around an area

I often find myself in the following situation: A tikzpicture of mine consists of a main area and some outer material like text labels which are hardly symmetric around the main area. If such a ...
12
votes
1answer
13k views

How to properly scale a TikZ/PGF picture which has a `\begin{axis}…\end{axis}`

Applying a scale option to a TikZ picture works great. It keeps the text the proper size and scales everything else. I would like to have the same behavior when using a \begin{axis}...\end{axis}. ...
4
votes
1answer
236 views

Determine if within a PGF axis environment

Is there an easy way to test whether a macro is called from within an PGF \begin{axis}...\end{axis} environment? One solution would be to define a new environment myself that sets a flag at ...
11
votes
3answers
1k views

Using relative coordinates in TikZ to draw joined curves

I want to draw the following diagram in TikZ: Currently I use the following code to do this: \documentclass{article} \usepackage{tikz} \usetikzlibrary{snakes,arrows,shapes} \begin{document} ...
5
votes
1answer
406 views

TikZ: pgfutil-common: pgfutil@in@ - how does it work?

Having been writing small lib for TikZ, I tried to use this macro in order to search for @. Code compiled, but the result was false, despite that I was sure it was in tested string. So, I decided to ...
10
votes
4answers
2k views

How to color a region?

The following code \documentclass{article} \usepackage{tikz} \usetikzlibrary{intersections,positioning} \begin{document} \begin{tikzpicture}[radius=5] \draw (0,0) rectangle (5,5); \draw[name ...
12
votes
3answers
11k views

Scale TikZ figure to linewidth when relative positioning used

This question is a follow-up to How to scale a tikzpicture to \textwidth. Unfortunately I haven't been a member long enough to post comments in that thread to ask for clarification. I have some ...
3
votes
2answers
1k views

Aligning multiple TikZ trees with other nodes

This question is directly related to Aligning TikZ trees with other nodes that I asked some time ago. By the time I asked the question I didn't realize that aligning multiple trees was not the same as ...
1
vote
2answers
419 views

Flushing PGF commands and local variable

I think I need a way to flush the PGF commands as the reference to \LabelText uses the last value, and not value at the time of invocation. The macro LabelPoint is intended to replace the first ...
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: ...
2
votes
1answer
5k views

TikZ Coordinate calculation - calculate coordinates separately

I'm trying to calculate coordinates based on existing coordinates but each coordinate individually. The first thing which is unclear to me is how to define scalar variables. I can define coordinates ...
11
votes
2answers
6k views

How to add a node in the middle of the line with tikz?

actually it's an easy question, but I could find an answer with Google or the included search on StackExchange ;) How do I add in the middle of the line a node with Tikz? I want somethink like this: ...
1
vote
1answer
549 views

Export/convert/externalize tikzpicture as LaTeX (picture) code?

I have seen "32.4 Externalizing Graphics" in the Tikz manual, which explains how Tikz images can easily be exported as PDF images using pdfLaTeX. However, I am persuaded I saw somewhere a way to ...
4
votes
1answer
1k views

Does tikz 2.1 no longer work with the preview package?

I used to be able to create png images of diagrams made with tikz code by using the preview package and printing the dvi output from dvips to a png file using ghostscript. The latest version of tikz ...
5
votes
1answer
940 views

How do I include labels using Tikz's fit?

I'm creating a graph using TikZ. It's working fine, but when I try to use the fit to make a background, it's not quite large enough: Notice that the green doesn't cover the labels Gateway and Root. ...
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 ...
21
votes
1answer
1k views

'Poster' fountain pen nib style text

This question led to a new package: spath3 (Technically, this question led to a subpackage of the spath3 package; the spath3 package provides some foundations on which a TikZ library ...
8
votes
2answers
7k views

Decision node on TikZ (diamond)

I'm trying to find a way to tame decision nodes (diamond shape) but I just can't do a thing! If I put a formula inside the diamond and if that formula is a little big the shape just grows like a ...
2
votes
1answer
429 views

Put long formulas on new line/pgf tikz?

Sometimes I have to work with long formulas that can (or I want) not be split over two lines. I'm trying to write a macro that sent the formula at the new line if the formula would go over the margin. ...
12
votes
2answers
4k views

Precompiled preamble with TikZ/Externalize

I'm using the externalize capability of TikZ (external library) to speed up compilation of my TikZ pictures (as explained in Script to automate externalizing tikz graphics). In addition, I would like ...
8
votes
5answers
2k views

Use tikz (for example) to draw pictures in hyperbolic geometry

I would like to draw pictures in the Poincaré disk model for hyperbolic geometry. Are there any built-in or add-on packages for tikz to do this? For example, it would be nice to have functions for ...
6
votes
2answers
3k views

Where to find the gnuplot lua-tikz-terminal?

Where can I still download the gnuplot tikz terminal? I keep winding up at broken links... Or is there another alternative that makes gnuplot output tikz drawings? Oh, and will I be able to get it ...
7
votes
2answers
926 views

Aligning TikZ trees with other nodes

I would like to align a TikZ tree with another node by considering the tree as a whole like as if it was a node with anchors. For the moment I am only able to align the root node of the tree, not the ...
8
votes
2answers
3k views

Nested foreach loop in TikZ

I would like to draw some vector fields on a triangle, and I am using nested \foreach loop to do that, however in the inner loop, you can't use the outer loop variable as the numeric range. For e.g. ...
3
votes
1answer
365 views

tkz-euclide, define points outside of tikzpicture

Is it possible to define points in tkz-euclide outside of the tikzpicture environment? For example I would like to have something like this exercise in elementary geometry: Exercise: Consider the ...
1
vote
1answer
2k views

Taming a TikZ flowchart's structure

After finally solving many issues with this flowchart, I get this... I'm new to TikZ and I'm having a hard time fixing this. I wanted the 5 nodes from row 5 to be inside a box with a vertical ...
10
votes
3answers
3k views

Commutative diagram with rounded arrows

I want to draw a diagram which has some arrows between to points A and B. First arrow goes straight from A to B and above it should be a $\Psi$. Second arrow goes in a round way from A to B and above ...
2
votes
2answers
1k views

TikZ flowchart for a poster

I'm making a poster and need to include a flowchart. I've never done this, so I'm starting with the example in the manual. Problem is, it doesn't work. ! Package pgfbasematrix Error: Single ampersand ...
6
votes
2answers
10k views

How to plot f(x)=sin(x), k(x)=cos(x) and u(x)=x² with TikZ

How can we plot the following three functions f(x) = sin(x) k(x) = cos(x) u(x) = x² for x ∈ [0,1] on a single plot with the help of TikZ?
10
votes
2answers
22k views

Node below and left of another node in TikZ

I am using TikZ to make flowchart kind of diagrams. I want to get a node below and to the left of another node. Please see the following example. I want the replicate the sort of relationship between ...
2
votes
1answer
427 views

How to plot "$f(x,y) = x^2 + y^2$ on $(0,0) \times (1,1)$?

Hello Friends Thanks for your time. Please help in plotting $f(x,y) = x^2 + y^2$ on a unit square with TikZ. Thanks.
1
vote
1answer
695 views

Drawing AND/OR trees in Tikz

Is there a simple way to achieve this type of graph? Obviously a lot neater than this... But the important feature is the join between the two children of P.
14
votes
4answers
2k views

pgffor: Special treatment for last item in \foreach-list

Is there a way for handling the last item in a \foreach-list in a special way. An example might illustrate an application for that: \documentclass{minimal} \usepackage{pgffor} \begin{document} ...
4
votes
1answer
497 views

Why is the left column of this table vertically-aligned to the bottom, no matter how I specify the column?

This document produces a table that mostly looks like I want it to look... except that I can't get the text in the left-hand column to be aligned in the vertical center. What I would really like is ...
5
votes
1answer
881 views

Trying to align external images within a tikz tree

I'm trying to generate a tikz tree that includes images (square pdf's) in the outermost nodes. (incidently, I'm generating these images using R and Sweave on the fly, but that's not pertanent to my ...
8
votes
1answer
1k views

How can I draw a diagram for matrix multiplication with LaTeX?

I'm trying to make a PDF manual for matrix multiplication with LaTeX. I'd like to generate a graphic similar to this one (from Wikipedia/Matrix multiplication): I guess this will be quite a bit of ...
3
votes
4answers
1k views

Draw a nice question mark

I am writing my thesis presentation and would like to put an image of a question mark at the end for questions. Can anyone give me some code for a nice question mark drawing. Requirements: Coded in ...
5
votes
1answer
328 views

TikZ: How to compare approximate equality of dimensions?

When scaling tikzpicture using option scale, some points that had equal coordinates appear to be shifted a little bit. So the precise comparision \ifdim \y1 = \y2 will not do anymore. I'm aware of ...
1
vote
0answers
271 views

tikz bug in the automata package? [duplicate]

Possible Duplicate: Strange arrow mark with TikZ edge and anchors. The following code \begin{tikzpicture} \node (q0) [initial,state] {$q_0$}; \node (q1) [state,right ...
9
votes
1answer
3k views

How to draw a double-color line with tikz

I would like to draw a rectangle with a double color border: the border should be a line dashed with two alternating colors (blue and red, for example). Is it possible?
11
votes
1answer
2k views

Geometric constructions with tikz

Is it possible to do basic geometric using tikz like angle bisectors, bisection of line segments, inscribed circles, circumscribed circles etc.? More in detail I want a command which takes three ...