Skip to main content

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,235
31 votes
1 answer
6k 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
31 votes
4 answers
5k 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
  • 137k
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
  • 300k
16 votes
1 answer
651 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
348 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
223 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
1 answer
15k 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
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
  • 207k
9 votes
1 answer
727 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
  • 461
9 votes
1 answer
653 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
  • 207k
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
994 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
  • 300k
7 votes
2 answers
1k views

How to Sharpen a PDF Drawing

The following Wikipedia image is in the public domain: Using \includegraphics, I incorporated the image into some LaTeX code, edited out the border, and saved the remaining portion as a PDF. Now, ...
DDS's user avatar
  • 9,776
7 votes
3 answers
706 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
905 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
315 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
  • 786
7 votes
1 answer
246 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
  • 23.1k
6 votes
2 answers
1k 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
6 votes
2 answers
422 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
1 answer
459 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
  • 363
6 votes
3 answers
730 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,975
6 votes
1 answer
837 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
  • 394
6 votes
1 answer
691 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
  • 165
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
601 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
  • 137k
6 votes
3 answers
721 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
2 answers
1k views

Tikz standalone the background is transparent make it white

I'm using the below Latex code to draw a tikzpicture \documentclass[convert={density=300,size=1080x800,outext=.png},tikz, border=1cm]{standalone} \usepackage{{xcolor}} \usetikzlibrary{arrows.meta} \...
kelalaka's user avatar
  • 405
5 votes
1 answer
713 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
  • 169
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
355 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,445
5 votes
1 answer
108 views

Naming tikz pics doesn't work on v.3.1.10

In previous versions of tikz the solution of naming pics using a local bounding box used to work. However, in the version 3.1.10, the previous code produces the error: ! Package pgf Error: No shape ...
adn's user avatar
  • 11.4k
5 votes
1 answer
750 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
1k 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
337 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
  • 327
4 votes
3 answers
347 views

Tikz pic: use internal nodes as anchor name

I'd like to use pics to easily and quickly create new node shapes. Sadly, I can't find how to use internal nodes to define anchors. For instance, I'd like the B to point to the small x in the ground ...
tobiasBora's user avatar
  • 8,944
4 votes
2 answers
3k 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,049
4 votes
3 answers
918 views

Nested pics in TikZ 3.0

TiKz 3.0 introduce pics and I like them, but it seems that they are not as powerfull as I wish. For example I'm not able to use nested pics like this : \tikzset{ one/.pic = {\draw[pic actions] (0,...
Kpym's user avatar
  • 23.1k
4 votes
1 answer
837 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
  • 5,327
4 votes
2 answers
578 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
  • 11.4k
4 votes
2 answers
542 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
196 views

How do I draw 90 degree angle arrows and background

I am trying to recreate this graph How do I draw axis-aligned arrows and how can I draw a background? \documentclass[9pt, landscape, twocolumn]{extarticle} \usepackage[T1]{fontenc} \usepackage{...
juan19.99's user avatar
4 votes
2 answers
179 views

wheelchart and danish letter æ ø å

Why can't I get the danish letter æ, ø, å ind the names in my wheelchart I want to write Mængder but it will not work for me. \documentclass[dvipsnames]{standalone} \usepackage[latin1]{inputenc} ...
Jakob Christian Kruse's user avatar
4 votes
1 answer
229 views

Split a Tikzpicture Across Two Pages

Often enough, I run into the problem of a tikzpicture being too large to fit on the page where I would like it to be. Consider the MWE (compiled with pdfLatex): \documentclass[a5paper,12pt,openany]{...
DDS's user avatar
  • 9,776
4 votes
1 answer
138 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

1
2 3 4 5
7