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)

39
votes
3answers
9k views

Drawing Mechanical Systems in LaTeX

I really like CircuiTikZ for drawing diagrams in my LaTeX documents. However I mostly draw mechanical and not electronic systems, which is why I'm looking for some similar way to draw mechanical ...
29
votes
5answers
9k views

Draw arc in tikz when center of circle is specified

It would be convenient sometimes to be able to draw an arc in tikz by specifying the center of the corresponding circle its radius the initial/final angle i.e., the "natural" way an arc is ...
35
votes
1answer
7k views

Bell Curve/Gaussian Function/Normal Distribution in TikZ/PGF

Can anyone tell me how to plot a gaussian function/bell curve using TikZ/PGF? I'm basically looking to implement something like PSTricks's \psGauss command.
21
votes
1answer
2k views

TikZ picture shapes

I am very new to the TikZ package, and I need to draw some flow chars by using the following shapes. However I couldn't figure out how to draw the 4th and and 6th ones below. It would be very nice ...
20
votes
5answers
5k views

Label angle with tikz

I am able to draw a nice right triangle with \begin{tikzpicture}[thick] \draw (0,0) -- (4,0) node[midway,below]{$f$} -- (4,2) node[midway,right]{$\frac{x}{2}$}-- cycle; \end{tikzpicture} Now I ...
23
votes
1answer
6k views

Simplest way to overlay a text + rectangle label an image?

