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)

7
votes
1answer
747 views

How to prevent a jumping picture when using tikz overlays

I have the following tikz picture in Beamer \usetikzlibrary{fit,calc,positioning,matrix,decorations.pathmorphing} \begin{tikzpicture}[scale=0.8,system/.style={draw,rectangle,rounded corners=3,minimum ...
10
votes
2answers
2k views

Why does fit not scale? (tikz)

I have a problem with the fit library in TikZ. When I scale the figure (with the tikz scale command), the fit box doesn't! Why is that? Could I somehow change it? Example: \documentclass{article} ...
4
votes
2answers
1k views

Fit around nodes and edges

I know that I can use the fit library of tikz to get a fitted background behind some nodes. How can I get the fit to be around edges as well? My current code: \begin{tikzpicture}[prefix=fig/, ...
7
votes
1answer
9k views

How to Label and Caption a Tikzpicture inside a tabular environment

What is the correct way to label and captionize a tkizpicture inside a tabular environment? (Since figures are not allowed inside a tabular) Excerpt from my .tex: \begin{tabular}{l r} & ...
5
votes
3answers
968 views

How to draw protocol interaction using tikzpicture

I have a question on using the tikzpicture package. I have a protocol interaction on which two participants want to exchange some numbers, say α and β. I need bilateral arrows, and on top of it would ...
57
votes
5answers
5k 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 ...
2
votes
1answer
1k views

Did I install a package successfully?

On my Ubuntu system, I have already installed texlive-full under /usr/share from long time ago. I just tried a simple example with \usepackage{tikz} and it did work fine. Later, I added ...
11
votes
3answers
7k views

How to plot polygon using TikZ

I would like to plot a 2D $x_1 - x_2$ coordinate system and a shaded polygon specified by $ −3x_1 + 4x_2 \leq 4, 3x_1 + 2x_2 \leq 11, 2x_1 − x_2 \leq 5, x_1 , x_2 \geq 0 $ How to draw this ...
11
votes
1answer
3k views

multiple legends in pgfplot

The problem: I have plots with 8 lines, and need to put the legend for all 8 lines into the plot. The document format is IEEE, and the plots need to fit in the single column. The current solution: ...
8
votes
2answers
3k views

TikZ: Cropping the Bounding Box

A graphing program I use has support for TikZ output. It generates a \begin{tikzpicture} ... \end{tikzpicture} which I can include in my document. The problem, however, is that it appears to insert a ...
27
votes
1answer
19k views

How to make bend lines/arrows with TikZ?

I've been testing out TikZ lately, but I'm still quite new to it. What I want to do is to create a line to indicate that a parameter belongs to a part of the drawing. For example "This surface that ...
7
votes
3answers
547 views

Passing options to a macro

Background We're developing an automated graph drawing framework for TikZ with LuaTeX. The TeX interface on the pgf layer is nearly done, the next step will be the TikZ Layer. The maker of TikZ, Till ...
14
votes
4answers
3k views

How to automatically draw a graph in LaTeX

clarification: when I say "graph", I mean the computer science term. I want to draw a full binary tree of h height. It means that there's one root with two sons, each son has two sons and so forth. ...
16
votes
2answers
6k 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 ...
8
votes
1answer
5k views

How to shorten the length of an arrow?

I use tkz-graph.sty from Altermundus. When I make an arrow from vertex A to vertex B, the arrow is too long: it goes from the center of A to the center of B. Can I shorten the arrow on both ends by a ...
39
votes
2answers
12k 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 ...
4
votes
2answers
3k views

Drawing switches in circuitikz with connectors (dots)

I'm trying to draw an example of the logical operation of a logic gate for an analog electronics report. In the following code: \begin{circuitikz} \draw (-3,0) to[battery] (-3,2); \draw (-3,2) ...
19
votes
2answers
19k views

Hide tick numbers in a TikZ/PGF axis environment.

I have a TikZ/PGF axis enviroment where by default numbers are shown along the ticks. I want it to look like this: (Axis without tick numbers) I found out how to modify the ticks itself using ...
4
votes
1answer
2k views

Different switch symbols in circuitikz?

I'm wondering if there are other commands associated with the switch symbol so that one doesn't have to specify if the switch is open or closed. I would like the switch symbol with two connectors and ...
5
votes
1answer
948 views

Drawing paths with TikZ from a DB with DataTool

I have written this code and it works: ... \DTLsetseparator{;} \DTLloaddb[noheader]{DBcurva}{Curvas.csv} \begin{tikzpicture} \foreach \columna in {1,3,...,\DTLcolumncount{DBcurva}}{ ...
3
votes
2answers
532 views

Unexpected tikz/counter behaviour

What I've been trying to do, futilely, is to use the foreach[counter=\xi] x in {1,2,3} statement in tikz/pgf with LaTeX. This fails, every time. Whatever. So I moved on to trying to use a counter, ...
4
votes
1answer
1k views

Tikz array as argument

Problem I'm drawing flow diagrams in Tikz, and they basically include a header, followed by a list of flow components set below an arrow. I've written functions to take arguments in Tikz before, but ...
6
votes
1answer
1k views

Using `easybmat` and `beamer` together

I've written an article using the easybmat package and now it is time to create the beamer slides....however, as you can see here, in order to load both the easybmat and tikz (or pgf?) one needs to ...
5
votes
1answer
379 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 ...
85
votes
5answers
26k 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
953 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" ...
25
votes
6answers
13k 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
263 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
937 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
662 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);.
154
votes
8answers
52k 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
2k 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
746 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} ...
24
votes
2answers
2k 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
215 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 ...
12
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 ...
19
votes
3answers
2k 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 ...
16
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
1k 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
6k 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 ...