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)

9
votes
1answer
924 views

Can \usepackage{color} and \input tikz work together in Plain TeX/eplain?

I use Plain TeX and Eplain. In my document I'm using both the color and url packages inside the \beginpackages..\endpackages block. Just now I tried adding \input tikz.tex (as the TikZ manual states) ...
5
votes
1answer
146 views

pgfkeys: allowing one key to activate another key

I have two custom keys: key1, which is boolean; and key2, which accepts a value. The idea is that key1 activates a feature, and key2 customizes the feature. However, if key2 is used, I want key1 set ...
4
votes
1answer
1k views

Scaling and positioning TikZ figures in equation environments

I am trying to use TikZ figures as part of an equation, but I am only able make either the positioning or the scaling appear correctly. For instance, giving my figures the correct size using ...
1
vote
1answer
348 views

Japanese tikz-qtree

I'm having trouble using the example code from tikz-qtree to typeset a Japanese syntax tree. Here's my MWE: \documentclass[10pt,letterpaper]{article} \usepackage{xeCJK} \setCJKmainfont{MS Mincho}% ...
9
votes
2answers
239 views

Specify which picture variant to show

Inside a frame I am including a .tex file containing a TikZ picture with several overlay specifications such that they result in 9 variants of the same picture, that is, that frame has 9 slides. ...
37
votes
3answers
18k views

3D bodies in TikZ

Is there like a library that has default geometric figures like the ones shown below. Am not acquainted yet with 3D diagrams in TikZ.
12
votes
2answers
693 views

Can I have a glow around a box in TikZ?

What I was wondering is, if I can have a glow effect for a box I am drawing with TikZ. Neither search here nor the (excellent) TikZ manual returned any results. There is a circular glow option, but I ...
5
votes
3answers
2k views

Ammeter and Voltmeter for the circuit TikZ library

How can I make the Voltmeter and Ammeter symbols look like in the follwing picture using the circuits.ee.IEC library? I just managed to do this: \documentclass{article} \usepackage{tikz} ...
8
votes
1answer
4k views

Circuitikz symbols in TikZ circuit library

Some time ago, I asked about Relationship between tikz circuit library and circuitikz?. wh1t3 wrote: "However, as far as I know there is nothing the circuitikz package does that the TikZ circuit ...
22
votes
1answer
5k views

Global variables for all tikz drawings in a document

