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)

11
votes
3answers
4k views

Using LaTeX to draw time series graphs and histograms

I have some graphs I drew in maple, some simple line plots and histograms. Now I'd like to redraw these graphs in LaTeX, so I can do fancy stuff in beamer like have one histogram appear, and then ...
16
votes
5answers
8k views

How to make a 3 level deep tree with tikz

I am busy making a full binary tree of three levels deep. The code I am having now is (using the trees library): \begin{tikzpicture} \node {root} child {node {left} child {node {lleft}} ...
15
votes
1answer
3k views

Add a legend title to the legend box with pgfplots?

I am using the awesome pgfplots package to draw some plots. I usually use \addlegendentry and get a nice default legend box. There are some options for legend box placement and layout (e.g. number of ...
4
votes
1answer
426 views

Placement of tokens in tikz/petri

Is there some easy trick to make \node[place,tokens=3]{} place 3 tokens in a row (and not in a triangle)?
7
votes
2answers
704 views

Tikz: Labeling objects and referencing them

According to the Tikz manual I can use "name=" to assign a label to the drawings, but when I do the following: \begin{tikzpicture} \draw [ blue, thick, name=e1] (10pt,10pt) ellipse (50pt and ...
7
votes
2answers
879 views

Animated scrolling marquee across an entire page.

I would like to have a scrolling marquee across the entire width of a page. I am intending this for a Beamer presentation, but the solution doesn't necessarily have anything to do with beamer. I ...
12
votes
4answers
4k views

Why is this let expression not working in TikZ (calculating a midpoint)?

I have a rectangle in TikZ and the top left and bottom right corners are called (topleft) and (bottomright) respectively. I wanted to have a label midway down the left hand side of the rectangle, so I ...
11
votes
1answer
601 views

Resulting document size when Including a graphics file multiple times - pgf vs. graphicx

In his answer to the question Tikz: using external images as building blocks. Stefan Kottwitz says: The pgf way may be preferred if the document size matters and graphics are multiply used or if ...
35
votes
1answer
14k views

Tikz: using external images as building blocks.

I would like to create a custom vector drawing in Inkscape and then use it many times in many tikz pictures. Is it possible? Should I use PDF or SVG or other output from Inkscape? How to use external ...
9
votes
2answers
4k views

Drawing a curve with TikZ

I want to draw something like this using TikZ: I can probably make the curve using controls but that wouldn't allow me to draw the points on it.
66
votes
5answers
45k 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 ...
4
votes
1answer
473 views

Tikz and enlarging part of the draw. [closed]

I plotted a number of curves on the same figure using tikzpicture. but i am having a problem with enlarging part of the curves on the same figure. I searched for that and i found something similar on ...
39
votes
4answers
3k views

Using TikZ in journal articles

I had not been aware of Tikz before joining this site, but am impressed with what it appears to be able to accomplish. Before I jump in and start learning all about it though, I wanted to see if ...
18
votes
3answers
4k views

Is there a way to tune ball shading in TikZ ?

I want to create a Go stone in TikZ. "ball color" option in node style is almost OK. Here is my result: But I don't like the stones, they are "too balish". The "reflection" should be less spot-on ...
27
votes
8answers
3k views

How to draw triangular grid in TikZ?

Is there an easy way to draw a triangular grid in TikZ, like this?
1
vote
1answer
724 views

Tikz: Strange color change. [duplicate]

Possible Duplicate: Using opacity in TikZ causes strange rendering in Acrobat. This is a nice pice of TikZ for typesetting Go boards (gobans). \documentclass{standalone} \usepackage{tikz} ...
11
votes
2answers
2k views

Undocumented useful commands in Tikz

\tikzstyle{...}=[...] This command seems to be extremely useful since it allows to re-use the same style in multiple TikZ pictures. Is is used in a few places in TikZ manual (pgfmanual.pdf), but ...
12
votes
4answers
2k views

Checkers board in TikZ.

What is the best way to draw checker board in tikz? I'm interested in what is the best way to draw many circular pieces on board. (the checker background is not important)
5
votes
1answer
2k views

Tikz: How to encapsulate shade in node?

I have this shaded circle: \shade [ball color=black!80!white] (0,0) circle (1); Is it possible to encapsulate it with node style? Including fixing circle radius?
11
votes
3answers
1k views

Grouping objects and applying operation to the group

Forgive me for my perhaps naive questions, I am beginning to discover Tikz potentials. To ease certain operations as moving objects or transforming them, I want to know if there is a mechanism in ...
11
votes
2answers
1k views

How two connect any arbitrary nodes of tree in tikz

I need to be able to connect any arbitrary nodes in a tree to each other. I am using the tree package in tikz to create my tree. I cannot figure out though how to connect to nodes by let say a draw ...
18
votes
3answers
3k views

Placing nodes along an ellipse in TikZ

Is anybody aware of a simple way to place nodes at arbitrary positions along an ellipse? Ideally I would want to mimic notation like \draw (0,0) ellipse [ x radius=2, y radius = 1] node[pos=.3] ...
3
votes
2answers
610 views

Source specials for PDF?

Normally I write my LaTeX with Emacs/AUCTeX viewing in xdvi, which has the very nice "source specials" feature that I can hit a key command in Emacs to jump to the current location in the output dvi ...
3
votes
2answers
2k views

Subdividing and Filling a Tikz Rectangle

I have two nodes (drawn as rectangles) in my picture, one filled in green, the other red. I wish to produce a third 'rectangle' which shows the effect of splicing these two rectangles and stitching ...
10
votes
3answers
3k views

How to horizontally draw a line passing through a point A until it reaches the border of a node B using TikZ?

Given point A and a node B with an ellipse shape, how to draw a line from A horizontally until it reaches the border of B?
10
votes
2answers
2k views

Why yshift doesn't work in this TikZ example?

Any idea why yshift doesn't work in the following TikZ example? \documentclass{minimal} \usepackage{tikz} \begin{document} \begin{tikzpicture} \coordinate (A) at (0,0); \coordinate (B) at ...
28
votes
4answers
6k views

Script to automate externalizing TikZ graphics

Is there a script to automate externalizing TikZ graphics? (As suggested by Scott here)
23
votes
3answers
6k views

How can/should I include annotated images?

It's often the case that I'd like to include some graphic in a LaTeX document and overlay it with some text or other annotation, maybe including arrows or other simple graphics. The annotations can be ...
18
votes
3answers
4k views

Multirow/multicolumn cells in TikZ matrices?

Is it possible to make TikZ matrix cells span multiple rows/columns, like they can in LaTeX tables using \multirow/\multicolumn? Specifically, I'd like to typeset something like the following in a ...
21
votes
3answers
3k views

Rounded corners in TikZ trees.

When I use TikZ tree with nodes with rounded corners, the connecting lines do not touch the nodes (near corners) but end where would rectangle end. Is there an easy way around it? ...
6
votes
3answers
3k views

How to create custom Tikz nodes?

I don't want to change style only. I want to create node that takes 3 numbers and display them with appropriate decorations. For instance: \mynode{5,6,7} Should display node with "a=5", "b=6" and ...
17
votes
1answer
4k views

Aligned equations inside of TikZ node.

How can I create a tree node with an aligned math equations inside? \begin{align} \end{align} doesn't work \begin{minipage}{100} \begin{align} ... \end{align} \end{minipage} Gives a lot ...
10
votes
4answers
2k views

Drawing arrow heads without the tails in TikZ?

I have an ellipse in a TikZ diagram and I would like to indicate a direction using an arrow head, but do not wish to draw the path leading up to the arrow head. I currently have \draw[->] (0,2) ...
13
votes
5answers
10k views

Better way to calculate coordinates in Tikz?

I am great fan of pgf and tikz in general to produce great looking figures. But I don't like the amount of time I have to put in to draw a complicated picture, because I have to provide all the ...
13
votes
2answers
4k views

How does TiKZ calculate positioning of picture on page?

I'm trying to use \beginpgfgraphicnamed to externalise some complex figures in a large document, using the latest released version of TiKZ (2.00). This produces standalone PDF images but for me the ...
13
votes
2answers
2k 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} ...
19
votes
5answers
5k views

In TikZ, is it possible to nest nodes?

My use case: I am drawing chemical schemes. Each molecule contains several nodes. However, I also want to put each molecule into a "wrapper" node, so that I can use the usual anchors in combining ...
2
votes
2answers
343 views

Meaningful error messages when using latex instead of pdflatex

When I have TikZ images or I include .png graphics, I need to use pdflatex instead of plain vanilla latex. (That is, I need to use pdflatex all the time, rather than just when I want to produce the ...
64
votes
5answers
9k 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 ...
12
votes
4answers
4k views

What is a good way to draw Dynkin diagrams in LaTeX?

I'm about to start writing something up which includes a fair number of Dynkin diagrams, and I can think of several ways of going about it: Just draw the darn things in, e.g., InkScape, and include ...
37
votes
8answers
7k views

How to draw a torus

Is there an easy way to draw a contour image of torus below with tikz? Or for that matter with any other graphics package.
6
votes
1answer
994 views

Automagically externalising pdftricks and TikZ pictures

My thesis currently has a few pdftricks pictures and tikz pictures. It takes a while to compile over here Scott says he has some scripts to automate externalising TikZ pictures. I'm looking ideally ...
7
votes
3answers
996 views

How do I create pasting diagrams in TikZ?

I've been toying with the idea of switching over from Xy-pic to TikZ for all of my diagramming needs, but one feature that's very important to me is the ability to create 2-categorical pasting ...
48
votes
10answers
11k views

How can I speed up LaTeX compilation?

The slowest part is a dozen of diagrams in TikZ.
6
votes
3answers
2k views

How do I set the minimum width of a subfigure?

I have: \subfigure[blah blah blah.] { \begin{tikzpicture}[/MyStyle] ... some stuff... \end{tikzpicture} } But "some stuff" is not that wide and the text in the subfigure produces a lot of ...
54
votes
5answers
16k views

How can I use \linebreak inside a node, in tikz?

This is my code, which doesn't work: \documentclass{article} \usepackage{tikz} \begin{document} \tikz \node {start\linebreak{}stop}; \end{document} The \linebreak command doesn't work. In order to ...
10
votes
3answers
2k views

Why \linebreak doesn't work when text width is not set?

This is the code I have: \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes} \begin{document} \tikz \node[rectangle split, rectangle split parts=2] ...
10
votes
1answer
3k views

Aligning matrix nodes in tikz

Another question about aligning nodes using matrices in tikz. Consider the following: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \begin{document} \begin{tikzpicture} \matrix ...
15
votes
2answers
17k views

What is the correct way to caption a `tikzpicture`?

I have some trees drawn with tikz and I'd like to have some text associated with them. I can use \caption within figure, but not tikzpicture. UPDATE: Thanks for your advice. figure seems to put my ...
42
votes
3answers
17k views

What is the correct way to center a \tikzpicture? [duplicate]

Possible Duplicate: Should I use center or centering for figures and tables? What is the correct way to cause a \tikzpicture to be centered? By default it appears to be aligned with the ...