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)

5
votes
1answer
378 views

Figure-macro with TikZ: account for y-axis labels

How can I account for the space taken by the y-axis labels? Can I somehow \setbox the axis labels, or something similar? Because now, the y-axis labels stick out of the text block width (because I ...
82
votes
5answers
23k 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 ...
9
votes
1answer
2k views

Why does setting the paper size with KOMA-Script require TikZ?

Maybe I am just too tired, but I simply can't explain what is going on. The file \documentclass[a5paper]{scrbook} \usepackage{lipsum} \begin{document} \lipsum \end{document} produces A4 sized ...
4
votes
1answer
905 views

How to make tikz center the cells of a matrix?

I want to construct complicated things in tikz matrices (but don't we all), and when I'm done, I want the rows and columns of the matrix to align along the centers of these complicated things. Here ...
5
votes
1answer
2k views

Tikz with positioning does not work with DVI

I have the following Tikz picture: \begin{tikzpicture} \node (a) {A}; \node [below=2cm of a] (b) {B}; \end{tikzpicture} When I compile this code with PDF-LaTeX, I get the expected result: "B" ...
24
votes
6answers
12k views

Package for pie charts

I want to create a pie chart in LaTeX. Do you know a package which manages that? I tried datatool which uses tikz as backend but seems to be unusable due to mysterious floating point errors.
4
votes
5answers
253 views

How to delete a locally installed version of pgf?

I have a locally installed pgf in my local texmf tree. Now my tex distribution finally caught up and the version of pfg in the package manager is newer than my locally installed version. How can I ...
2
votes
1answer
876 views

Problem with installing current version of TikZ.

I have installed Texlive 2010 on Ubuntu 10.10 from .iso image. now I want to upgrade my pgf. After following these steps, I receive this error: ! I can't find file `pgfmathfunctions.code.tex'. l.16 ...
24
votes
2answers
2k views

Defining a new environment whose contents go in a TikZ node

I would like to define an environment which typesets the contents in a box, and I'd like to use TikZ (I'm aware of alternatives like fancybox). So I would like something like \newenvironment{abox}% ...
3
votes
2answers
660 views

Where do I find the pgf manual v2.00?

This might be a very stupid question, but I don't manage to find the pgf manual v2.00. On CTAN I only found v2.10. (I'd like to find it because I want to follow Andrew's comment to this great answer.) ...
10
votes
1answer
4k views

Scaling “node distance” in tikz

Well, here's another TikZ question; this time, I have no idea how to find an answer. I would like to give all my nodes with relative coordinates: \node (A) {A}; \node (B) [right = of A] {B}; using ...
38
votes
2answers
3k views

Is there a tikz style for putting math in all nodes?

I'm finally trying out TikZ and am already infected with its programmatic philosophy. I would like to be able to do something like every node/.style = {math mode} (which is wrong) so that I can ...
5
votes
4answers
8k views

Using calc in TikZ

How to use function calc in TikZ? For example, suppose I have a function f(x)=x^2. Now, I want to find f(1) and f(2), and then I want \draw f(1) -- f(2);.
145
votes
8answers
44k 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?
24
votes
3answers
1k views

How can I work around this TikZ bug: (\x)^2 and \x^2 produce different results in TikZ plot?

I have some files with TikZ graphics that have suddenly changed appearance since I upgraded to PGF-2.10. Here is a minimal example: \documentclass{minimal} \usepackage{tikz} \begin{document} ...
16
votes
3answers
721 views

LaTeX equivalent of ConTeXt buffers

While creating a series of graphics (using TikZ) in ConTeXt, I frequently use ConTeXt's buffer to "copy-paste" code. Is there a LaTeX package that implements this feature? Since most LaTeX users may ...
10
votes
1answer
3k views

Controlling the amplitude of the snake function in TikZ

I have been using TikZ with some success, but I can't figure out why the following code doesn't produce anything: \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.pathmorphing} ...
23
votes
2answers
1k views

naming paths inside a TikZ foreach loop