Sorry if this question sounds too elementary. I am new to TikZ, although I have experience with LaTeX. Say I have multiple TikZ statements in a LaTeX document like the following: \tikz\draw[line ...
5
votes
1answer
526 views

TikZ: placing a line (transformed into a sinusoidal shape) parallel to an edge connecting nodes

I am drawing a little sketch, where a line enters a circle, and three other lines come out. Above each line, there is to be a tittle sinusoidal curve (almost as if I used a construct like \node (a) ...
7
votes
1answer
747 views

Using \Alph on \foreach loop argument

Here's basically what I try to do: \begin{tikzpicture} \foreach \x in {1,2,3,4,5} { \draw (\x,1) node{\Alph{\x}}; } \end{tikzpicture} However if I do that, I get ERROR: Missing number, ...
6
votes
2answers
557 views

How do I create an algorithmic Tikz code to obtain a list of numbers which is conditionaly defined by a recurence relation?

Suppose, our initials are $a_{1,0}=0$, $a_{1,1}=1$ and $a_{1,j}=0$ for $j<0$. For given an integer $n$, define $$a_{i,j}=\begin{cases} a_{i-1,\frac{j}{2}} & \text{ if $j$ is even},\\ ...
0
votes
1answer
263 views

Different color display between Adobe Reader and Yap

Today I have been realized some drawings for my scientific article using PGF. After converting the DVI to the PDF file I have noticed that my grid which has been supposed to be gray was somewhat ...
4
votes
2answers
944 views

PGF/TikZ Clipping & Drawing: How to customize lines?

I have gotten some undesirable behavior with PGF/TikZ related to clipping and drawing paths with different color, say gray. So I tried with no success to exchange between \clip[draw=gray], ...
3
votes
1answer
1k views

3D plots with pgfplots

I am trying to plot 3D plots with pgfplots. I have started with an example from documentation: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{pgfplots} % ...
12
votes
3answers
2k views

TikZ: placing square brackets (or open rectangles) perpendicular to lines forming a circle?

I am drawing a little sketch depicting an experiment (code below): At the arrows (under % Outgoing lines in the code) to the right I would like to place little rectangles with their long side ...
109
votes
10answers
32k views

List of available TikZ libraries with a short introduction

Quick links: Summary ❧ Intersections library ❧ Arrow tips library ❧ Calc library ❧ Mindmap Library ❧ Shapes library ❧ Paper Folding Library ❧ Chains Library ❧ Shapes library Very often I ...
2
votes
0answers
453 views

TikZ: compiler error for coordinate calculating, calc library [closed]

\documentclass{standalone} \usepackage{tikz,pgf} \usetikzlibrary{decorations.markings,% snakes,fit,scopes,arrows,calc,shapes.misc,positioning,% ...
35
votes
2answers
2k views

How can I draw a cake using TikZ?

It is always someone's birthday. I would like to use TikZ to draw a birthday cake. There are all sorts of cakes. What I would like is a cake that looks nice and tasty. Preferably a cake with lots of ...
12
votes
1answer
3k views

plot within a plot: zoom into a plot so that the magnified part is framed by axis with ticks and tick labels

I want to zoom into a plot much like it is possible by using the spy library but I want the spy-in node to contain its own ticks and tick labels with a finer grid than the original plot. To clarify ...
5
votes
1answer
1k views

Aligning x- and y-axis with lattice points on a graph using PGF/TikZ

This question is a consequence of a previous question that I posted on the group regarding the plotting of lattice points or a trellis on an axis (ref. Drawing lattice/trellis graphs using PGF/TikZ). ...
8
votes
2answers
2k views

Drawing Lattice/Trellis Graphs using PGF/TikZ

I am trying to draw a graph containing lattice points and vectors. I wish it to look something like this: I am not sure how to go about it, however, I would ideally like to be able to use ...
1
vote
1answer
375 views

How can I assign a node name while wrapping minted environment?

I was thinking how can I frame particular pieces of minted environment for beamer slides. I had a choice either to use overlays and split code across several blocks ( Beamer vs. Minted: overlays ) or ...
4
votes
1answer
482 views

Centering text within custom shape

On page 628 of the TikZ manual, it describes how to code the text anchor for a custom shape so that the label text is placed with its centre at the origin. I've done this to create a simple shape, ...
7
votes
1answer
506 views

How to use pgfkeys with “to path”

I'm not sure if the title is correct but I'll try to explain my problem correctly. I always work on the pgfvectorian package and I try to add some useful macros. One of these macros is to place an ...
24
votes
3answers
2k views

todonotes and tikzexternalize

In my document I use todonotes and TikZ/pgfplots. After activating the externalization in TikZ I realized that todonotes are all exported as well (because they are based on TikZ). This behaviour is ...
27
votes
3answers
3k views

Parametrize shading in table through TikZ

I wanted to do some shading in a table according to its values. For example, if you see the table below: a b c d a 90 10 0 0 b 0 80 10 10 c 0 0 95 5 d 0 10 5 85 I want to ...
30
votes
1answer
6k views

Transparent node with opaque text?

Is there a simple way to create a transparent node with opaque text? Preferably without having to use a postaction or redraw the node. In the example below I'd like to achieve the effect of the first ...
8
votes
3answers
575 views

How to make a thick line connect completely with the side of a box in TikZ?

In my figure, I have a thick line that connects with the side of a box. However, the line does not connect completely with the box. Also, the line covers part of the box (which I don't want). So, I ...
13
votes
1answer
2k views

How to change the line width of the lines connecting spies and the spied region

I was experimenting with the spy library. It worked quite well, except for influencing the line width of the spy connections when using the connect spies keyword, or the width of the outline of the ...
11
votes
4answers
906 views

Draw an arc over 360 degrees

I have the following problem with tikz: I want to draw some circular arcs, but unfortunately these arcs have degrees which pass the 360° line. I would like to be able to draw these arcs with one ...
12
votes
1answer
355 views

How to inverse top and bottom ?

I would like to get 100 "above" the radius, if I consider that the radius comes from the center towards the circle. A little example : \documentclass[landscape]{scrartcl} \usepackage{tikz} ...
4
votes
1answer
805 views

Curiosity - 3D animation in TikZ

Is it possible to create animations shown in the link below in TikZ http://ubcsanskrit.ca/lesson2/writingtutor.html to start animation click on any of the letters on the page. I know it may not be ...
30
votes
2answers
926 views

An Example from the Microtype Documentation

While exploring the depths of the microtype package with regard to LuaTeX I came across this innocent looking page 18 from the microtype.pdf 2.5 beta-08. As the blue note in the margins hints a ...
1
vote
1answer
375 views

tikz code doesn't compile when opened after a while

I finished my phd a couple of months ago, compiled it then completely just fine. I opened it today to make changes and during compilation I get error messages about "missing number treated as zero". I ...
9
votes
2answers
3k views

Defining variables in TikZ

I'm trying to define random variables - for example to draw some random points of the form (r,r) when r is a random number. I tried \def\myrandomnumber{rnd}, but that seems to give me a new random ...
6
votes
1answer
2k views

Decorating (with random steps) a filling pattern

\fill[pattern=north east lines] (A,B) rectangle (C,D); How to make so that the stripe the pattern creates is of style decoration = {random steps, segment length = 0.5mm, amplitude = 0.15pt}
3
votes
2answers
489 views

Why is tikz so much slower when plotting a huge amount of data than WYSIWYG plotting tools?

I was wondering why a tikz/pgf plot of a data file containing several thousand data points needs a couple of minutes to compile while creating the same plot with a WYSIWYG plotting tool (like Grace) ...
7
votes
3answers
889 views

Help on TikZ diagram

I'm very sorry about dull question, but I am totally confused by TikZ. Would anyone help me to draw following diagram, please? What I've done so far is as follows. \documentclass{article} ...
12
votes
1answer
4k views

TikZ Styles that set Nodepart Styles

In the following, I'm using user-defined macros to set the type style for the nodeparts for class nodes (\texttt{\textbf{#1}}), interfaces (\texttt{\textit{#1}}). Using the \tikzset command I also ...
10
votes
2answers
2k views

Tikz fit-library vs fill (overlaying nested node colors)

I am trying to figure out the best way of nesting tikz nodes having a different background color. I would like the "inner" nodes to "win" concerning the background color. Currently the "outer" node ...
12
votes
1answer
4k views

Bending arrows in Tikz

In Tikz, I would like to bend an arrow like the one between $H_2O$ and $O_2$ in this figure: I'm able to have a bended line between $H_2O$ and $O_2$, but it's not touching the photophosphorylation ...
8
votes
1answer
2k views

circuitikz labeling

I am trying to create a few logic circuits for a class that I teach. After brief investigation I decided to use TikZ library circuit due to the lack of the support by PSTricks for American notation. ...
31
votes
3answers
8k views

Using math in TikZ

I know it has been asked and answered before, and I need to put { and } around it, but for some reason this doesn't work: \draw (0,0) -- ({atan(1)}:{sqrt(2)}); Any idea why?
16
votes
2answers
1k views

How can I draw a tangent ending smoothly in a circle?

I'm trying to draw a tanget on a circle, but I'm not happy with the result I get from the tangent option. particularly, I'd like to have the lines ending smoothly in the circle. The problem is ...
4
votes
2answers
390 views

How to generate labels next to junctions and avoid self-collision with tikz?

I have an ASCII-art phylogenetic tree that looks (in part) like /------ PLN /-----+ 0.9 | \------ IL1 /--------+ 1.8 | | /----- PVD | ...
6
votes
2answers
1k views

Drawing a rectangle along the border of a circle

I would like to draw a rectangle along the border of a circle. The \draw with the \angle operation might do it, but it is rather cumbersome. I was wondering if there is another more elegant/shorter ...
8
votes
2answers
955 views

Dependency diagrams using Tikz

I'm trying to draw a database dependency diagram, similar to the one shown below (Gaaah! I can't upload images. ASCII art it is then...) +------+------+------+------+------+------+ | | ...
35
votes
1answer
4k views

optional arguments to tikzpicture to set style globally

I can't get my head around how to get tikz and pgfkeys to do what I want. I would like to define a command which draws a little tikz picture. I'd like this command that would take optional keyval ...