For my figures thus far I've been using LaTeX's straightforward figure code, i.e.: \begin{figure} \centering \includegraphics[width=6.5in]{figure.png} \caption[Stuff here]{(A) More stuff ...
24
votes
1answer
5k views

TikZ matrix as a replacement for tabular

I would like to use TikZ matrices to for some drawings. I am currently using nodes and positioning them manually to simulate a tabular. That helps in positioning arrows and shading. However, if I ...
18
votes
6answers
10k views

How to establish node-anchor-like points on a (tikz) rectangle path (is there a better method than the one described)?

Background and desired functionality Rectangles can be drawn with tikz in a number of ways, one way of doing so is to define a rectangle node as follows: \node (rectangle) [draw, rectangle] {A ...
23
votes
2answers
2k views

How can I produce a 'ring (or wheel) chart' like that on page 88 of the PGF manual?

I really like the 'ring chart' or 'wheel chart' given as an example on page 88 of the PGF manual. It is like a pie chart, but with a label in the centre. Unfortunately, the manual doesn't give the ...
29
votes
1answer
397 views

How can I know if a node is already defined?

I think I've seen this question before, but I can't find it. The problem is simple; before I assign a name to a node I would like to know if the name is already used. I think when a node is created ...
23
votes
3answers
1k views

Properly aligning drawn lines between the corners of 2 rectangular nodes in TikZ?

When I draw a thick line from the corner of one box to the same corner of another, it doesn't attach properly. See the code and picture below: \documentclass[a4paper, 11pt]{article} ...
15
votes
3answers
5k views

Large braces over several items in an itemize with text by the brace

This question is related to this question: Adding large brace next to body text, but is not a duplicate. I have an itemize in a beamer presentation. I want to put a brace over some of these items. So ...
9
votes
1answer
6k views

Legend in tikzpicture

I am looking for a way to create a legend in a regular tikzpicture. I found this Using a pgfplots-style legend in a plain-old tikzpicture but I don't know how to put the legend at the wanted ...
10
votes
3answers
495 views

Macro to access a specific member of a list

I want to be able to have a macro access a specific element of a list. The following code works, however requires me to have two separate macros: one that accepts a list, and the other that accepts ...
6
votes
5answers
2k views

Draw an aircraft with Tikz

I want to draw a plane using the Tikz tool. You will find, attached, a screenshot.
20
votes
2answers
5k views

Problems with TikZ calculations

When can I use functions and do calculations in TikZ? How do I make this work: \draw (0,0) arc(0:90:sqrt(15)); %not ok why is this working: \draw (0,0) arc(0:asin(1):5); %ok with ...
13
votes
2answers
2k views

Shrink figure only when necessary?

I'm writing a report where I have generated and included several TikZ pictures which I also want to use in my beamer presentation. However, some of the pictures (but not all) which fit in the report ...
11
votes
3answers
789 views

TikZ parallel Edges between Nodes

I'm looking for a simple way to draw the following picture using TikZ. Namely, I would like to only specify the coordinates of the cities and then to connect them by edges using a \foreach loop. This ...
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 ...
10
votes
1answer
204 views

Error with hobbyconvexpath

The hobby examples given on TEX.SX don't seem to be working with texlive 2013 (at least for me. For example, copying an MWE produces an error: \documentclass[tikz,border=2bp]{standalone} ...
7
votes
1answer
526 views

Is there something like \providetikzstyle similar to \providecommand?

I have standalone figures that I include in my document. These figures use statements like \providecommand{\HypotenuseLabel}{$h$} which allows the figure to have a default label, and which can be over ...
5
votes
2answers
715 views

Nested foreach inside a TikZ matrix for both rows and columns

I'm trying to create a matrix using nested \foreach loops. I tried following the example I found in a previous question, but I keep getting errors. Here is the code I tried to run: ...
12
votes
1answer
397 views

How can I use an hbox inside a TikZ environment for text dimension measurement?

I'm trying to use an \hbox to measure the dimensions of a certain text. This is working in normal text as in the following example: \setbox37=\hbox{this is a text that I want to measure} text width ...
106
votes
12answers
7k views

Can we make a love heart with LaTeX?

I understand that this post may cause some down votes because it seems a bit off-topic, but having seen the discussion on Christmas Tree with LaTeX I am still willing to try. My Girlfriend's birthday ...
36
votes
6answers
2k views

Creating gears in TikZ

I am trying to create a gear in TikZ in which the number of spikes can be determined and the size as well. I was looking through the pgfmanual and stumbled upon the decorations section and I tried a ...
34
votes
4answers
6k views

Draw mechanical springs in TikZ

Currently I am using the following path style to draw springs in TikZ \tikzstyle{spring}=[thick,decorate,decoration={zigzag,pre length=0.1cm,post length=0.1cm,segment length=6}] for example ...
39
votes
6answers
12k views

TikZ: Node at same x-coordinate as another node, but specified y-coordinate?

In TikZ, if I have a node (A), how do I create a node (B) with the same x-coordinate as (A), but a given y-coordinate?
23
votes
1answer
3k views

How to customize the table of contents using TikZ?

Are you aware of tentatives to customize the table of contents with TikZ? I am thinking of fancy graphical objects (coloured ovals, squares, rectangles...) coming with "chapter" or the numbering, for ...
8
votes
4answers
8k views

How to draw graphs in LaTeX?

I need to draw simple graph (for example Petersen Graph) in LaTeX. I am using Kile in Ubuntu. I exactly don't know that which package should I use. Any suggestion with example is highly expected.
11
votes
1answer
11k views

Typesetting a directed, weighted graph with TikZ

I just started doing things with TikZ today and I run into a problem: there is just no example code snippets for typesetting directed, weighted graphs. Can anyone supply one simple example in an ...
27
votes
5answers
2k views

How can I fix jumping TikZ pictures in beamer?

The problem of stuff jumping in beamer is a common one, (see e.g. Avoiding jumping frames in beamer) and we've seen it here from time to time (I imagine the "related" list at the side will be quite ...
21
votes
6answers
2k views

Best way to create this image, square and angle

I have just started looking into tikz, and trying to create the simple image below. I took a stab at it but could not quite do it. ABCD is a square and E is the midpoint on DC and F is the midpoint ...
12
votes
1answer
2k views

Non-linear curve fitting with gnuplot

I am trying to use gnuplot with pgfplots in TexShop, following on from an example by Martin H in the comments here. I can get the data points in OK, and plot them but the fit (red line) does not seem ...
20
votes
4answers
990 views

How to draw a Catalan number diagram on TikZ

This is a very easy question, but I am a LaTeX newbie. Any idea how to code diagrams of this kind? Image taken from the Catalan number Wikipedia page.
13
votes
2answers
626 views

Faded or blurred lines

My question was inspired by Rotate fading in tikz where the inquiror is drawing laser beams that shall look somewhat blurred not as lines but as boxes with a fading. The problem with this approach is ...
11
votes
2answers
990 views

Issues and potentiality of the tikzmark macro: dynamic box adaptation

Since I discovered the tikzmark macro I've been enthusiastic about it. I think that it is possible to distinguish at least two versions of the command: a basic one (two examples: ...
19
votes
1answer
1k views

Maintaining layout of Tikz diagrams with TeX4ht (converting as single pictures)

A Tikz diagram such as \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \path (0,0) node[draw] (A) {A}; \path (2,0) node[draw] (B) {B}; \draw (A) -- (B) ...
10
votes
2answers
2k views

How can I draw a Karnaugh map

Can you please help me drawing the kmap as shown in the link. A sample of the circles around the 1's is sufficient. *Edit** I made the following code. Can you help me now in completing this ...
17
votes
2answers
3k views

Trait with variable thickness

Can you create lines with variable thickness (line width) in Tikz?
9
votes
3answers
898 views

Replicate this chart using LaTeX

I need to replicate this chart using LaTeX, I understand that TikZ should come in handy: Can anyone please show me the best and easiest way to render the chart? Any ideas, tips, nudges in the right ...
18
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 ...
16
votes
1answer
2k views

How to create a squiggle arrow with some text on it in TikZ?

I need to define a new command to create a squiggle arrow with some text on it. Something similar to what \xrightarrow command produces but with wiggly arrows as in \rightsquigarrow. The length of the ...
15
votes
2answers
1k views

Tikz-PGF: Draw integral test plot

So I'm doing a report on convergence tests in LaTeX, and would like to produce a diagram demonstrating the integral test for convergence. I am somewhat new to LaTeX, and a total n00b when it comes to ...
10
votes
3answers
1k views

Drawing a proper shadow for overlapping objects

I draw images that are composed of several overlapping nodes. If I add a drop shadow to each node, the shadow of the second node is drawn over the first node, as seen in the picture below (which ...
6
votes
5answers
3k views

How do I use pgfmathdeclarefunction to create define a new pgf function?

I'd like to define new function for pgf so I can use it in pgfplots. I'm trying to create a unit pulse function p(x) which has a value of 1 from x=0 to x=1, and 0 elsewhere. I read the pgf manual on ...
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" ...
13
votes
1answer
477 views

Moving tiles of the pattern in TikZ

One of the problems with patterns is that you never know how individual tiles are going to be laid over the area. E.g. if you use star pattern, sometimes stars on the left side of the area shall be ...
5
votes
1answer
2k views

Update TikZ/PGF on mac

the TeXLive 2012 distribution on my Mac is shipped with TikZ version 2.10 - I want to use (try) the CVS (most updated beta(?) version). Here's what I've done so far: Downloaded the the TDS package ...
61
votes
3answers
12k views

Putting a timeline for dates in moderncv

This question led to a new package: moderntimeline I just had the idea of using a timeline to specify dates in my CV. I've made a mockup in Inkscape: The idea, as you see it, is to display ...
68
votes
1answer
4k views

PowerPoint's “Smart Art” for TikZ?

This question led to a new package: smartdiagram I haven't been using PowerPoint for years, but today I immediately fell in love with its "Smart Art" feature (2010 version of PowerPoint). The ...