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
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
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
4 votes
3 answers
348 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,964
14 votes
1 answer
350 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
997 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
4 votes
3 answers
919 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
3 votes
2 answers
720 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
  • 429
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,798
3 votes
2 answers
243 views

Generate TikZ \pics dynamically

I want to generate TikZ \pics dynamically. All information I need to setup the pic (name, x-coord, y-coord) are given in a tabular. Is there a way to inject these information to the TikZ environment ...
PascalS's user avatar
  • 750
1 vote
2 answers
502 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
  • 210
0 votes
1 answer
233 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
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
1 answer
654 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
  • 208k
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
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
3 votes
4 answers
840 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
3 votes
1 answer
640 views

How to pass boolean value to a tikz option key

I have trouble understanding how to properly use tikz keys and pass them. Let's say I want to code two tikz pics with both a "fill" argument. I sometimes end up writing things like the example below. ...
Zooky's user avatar
  • 461
0 votes
2 answers
181 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 ...
zetyty's user avatar
  • 777
0 votes
2 answers
237 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
  • 655
0 votes
2 answers
331 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
  • 405
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
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
  • 461
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
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
603 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
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
843 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
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
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
4 votes
2 answers
535 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
  • 988
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,059
3 votes
3 answers
194 views

Node in unwanted position using tikzpicture

I am trying to adjust the position of a node in a tikz figure but for some reason the dot that I create doesn't show in the appropriate coordinate (0,8/3) that is imposed. @codeR suggested me to put ...
Waxler's user avatar
  • 860
3 votes
1 answer
100 views

Change \includegraphics to a TikZ \pic in \pgfplotstabletypeset

I would like to change the content of my pgf table column "Image" from using an included graphic to a predefined TikZ \pic based on the information in column "Type". The \pic ...
PascalS's user avatar
  • 750
3 votes
2 answers
158 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
2 answers
517 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
  • 970
3 votes
1 answer
442 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
2 votes
2 answers
1k views

Tikz: Block diagram with summation block having crossed lines

I want to draw the block diagram as shown in the below figure. I have made the following code \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes,arrows} \begin{document} \...
ShJ's user avatar
  • 931
2 votes
1 answer
189 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
  • 988
2 votes
1 answer
96 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
2 answers
277 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
2 answers
453 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
2 votes
1 answer
236 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
2 answers
136 views

Automatic rotation and symmetry of a pic

I've got a tile that I need to rotate or to symmetrize a certain amount of times to make a pattern. I defined the pic itself and made the pattern manually. I failed to automatize the process. Is ...
SebGlav's user avatar
  • 19.3k
1 vote
2 answers
129 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
3 answers
118 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,839
1 vote
1 answer
127 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,589
1 vote
2 answers
353 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
1 answer
178 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