Is it possible to create named paths inside a foreach loop with the name depending on the counter? I want to write something like \documentclass{article} \usepackage{tikz} ...
2
votes
2answers
209 views

How can I make RHEL server libraries compatible with tex/Rnw documents created on my Ubuntu desktop, re: pgf, tikz, expl3

I want to compile tex and Sweave documents written on a server that is redhat, but I get errors linked to pgf/tikz. The documents compile fine on my I have already used wget to download the expl3 ...
11
votes
2answers
5k views

Path From and To Same Node in tikz Flowchart

I'm working on creating flowcharts directly inside LaTeX documents using tikz. I am admittedly an extreme novice with tikz, although I have quite a bit of experience using LaTeX. My problem is when ...
7
votes
1answer
1k views

Fading a path in TikZ

I want to draw a path/plot in TikZ whose shade depends on the coordinate. For example, I want say something like \draw[color=black!\x] plot coordinates{ coord1 ... coord100}; i.e. the shade of the ...
17
votes
3answers
1k views

TikZ: “skipping” levels when drawing trees

I'm interested in using TikZ to draw rooted trees whose leaves should all be on the same level, pretty much like this: Please don't pay attention to the fancy style and colours, I'm only interested ...
12
votes
4answers
2k views

Aligning an enumeration item to the top of a tikzpicture

I've drawn a tree using pgf/tikz and am trying to place it in an enumerated list. A snippet of my complete code is as follows: \subsection*{Problem 2} \begin{enumerate}[1)] \item Max heap \item ...
15
votes
2answers
2k views

Placement of arrowtips with TikZ’s markings

With the decoration library it is possible to place arrow tips at arbitrary positions along a path. TikZ places the front end of the arrow at the specified position, which is often exactly what one ...
16
votes
4answers
1k views

Tikzpicture on every page

