As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [tikz-pic]

{tikz-pic} is about questions concerning “pics” in a Ti*k*Z context. A “pic” is a “short picture” that can be inserted anywhere in TikZ picture where you could also insert a node.

Filter by
Sorted by
Tagged with
32 votes
3 answers
4k views

How to get rid of the almost invisible faint lines in the Olympic rings?

I want to draw Olympic rings and used the code from here, which is, % Olympic rings % Author: Paul Gaborit \documentclass[a4paper]{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \...
ddas's user avatar
  • 1,165
30 votes
4 answers
4k views

Anchoring TiKZ pics

Is it possible to anchor a TiKZ-pic on an internal anchor? I know (more or less) how to use TiKZ pics and know that they are draw arround their origin. What I would like to be sure is that it's not ...
Ignasi's user avatar
  • 134k
29 votes
1 answer
5k views

TikZ 3.0---Multiple arguments for `pic`

How do I provide multiple arguments for pic? giraffe contains two arguments for colors, #1 and #2. I would like to be able to provide these as giraffe={pink, yellow} or giraffe={colorA=pink, colorB=...
user3371321's user avatar
22 votes
3 answers
4k views

How to give a name to \pic

I read instruction how to use \pic in PGF 3.0.0 manual, but description how to give names to \pic are not clear to me and given example generate error: "No shape named EmmaEmma-left is known." ...
Zarko's user avatar
  • 283k
16 votes
1 answer
557 views

pic versus macro in TikZ

Consider this code in the TikZ - PGF manual, which uses a macro % Main code from % The TikZ - PGF manual % Author: Till Tantau et al % Version 3.1.3, released May 9, 2019 % Page 40 \...
user avatar
14 votes
1 answer
2k views

TikZ Pics with optional/default parameters

I am trying to set up a small TikZ library or package with pics I can reuse. Thus, I create a file called "tikzlibraryBES.code.tex" with the following content: \tikzset{ % House pics/house/....
cmolitor's user avatar
  • 143
14 votes
1 answer
330 views

In tikz, why does a pic with a tree get distorted upon positioning with e.g. `right=of`

I'm trying to connect with edges tikz pics. I thought of using (sub)graphs like subgraph I_n and specifying the nodes with the V key, but I get an error: Undefined control sequence. \tikz@lib@graph@...
Aayla Secura's user avatar
12 votes
2 answers
220 views

TikZ: strange behaviour of cycle / coordinate / pic name in TikZ pics

In a TikZ pic, the combination of -- cycle, \coordinates, and the name key (or using parenthesis) only works sometimes. \documentclass{article} \usepackage{tikz} \begin{document} \tikzset{ ...
user72575's user avatar
  • 143
10 votes
3 answers
2k views

How to fill a split node with two different colors?

I have that issue when try to fill a split node with two different colors. After using rectangle split part fill={red,blue} as an node argument the drop shadow overlap the node because I don't use the ...
Mar Tin's user avatar
  • 429
9 votes
2 answers
2k views

How should I prevent a .pic definition inside a document environment, but outside a tikzpicture, from adding a space to the typeset output?

How can I prevent the definition of a .pic from adding an additional space to the typeset output, where the .pic is defined in a \tikzset{} within the document body, rather than either in the preamble ...
cfr's user avatar
  • 186k
9 votes
1 answer
652 views

Nested tikz pics?

I have a basic pic ("brick") that I rotate/flip/shift within other pics (e.g. "wall"). These pics ("wall") then get drawn in my tikzpicture, possibly themselves rotated/...
mathematical.coffee's user avatar
9 votes
1 answer
5k views

Understanding TikZ anchors using pics

With the MWE below, I get the following figure: Could someone explain me why in the right figure, the red circle is not "inside" the square? I guess it has to do with the square being a node, and not ...
Zooky's user avatar
  • 451
8 votes
2 answers
1k views

Tikzpicture scope background image

I copied and modified the code given on http://www.texample.net/tikz/examples/swan-wave-model/ \begin{figure}[H] \begin{tikzpicture}[scale=.5,every node/.style={minimum size=1cm},on grid] \...
daniels_pa's user avatar
8 votes
1 answer
14k views

Tikzpictures side by side [duplicate]

I have used the following code: \begin{figure}[h] \begin{tikzpicture} \draw[->] (-0.5,0) -- (4,0) node[right] {$x$}; \draw[->] (0,-0.5) -- (0,4) node[above] {$y$}; ...
Rebecca Barton's user avatar
8 votes
1 answer
940 views

Anchoring complex tikz pic

In my illustration I need a sketch of clock. For it I use pic capability of TikZ. It works fine with quit annoying exception: positioning of clocks in picture. If I put a clock at some absolute ...
Zarko's user avatar
  • 283k
8 votes
1 answer
600 views

Problems combining clip, layer and pic when multiple instances are included in the same tikzpicture

I'm having trouble figuring out how I am supposed to combine (or if I am supposed not to combine) pics, clipping and layering when more than one instance of a pic is included in a single tikzpicture ...
cfr's user avatar
  • 186k
7 votes
2 answers
989 views

How to bend a word around the circle

I would like to bend the ``commutative rings'' around the circle. I would appreciate any help. \documentclass[a4paper, 12pt, openany]{book} \usepackage{tikz} \usetikzlibrary{calc} \colorlet{euler1}{...
Abdulhafeez Ayinde Abdulsalam's user avatar
7 votes
3 answers
453 views

Drawing an angle between two vectors?

I want to draw an angle between two vectors: \documentclass{article} \usepackage{tikz} \usetikzlibrary{angles,quotes,babel,plotmarks} \usetikzlibrary{decorations.pathreplacing} \usetikzlibrary{calc} \...
Vertexwahn's user avatar
7 votes
3 answers
885 views

Overlapping nodes in a decision tree

I have the following decision tree taken from this example with little modification. When I added two sub-nodes to the second right node, the inner left and inner right nodes have been overlapped. How ...
CS Student's user avatar
7 votes
1 answer
276 views

How to use composite Tikz pics with rotation

I am trying to draw a tiled pattern, building it from simpler elements using pic. This is a simplified version of my code \documentclass[tikz,border=2mm]{standalone} \usepackage{tikz} \begin{...
pheon's user avatar
  • 716
7 votes
1 answer
237 views

How to give a name to \pic (part II)

When I was looking for the solutions of How to give a name to \pic, I discovored that it looks like that the problem is only with the code of \tikztostart in the to path and not with the \tikztotarget....
Kpym's user avatar
  • 22.7k
6 votes
2 answers
383 views

Tikz and lines with the Q letter

I do have a tex, that always show me a twolines, in a tikzfigure when letter Q is in the line. Let me share the TEX with you \documentclass[parskip]{scrartcl} \usepackage[margin=10mm]{geometry} \...
user111375's user avatar
6 votes
3 answers
653 views

Tikz Payoff Matrix

I am trying to remove the bottom two rows (C and D) completely so as to create a 2*4 payoff matrix. In addition to this, I would also like to move "Player 2" up slightly once they have been removed (...
Inquirer's user avatar
6 votes
1 answer
117 views

TikZ: Bug (?) with `.pic`: misalignement of nodes

I am using .pic to use a same picture several times. I noticed a difference of behavior between the same code inside a .pic or outside. In the example below, one can notice that within a .pic, the ...
Bruno's user avatar
  • 1,935
6 votes
1 answer
5k views

Various questions on the pic command from the Tikz angles library

I have a few questions regarding the pic command from the tikz.angles library that I am trying to experiment (the documentation in the Tikz-pgf manual remain very obscur to me). So here is one bit of ...
Anthony Martin's user avatar
6 votes
1 answer
569 views

A nice example with `name prefix ..`

TiKZ pics include a new key called name prefix ... TiKZ documentation defines it with /tikz/name prefix .. This key is available only inside the code of a pic. There, it (locally) ...
Ignasi's user avatar
  • 134k
6 votes
3 answers
707 views

TikZ using \tkzMarkAngle in pics

I am trying to draw some Penrose tiling in order to learn more about tikz, and I can now make pics and place them. But I can't label angles: if I use \tkzMarkAngle (which would be ideal) in pics, I ...
Karl's user avatar
  • 63
5 votes
4 answers
3k views

Arrow Between Equations

Is there a better way to put arrows between equations? \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node at (-4,0)...
Shin's user avatar
  • 51
5 votes
1 answer
422 views

Spherical Polar Diagram

I'm trying to recreate (pretty much copy) the Example image with Latex, but I can't really figure out how to draw the xz plane arc and the other arcs. I got it to a certain point, as seen below. ...
Dave124's user avatar
  • 343
5 votes
1 answer
655 views

Perfect crossing of two dashed lines

I need to draw to dashed line which cross at the center of a circle using the tikz package. I would like to obtain a pefect cross at the center of the circle so I wonder if there is a method to force ...
FlyBob's user avatar
  • 149
5 votes
1 answer
2k views

Node positioning relative to `\pic`

I want to position a node relative to a \pic. I'm able to position a \pic relative to a node, but I want it the other way. \documentclass{standalone} \usepackage{tikz} \tikzset{ pics/mp3/.style ...
svenwltr's user avatar
  • 155
5 votes
1 answer
259 views

How to use xcolor color names in tikzpicture style?

I want to use color names like MidnightBlue in a style for a tikzpicture to e.g. fill it with a specific color, is this possible? Or am I limited to the other style (red!30 etc.)? This MWE fails with ...
Lennart's user avatar
  • 384
5 votes
1 answer
352 views

How to add fill in a \pic?

I wrote a TikZ pic for a simple database icon (first picture below). What I want is to hide the two edges that are behind overlaying boxes, similar to the second picture. I thought I could add a white ...
Keelan's user avatar
  • 5,149
5 votes
1 answer
610 views

How can I make scaling affect TikZ-pics within a tikzpicture?

I want to have "global scaling" in a TikZ picture, which also affects all pics defined within a tikzpicture environment. MWE: \documentclass[tikz, border=2mm]{standalone} \begin{document} \begin{...
braxlan's user avatar
  • 155
5 votes
1 answer
710 views

drawing directed graph

How can I draw an edge from (ab) to ($a^3$$b$)? I tried using \Edge(ab)($a^3$$b$) like I did for drawing an edge from (b) to (e) but the same method didn't work. I think it has something to do with ...
Peter A's user avatar
  • 153
5 votes
1 answer
975 views

tikz - Curved cloud shape

So here is my code that produces a circle with text inside and three clouds, also with text, around it. I would like the clouds to curve in an arc around the circle, if that is possible. There is this ...
ThunderBiggi's user avatar
5 votes
1 answer
306 views

Shading grid which is fully inside slips

I have an ellipse drawn over a grid of small square, I need to shade those square in which are fully inside the ellipse, is there is way to do it without trying to shade one by one for each square? ...
henry's user avatar
  • 337
4 votes
2 answers
2k views

Generating adjacency matrices from isomorphic graphs

Here are some isomorphic graphs and their corresponding adjacency matrices. I can draw the graphs with tikz. But I'm not sure the best way to draw the matrices. Is it possible to generate one from ...
voices's user avatar
  • 2,009
4 votes
1 answer
782 views

Crop an image in tikz using 2 points of reference and a height

Consider the following code: % DOCUMENT TYPE \documentclass[12pt,a4paper]{article} % PACKAGES \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[english]{babel} \usepackage[margin=10pt,...
Vincent's user avatar
  • 4,527
4 votes
2 answers
429 views

Automatically shift scope of tikz pic

I'm trying to create pics that behave like nodes. Following the instructions of shifting scopes and naming scopes for pics, I managed to manually create pics and move them to behave like nodes. The ...
adn's user avatar
  • 10.9k
4 votes
2 answers
502 views

TikZ: clip with Pic?

Title explains it all really, I want to clip a picture using an exiting .pic that I have already defined, as I plan on using this clip shape many times over. \documentclass[border=5pt]{standalone} \...
Crazymoomin's user avatar
4 votes
1 answer
109 views

Arrow directions in a flowchart

I am trying to create a flowchart. So far, I have all the blocks I need. I simply need to create the appropriate 'flow'. I want the arrows in the following directions: How do I do that? I've tried ...
Missael's user avatar
  • 185
4 votes
1 answer
464 views

How to move tikzpicture with named nodes?

I am trying to position an image with rounded corners to a specific position on screen. However, according to the following post, yshift and xshift do not affect nodes that are named and I am still a ...
Code Doggo's user avatar
4 votes
2 answers
3k views

Positioning '\pic' in tikz

With the code \documentclass[tikz,convert={size=640}]{standalone} \usetikzlibrary{positioning} \usetikzlibrary{calc} \usetikzlibrary{quotes} \begin{document} \begin{tikzpicture}[ rect/.style={...
Reza's user avatar
  • 1,768
4 votes
1 answer
279 views

TikZ: position a pic with its inner coordinate

In the MWE below, I made a TikZ pic called bus with one argument. The argument creates nodes within the pic that will be used as connection points to other buses. I would like to align these pics by ...
likethevegetable's user avatar
4 votes
2 answers
128 views

Is there an option to simulate the drawing of a TikZ pic without really drawing it?

Currently, I draw a TikZ picture with lots of TikZ elements and subelements. To do this, I use TikZ pic. Sometimes, I need to know the size of a pic prior to its drawing for the correct positioning. ...
lkegel's user avatar
  • 41
4 votes
1 answer
103 views

problem with fadings and pic

I try to generate several copies of a faded text using the PG 3.0 pic feature but something with the placement went wrong. Only the one at the origin is drawn. Here is what I have done: \...
susis strolch's user avatar
4 votes
2 answers
505 views

Named paths inside a tikz/pic

I am trying to understand the naming behavior of paths inside a pic definition. Consider the following \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{intersections} \tikzset{% ...
Keith Prussing's user avatar
4 votes
1 answer
124 views

Placing the middle of a predefined picture at a certain node

I am trying to create the following reaction network cycle. Here's my output so far. My MWE is \documentclass[11pt]{standalone} \renewcommand*{\familydefault}{\sfdefault} \usepackage{sfmath} \...
scorpionwars's user avatar
4 votes
1 answer
179 views

making a cartoon plot of some grids using tikz

I want to use latex to generate similar figure as following plot using tikzpicture. For instance using the example given here \documentclass{article} \usepackage{tikz} \begin{document} \begin{...
Dalek's user avatar
  • 509

1
2 3 4 5 6