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
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
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
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
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
8 votes
1 answer
941 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
3 votes
2 answers
668 views

Multiple object instances represented by two slightly shifted rectangles

In a software diagram, I'd like to be able to represent multiple instances of an object by two rectangles with one of them slightly shifted. I recently learned about the pic style so I'm using it with ...
Daniel's user avatar
  • 407
2 votes
2 answers
850 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
  • 22.7k
1 vote
2 answers
377 views

Behavior of coordinates when using TikZ

I am trying to position node(2) in a page in coordinates related to the page (origin at upper left corner of the body of the page). My code is: \documentclass[border=10pt,a4paper]{memoir} \usepackage[...
Richard's user avatar
  • 201
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
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
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
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
3 votes
4 answers
664 views

Triangle. Changing vertices. Draw the height of the triangle

1) I'm a drawing triangles in latex, but I want the vertices A and B to be horizontal. In the code below vertices A and C are horizontal. I have problem changing the code. 2) I want to add a ...
Eirik's user avatar
  • 145
0 votes
2 answers
132 views

Markov Chain Arrows and Labels stacked together

I am having challenges with the following: My bottom chain arrows and labels (1-\theta) are stacked together/overlapping which is something I dont like, and I want to add an extra broken line that ...
itc's user avatar
  • 602
0 votes
2 answers
197 views

Tikz standalone the border is not working

I'm currently developing an LFSR drawing library that the latex is output from Python code. One main issue that has been left is the border. \documentclass[convert={density=300,size=1080x800,outext=....
kelalaka's user avatar
  • 365
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
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
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
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
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
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
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
261 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
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
2 answers
499 views

Parametric Pics : Pic Actions at Infinity

This question tries to expand upon the another both of which aim at providing a "Best" practices for tikz-pics or atleast a couple of how to examples clarifying some of the more advanced trickery that ...
Carel's user avatar
  • 978
3 votes
1 answer
774 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
  • 365
3 votes
2 answers
134 views

Transform working tikzpicture into \newcommand with arguments