How can I include a tikzpicture on every page? I would like to create a complicated document template (page should be framed, and have a table to hold document information both in the header and ...
18
votes
1answer
997 views

Is it possible to clear tikz/pgf options?

According to the pgfmanual, setting options on a clipping path is Not Allowed, so \clip[fill=red] (0,0) circle (1); doesn't work. That's all very well, and the above is certainly avoidable. ...
9
votes
2answers
5k views

PGF/TikZ and Sans Serif Fonts

I have a TikZ/PGF file created directly by a graphing package of the form \begin{tikzpicture}{dimensions} ... \end{tikzpicture}. The file uses \pgftext[...]{\selectfont{Some text here or ...
12
votes
6answers
6k views

A good tool to make electronic schematics and export them vectorially?

I have to make a relative simple diagram and import it to latex vectorially. What would you recommend me to do this? This question might not be best asked here, but I suspect a lot of you have ...
2
votes
1answer
279 views

Does \pgflowlevel{\pgftransformscale{}} do the same as normal tikz scale?

I am wondering the following. Somebody made a complicated tikz figure (our university logo). Now I am having troubles, because the width and height latex is reporting are not the 'real' width and ...
11
votes
4answers
3k views

Fitting a list of points with TikZ and its \foreach

I have a list of N points (e.g. {(0,0),(42,7),...,(0,1)}). I want to use them as coordinates in TikZ, to draw some things. And I would like to fit them into a node (using TikZ's fit module (cf. ...
9
votes
2answers
977 views

How to use the results of `raw output` to create a smooth plot

As by my previous question on plotting an implicit curve I've got some output. But as you can see it is not quite what it should be (apart from your browser's downscaling by a factor 2 of course. ...
14
votes
3answers
2k views

Plotting an implicit function using TikZ

How could one plot an implicit function, like (x^2+y^2)^3-4x^2y^2 using TikZ? I know gnuplot supports them, but they are drawn using a surface built from the function and intersecting the result with ...
7
votes
3answers
674 views

Why do I have so much free space on the left-hand side of my tikz diagram?

Inspired by http://tex.stackexchange.com/questions/3892/ I created my own snake like diagram (see below). The entries are rather large and the figure thus too wide. My question is: Why does the ...
11
votes
2answers
8k views

Tikz/Pgf if statements

I'm having trouble writing if statements, I can find next to no documentation on them and what I want to do seems quite simple. I'm using the orbitals pgf/tikz example from here, and I'd like to ...
6
votes
2answers
3k views

How can I upgrade to pgf 2.10

http://sourceforge.net/projects/pgf/ shows that 2 days ago (25 Oct 2010) version 2.10 of PGF (Tikz) is released. I am currently using texlive 2010. Will pgf 2.10 come in texlive 2010, or do I have to ...
6
votes
1answer
610 views

What is new in pgf 2.10

http://sourceforge.net/projects/pgf/ shows that 2 days ago (25 Oct 2010) version 2.10 of PGF (Tikz) is released. What are new functionalities in this version? (not bugfixes, but features)
18
votes
5answers
3k views

Is it possible to reuse a part of a tikz image

I have a part of my plot that I want to repeat several times. To be exact, the part I want to replicate is: \draw[yscale=2.0,yshift=-3,xscale=0.1,domain=0:10] plot[id=gauss1] ...
3
votes
1answer
779 views

Why does my loop not show?

I have a big picture made, but I can't get my nodes to get a loop (an arrow to itself). My code: \begin{tikzpicture} \matrix (mat) [matrix of nodes] { |[draw,circle]|$(0)$ &[10mm] ...
21
votes
2answers
2k views

TikZ: multiple decorations on a path.

I would like to draw a squiggly line with an arrow somewhere in the middle of it. TikZ has a pathmorphing decoration that draws a squiggly line and a markings decoration to place an arrow tip. So a ...
80
votes
3answers
39k 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 ...
23
votes
2answers
2k views

Getting a tikz picture to have an equation number

I make a lot of commutative diagrams and am trying to switch to Tikz from amcd,diagrams, etc. I often have to refer to these diagrams in the text and would rather have them as equations (i.e. with and ...
3
votes
1answer
572 views

Help me upgrade to PGF 2.0?

I just installed MacTeX 2010 yesterday, so I'm running TeXLive 2010. I need to upgrade my installation of PGF to 2.0 from 1.18, which is what comes standard with the MacTeX distribution. Could someone ...
12
votes
5answers
3k views

Modular arithmetic on node names in TikZ?

Say I have a bunch of nodes I've already created in TikZ---maybe v0, v1, ..., vn-1. I'd like to connect certain of these nodes in a systematic way, by doing arithmetic on the indices, ideally mod n. ...
15
votes
1answer
17k views

How can I change the legend's location in a pgfplot?

For a report I am preparing several figures that I exported from Matlab using the matlab2tikz script. However, the location of the legend does not please me. Here is an example plot: I want to move ...
4
votes
1answer
5k views

TikZ failing to draw [closed]

I'm trying to use TikZ to make flow charts in my LaTeX files, but I'm getting an error. Here's the LaTeX I'm using: \documentclass[11pt]{article} \usepackage{tikz} \begin{document} Some text ...
14
votes
1answer
3k views

Cycle option when drawing between nodes in TikZ

Cycle lets you close curves when drawing, and \coordinate (a) at (0,0); \coordinate (b) at (1,0); \coordinate (c) at (0.5, -1); \draw (a) -- (b) -- (c) -- cycle; works fine. Shouldn't also \node ...
2
votes
1answer
914 views

How do I use \pgfextractx, \setlength and so on together, to achieve a task using paths?

The following code attempts to absolutely position two nodes with rectangular outlines, then draw a line that goes from the right-hand side of one to the left-hand side of the other, along orthogonal ...
4
votes
1answer
215 views

Why do these two tikzpictures result in different output?

The following document has two tikzpictures in it, and they result in slightly different output. Why is this? I don't understand how the use of draw works in one but not the other. In the first one, ...
40
votes
4answers
6k 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 ...
8
votes
1answer
1k views

chemical laboratory equipment

I want to include some drawings with Erlenmeyer flask, Bunsen burner and so on in LaTeX. I browsed the texample.net gallery. I found some examples for chemical structures, molecules and so. But I ...