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)

10
votes
1answer
1k views

How can I mix an “ybar” and an “ybar stacked” with pgfplots?

I tried a while to create that kind of chart with ybar but it's a mix between "ybar stacked" and "ybar". How can I do that? I tried this way but with no great results: \begin{tikzpicture} ...
6
votes
2answers
880 views

Customizing chapter style with tikz

How can I customize chapter style like below picture? Thank you in advance.
19
votes
3answers
981 views

How to make a smarter cropping with standalone or preview packages?

The arrow tail at the bottom left corner is not properly cropped. \documentclass[tikz,border=0pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[scale=3,line width=3pt] ...
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 ...
16
votes
3answers
1k views

Draw a closed liquid-droped shaped curve with TikZ

I am trying to draw a closed liquid-droped shaped curve using TikZ, but I don't know how. I tried to draw it using coordinates but I don't think that this is the solution. I am using ...
13
votes
2answers
521 views

How to turn off an environment (e.g. tikzpicture) for faster draft compiling

I'm currently writing my thesis and have been looking for ways to speed up compile time. I can shave off a lot of time by using draft mode so that images aren't processed, but I have several TikZ ...
13
votes
3answers
655 views

Repeated division - Converting from base 10 to another base

I am teaching how to convert from one base to another base, however, I can't find a way to do something like this: I know little about Tikz, the only thing I have been able to produce is a simple ...
16
votes
2answers
2k views

How to align a series of TikZ pictures at the baseline

I am trying to align a series of pictures made up of letters, using TikZ. Having tried almost all combinations of the baseline key it is obvious I am missing something. Here is a MWE (currently ...
14
votes
2answers
7k views

Easiest way to plot a function with PGF/TikZ

I am new to TikZ and/or PGF (whatever the difference is :/), as you can see. Anyway, I need to draw the graph of the equation x^(2/3) + y^(2/3) = a^(2/3), where a = 2. Any suggestions? Here is what I ...
12
votes
2answers
519 views

List of Underlining Packages - Pros and Cons

The \underline macro built into LaTeX is pretty much not useable per Why does underlined text not get wrapped once it hits the end of a line ? I have been attempting to use the soul package to ...
12
votes
3answers
3k views

Horizontal row separation line in tikz matrix (like \hline in tabular)

In this question tikz-matrix-as-a-replacement-for-tabular a nice solution was given to let the matrix in tikz behave like tabular. In this solution cell/.style={rectangle} was used to draw lines ...
11
votes
2answers
2k views

Coordinates of intersections

In axis environment I have a curve and a line intersecting it. How can I get components of intersection-1, intersection-2 etc. in axis units? \documentclass{minimal} \usepackage{pgfplots} ...
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 ...
17
votes
3answers
1k views

Using opacity in TikZ makes the entire page become “more coarse” when printed

In my document, some of the figures uses opacity. In the PDF viewer, everything looks fine, but when I print the document, the pages in which these figures appear become more "coarse"; the text looks ...
9
votes
1answer
373 views

How to vertically center the \vdots in this node?

I'd like the \vdots in this chain to have the same distance to both of the arrows. I know that I could manually shift the node so that it looks right, but there must be a better solution. How? ...
9
votes
1answer
1k views

Dependent node size in TikZ

I'm producing some control theory flow sheets in TikZ where I have specified the node box size. Since I'm making a lot of these flow sheets, I have set global styles for them, for instance the box ...
8
votes
1answer
997 views

Computing value using pgfmath for use in coordinates?

Why can't I use the outcome of using pgfmath in a TikZ coordinate? Here is a (minimal) example that does not work: \documentclass[11pt]{article} \usepackage{tikz} \begin{document} ...
8
votes
2answers
427 views

How to draw multiple Rectangles from input data file

I want to draw set of rectangles on axis based on input file. My .tex file should be some thing like that \documentclass{article} \usepackage{tikz,pgf} \usetikzlibrary{plotmarks} ...
8
votes
2answers
301 views

Writing specific versions of an operator for display and inline modes

I'm busy answering a question by constructing a new math operator that uses the sum symbol and some TikZ placed on top. My answer as it stands can be found here. It looks (I think) pretty good in ...
7
votes
2answers
377 views

Odd behaviour with arrows and multipart rectangles

I recently posted a question Display issues drawing DNA sequences with TikZ. The issues I described were for the most part resolved, but one remains. I managed to simplify my example down to show the ...
7
votes
2answers
316 views

How to emphasize within a listing two successive identifiers separated by a space?

I have this pgfplots code that I want to put in a lstlisting environment: \pgfplotsset{ every axis x label/.append style = { font = \small }, every axis y label/.append style = { ...
6
votes
2answers
600 views

Where in the world is tikzlibraryhobby.code.tex?

I was trying to reproduce Claudio Fiandrino's answer to How can we draw a Hannukah Menorah with decorations, using TikZ?. However, I do not have the hobby package by Andrew Stacey in my local ...
6
votes
1answer
910 views

meta arrow tips

Page 316 of the tikz-pfg manual describes meta arrow tips and says that usually we do not want to have the tip scaled the same way as the supporting line. Is there a way to keep this feature, ie, when ...
3
votes
2answers
268 views

Using htlatex with tikz-dependency

I am trying to generate an html file from a tex file using htlatex. The htlatex works well with simple tikz pictures, but it has problem with the pictures (trees) drawn with tikz-dependency package. ...
11
votes
2answers
652 views

Unexpected clash between babel and pgf spy

The following example taken from the pgfplots manual (p. 121) works fine only if the line loading babel is commented \documentclass{article} \usepackage[frenchb]{babel} % this is the troubelsome ...
59
votes
2answers
2k views

Summary of Tikz commands

Many times, when I'm coding a tikz-picture, I don't remember the command syntax or the name of one option, and I have to look in pgf-manual is not very short. Does anybody has a summary of Tikz ...
73
votes
11answers
8k views

What are the advantages of TikZ/PGF over PSTricks?

The first time I saw the PSTricks' 3D Galleries, I immediately felt in love with it. I have spent much time to learn and use it. In this forum, I see many people using TikZ. I have not used TikZ yet. ...
44
votes
3answers
6k views

Outsourcing TikZ code

My Tex files get very confusing since I have multiple long TikZ code in them. How do you organize your files when it comes to TikZ?
34
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 ...
27
votes
4answers
6k views

Script to automate externalizing TikZ graphics

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

Why draw diagrams using LaTeX when there are open source tools like OpenOffice?

I was looking at recent questions here and was surprized that people were drawing diagrams in LaTeX, when it can be done in SmartDraw, OpenOffice or other programs. Is there any benefit to using LaTeX ...
34
votes
2answers
1k views

How to make a diagram composed of superimposed layers where the viewer can make each layer visible or invisible independently of the other layers?

This question led to a new package: ocgx (I have edited the question as ocgtools looks like it is the right package to use, rather than animate.) I am trying to use LaTeX with the TikZ package ...
14
votes
1answer
2k views

Externalization to other format, Makefile. Add new rules to the makefile

Through using Christian's method of externalization, shown below, one can convert the pdf's to any chosen format right after the externalization at hand. \documentclass{article} \usepackage{tikz} ...
12
votes
1answer
2k views

Headers and page numbers in external borders

I am trying to recreate in *TeX the same aspect that you can see in the following picture showing a document that I created a while ago with MS Publisher. As you can see, page numbers are rendered ...
27
votes
4answers
10k views

Node shapes in TikZ

I want to draw a block diagram for a software app and I need two shapes which I couldn't find on the Internet. The shapes are a parallelogram and a rectangle with double side margins. One is for data ...
22
votes
5answers
2k 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 ...
15
votes
1answer
394 views

Is there a listings configuration for TikZ as used in PGF/TikZ manual?

I want to create a tutorial how to use TikZ now. Is there a listings configuration for TikZ as used in PGF/TikZ manual? For example, I want to make \ as an integral part of tikz in \tikz, relevant ...
15
votes
7answers
6k views

Electric circuits in TeX, LaTeX, and Friends

What are some ways to draw electric circuits in TeX systems? I'm making this community wiki since I haven't found a question related to this. I was thinking along the lines of circuitikz. What do ...
31
votes
2answers
7k views

How to diagonally divide a table cell … properly?

There have been many threads discussing solutions to the task of drawing a diagonal line in a table cell. There are also two packages to do this, slashbox and the better looking makecell with its ...
31
votes
4answers
2k views

tikz: Distribute evenly and randomly circles

I want to fill a part of a picture with more or less evenly and randomly distributed circles which should not overlap. It would be okay if circles are only partly inside the shape. The density should ...
31
votes
4answers
5k views

How to draw a shaded sphere?

Andrew Stacey pointed out that the Rosetta Code entry "Draw a Sphere" doesn't have a TikZ entry yet. Is there a way to draw a "properly" shaded sphere using TikZ? The ball shading would seem an ...
28
votes
2answers
2k views

How to draw Brownian motions in tikz/pgf

Here I want to draw some Brownian motions in tikz, like this: Furthermore, I want to truncate the trajectory of Brownian motion, like this: I have tried many times with random functions in tikz, ...
27
votes
1answer
929 views

How to add a regression line to randomly generated points using pgfplots in Tikz?

\documentclass{article} \usepackage{tikz} \usepackage{color} \usepackage[active,pdftex,tightpage]{preview} \usepackage{pgfplots} \usepackage{pgfplotstable} \begin{document} \begin{tikzpicture} ...
16
votes
5answers
663 views

Placing coloured rectangles on a plot, using points from the plot - Riemann Sums

October 31st Note: Below is the original question, but after some feedback I have progressed somewhat and posted an answer to demonstrate what I've learnt since. My answer presents an encapsulated ...
10
votes
2answers
571 views

Intersection of 2 lines not really connected in TikZ

In the code below I repeat one line (one with opacity=0 and other without it) in order to draw the intersection of 2 lines that are not connected. I am seeking a better way to achieve the same result. ...
18
votes
2answers
720 views

Modifying `*` and `o` style tikz arrows so that they are centered at the end of line

I would like to use tikz * and o arrows to indicate included/excluded endpoints in plots of piecewise functions, like for example the following one: However, it seems that tikz always aligns the ...
13
votes
1answer
933 views

Tikz: Shading a path without any filling

How can I shade a path witout filling? In particular, I wand to draw a curved arrow that starts colored blue and ends colored green, where in between it gradually changes its color. I can't find a way ...
13
votes
2answers
5k views

Automatically draw and labels angles of a triangle in TikZ

I'm using LaTeX with TikZ to create a (right-angle) triangle. Now I would like to label each angle by adding a half circle and a text label. Unfortunately I only managed to create a label for the ...
24
votes
1answer
4k views

Creating node shapes

I am currently learning how to use TikZ/PGF to make some figures for a project report, and so I have a question: Is there is a practical way of making a particular object into a node? The object ...
22
votes
1answer
4k views

Package for typesetting Feynman diagrams (efficiency of `feynmp` and `tikz`)

Is there any good package for typesetting lots of Feynman diagrams? My question arise because Feynmp: Circle with three vertices lead me take a look at the documentation for the feynmf/feynmp ...