I am trying to transform the solution of THIS question \documentclass{article} \usepackage{tikz} \usetikzlibrary{tikzmark} \usepackage{leadsheets} \setchords{ major-seven = \textsuperscript{$\Delta$}...
Phys's user avatar
  • 185
3 votes
1 answer
387 views

How to use a \pic in a node's text area {}?

How can I achieve that the \pic "lightning" will appear in the node's text area? I cannot use it there, so I have commented it out. I know or think it's a completely different "environment" (a text ...
gizeh's user avatar
  • 491
3 votes
2 answers
490 views

How to make properly macro with the use of pic?

I'd like do make a picture that consists of few blocks. One of these blocks I called \elementsymbol (in MWE below) - it consists of an arrow surrounded by a circle. I have the problem with scaling of ...
forrest's user avatar
  • 988
2 votes
2 answers
243 views

Printing an element of a non-numeric array as the node label

I want to retrieve a member of a non-numeric array passed to a TikZ pic as an argument, to use it as a node label. \foreach easily does it while iterating over the array, but I cannot do it for the ...
Utkan Gezer's user avatar
2 votes
1 answer
77 views

Nonlinear transformation applied on decorations along path with a custom pic

I am having a problem to apply a single nonlinear transformation to a path decorated with custom pics. A minimal example follows: \documentclass[margin=5pt]{standalone} \usepackage{tikz} \...
iago.oliveira's user avatar
2 votes
1 answer
206 views

Applying transforms to tikz pics defined with named nodes

I have a tikz pic that I wish to rotate and move around. If I define the pic with number coordinates, this works fine. If I define the pic with named coordinates (handy reference points I use for many ...
mathematical.coffee's user avatar
2 votes
1 answer
182 views

Parametric Pics : Sans infinity

Previously I have asked about passing options to pics to manipulate the way in which they are drawn. With this one may create pics with optional components and user controlled dimensions. I haven't ...
Carel's user avatar
  • 978
2 votes
2 answers
444 views

Adding symbols wherever I want in a commutative diagram

So far I have: \documentclass{article} \usepackage{tikz-cd} \usepackage{stmaryrd} \usetikzlibrary{arrows} % \begin{document} \begin{center} \begin{tikzcd}[column sep=large] {\begin{tikzpicture}\draw[...
Irregular User's user avatar
1 vote
1 answer
52 views

Project diagram with tikz

I want to draw the following project diagram with tikz. My attempt is below: \documentclass[border=10pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw (0, 0) rectangle (...
MYaseen208's user avatar
  • 8,515
1 vote
1 answer
322 views

How to enhance the background of a Tikzpicture or a Tcolorbox

I would like to produce either a tcolorbox or a tikzpicture that closely resembles the following image: The following code produces as reasonable facsimile, but not great: \documentclass[12pt]{book} \...
mlchristians's user avatar
  • 7,552
1 vote
2 answers
116 views

How to mirror and position the analog clock dials

I am trying the create analog clock dial with roman or standard numbers on display and at the same time create another one but the mirror image of it. I managed to do that but for some reason a third ...
Aschoolar's user avatar
  • 147
1 vote
1 answer
332 views

Using tikz to generate some figures

Is it possible to use tikz to make the following figure: \documentclass{article} \usepackage{tikz} \begin{document} % Radius of regular polygons \newdimen\R \R=5cm \begin{tikzpicture} \draw [...
Dalek's user avatar
  • 509
1 vote
1 answer
132 views

Looking to Insert a Figure and Wrap It Within a Customized Tikzpicture

This question inquires as to an extension of Daniel N.'s answer found in How to enhance the background of a Tikzpicture or a Tcolorbox Consider the slightly modified code: \documentclass[border=1cm]{...
mlchristians's user avatar
  • 7,552
1 vote
1 answer
119 views

Positioning relative to page in XeLaTeX with package background and 'nested' tikzpictures 'dimension too large'

Context For a personal project I would like to have a tikzpicture on every page that borders the text and all that is on there. I started with LuaLaTeX and wanted to add only a few Chinese characters, ...
PLY's user avatar
  • 149
1 vote
0 answers
111 views

Superimpose content to a movie in beamer [duplicate]

When using the command \movie in beamer, from the package multimedia, it appears that the movie itself appears on top of every other content, so that it seems impossible to display any content over it....
Valéry Benoit's user avatar
1 vote
2 answers
2k views

Tikz pic angle around circle

I am trying do draw an angle around an existing circle. For example, I can draw 10 degree angle: % Drawing circle \draw (0,0) circle [radius=1]; % Drawing 10 degree angle sides \foreach ...
CMTV's user avatar
  • 219
1 vote
3 answers
98 views

looking for Efficient alternative to my tikzpic code

I have a tikzpicture that has repeated elements. Right now I am defining them individually. But I would like to have a code that defines one template-triangle whose dimensions I control (like I do in ...
NAASI's user avatar
  • 2,759
1 vote
2 answers
294 views

Drawing a block diagram in Latex

I am a new user to Latex. Recently I have decided to use latex for preparing my project instead of using MS word. Can any one please help me to draw this block diagram for my project. Thanks in ...
Hemin Ali's user avatar
1 vote
2 answers
259 views

To draw a graph like this, what code do I need?

\documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \usetikzlibrary{intersections} \begin{document} \begin{tikzpicture}[scale=5] \coordinate[label=above left:$A$] (A) at (95:1);...
Bat-erdene Altangerel's user avatar
1 vote
2 answers
968 views

How can I draw this figure about Hidden Markov Model?

How can I draw this figure about Hidden Markov Model?
QIAN HAN's user avatar
0 votes
1 answer
213 views

How can I put picture in a table!

I can put a picture in a table (cheer!), but I want to put a picture with a caption in my table and it's caption will disappear. My table includes both a picture and a tikz. how can I do it? This is ...
Nosrati's user avatar
  • 237
0 votes
2 answers
131 views

How to Draw Inline Symbol List with Rotation using Tikz?

Let's say I have the following string list of symbol: {a,b,+,9,3}. Is there a way to print each element of this list with the possibility - EDIT 1: to control the space between each symbol and - to ...
SylvainRigal's user avatar
0 votes
2 answers
576 views

Setting background color in flowchart

I've a flowchart created in the following manner \tikzstyle{steps} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm, text centered, text width=3cm, draw=black, fill=gray!50] \...
Natasha's user avatar
  • 481
0 votes
1 answer
69 views

Can't connect pics to a node

Unfortunately I am not able to connect node Client1 to port 13. My unsuccessful attempt is shown below. I know that unlike nodes, pics cannot be referenced later. Can someone help me convert port/.pic ...
Z.J's user avatar
  • 347