Questions tagged [tikz-pgf]

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.

Filter by
Sorted by
Tagged with
5 votes
1 answer
379 views

Please help to beautify this connection-graph

I have made a graph that shows connection and relations between nodes. Here is the example: \documentclass[border=3.14mm]{standalone} \usepackage{tikz} \usetikzlibrary{arrows.meta,bending, positioning}...
Miloop's user avatar
  • 549
0 votes
0 answers
29 views

Creating GIF using Tikz animations

I am trying to create a GIF using Tikz "animations" library. I want to create snapshots of frames of the GIF as latex PDF and then merge them into a GIF using online tools. Below is my code. ...
Mostafa's user avatar
  • 45
0 votes
1 answer
46 views

Color the toc using tikz

So, I'm trying to recreate the following style of TOC. I used the following: {\tikz[remember picture,overlay] \draw [fill,red!20] (current page.north west) rectangle +(0.33\paperwidth,-\paperheight)...
Tolaso's user avatar
  • 1,463
0 votes
2 answers
40 views

Nested tikz picture

I want to have the following tikzpicture \begin{tikzpicture} [ node distance = 5cm, on grid, auto, every loop/.style={stealth-}] % State q0 \node (q0) [state, initial, ...
user1868607's user avatar
1 vote
0 answers
30 views

Vertical spacing around equations containing tikz pictures

I use a lot of tikz diagrams in my equations, but I've noticed the spacing around them is weirdly inconsistent. This probably isn't a tikz issue but using tikz diagrams makes it particularly ...
N. Virgo's user avatar
  • 3,835
0 votes
1 answer
29 views

Set a default for tikz decoration marking distance from the line

The following MWE draws a line with a label above it: \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.markings} \begin{document} \begin{tikzpicture} \begin{scope}[ ...
N. Virgo's user avatar
  • 3,835
2 votes
1 answer
55 views

Grouping multiple elements into a single TikZ shape

I want to create a switch multipart shape by grouping several elements while preserving the anchors (sw), (sw1), (sw2), and (sw3), such that I can insert it with the \node command and connect to it ...
Atcold's user avatar
  • 1,645
0 votes
0 answers
38 views

Creating a label below a node (tikz)

I need to add a label "b" right below the lowest vertex. I tried to create an additional node: \node[below] at (-12, -7) {$b$} but then it doesn't compile (run out of time). \documentclass[...
Vika's user avatar
  • 249
0 votes
2 answers
51 views

Clipping a path with TikZ

I understand how to clip with a rectangle, for instance. But how to do it with a different path. I wrote many lines with Bezier curves ( .. controls (,) and (,) ..). So now I have a path with all ...
Didier's user avatar
  • 919
4 votes
2 answers
312 views

oiint using Tikz

How can I properly design a symbol, such as \oiint with Tikz? I've found something like this on the internet \usepackage{tikz} \usetikzlibrary{shapes} \begin{document} \[ \oint\iint {\tikz \node[...
Nolord's user avatar
  • 111
0 votes
1 answer
82 views

How do draw diagonal lines indicating a solid body [closed]

I want to make a schematic of two masses connected by a string. One is positioned on a solid body, the other is hanging down the body's edge. Typically, a solid body is shown by putting diagonal lines ...
TeamPhysics's user avatar
0 votes
1 answer
32 views

Why are all of the nodes in this standalone tikz document moved to the bottom left? I am using pgfplots

I have the following code that I am using in pgfplots in a standalone tikz document: \documentclass[tikz]{standalone} \usepackage{pgfplots} \usetikzlibrary{positioning, arrows.meta} \pgfplotsset{...
Rango's user avatar
  • 31
1 vote
2 answers
44 views

Alternating column sep in tikz-cd

For drawing 3-D diagrams, it is a bit tedious to set the column widths manually to alternate between the “actual” column sep and the column sep that accounts for the perspective: \documentclass{...
Bubaya's user avatar
  • 2,021
5 votes
3 answers
215 views

Why does \foreach expansion in the \draw command not work if the -- operator is at the end?

Look at this MWE here, \documentclass{standalone} \usepackage{tikz} \newcommand{\PolarToX}[2]{ {(#1)*cos(#2)}, {(#1)*sin(#2)} } \begin{document} \tikz{ \draw [very thick] (0, 0) \foreach \i in {0, 1, ....
sigsegv's user avatar
  • 499
2 votes
2 answers
87 views

Several problems with tikz [closed]

Good evening, I am relatively new to LaTeX and Tikz and need your help. I have created a graphic and have come relatively far, but there are still three open points that I cannot solve. These would be:...
manofthousandnames's user avatar
1 vote
0 answers
40 views

De-duplicating a large number of tikz figures

I have a document with a huge (790) number of figures, a lot of them are small trees with various labels. I've externalized the figures to shorten the compile time (25min). However, lots (94 of them) ...
hivert's user avatar
  • 111
2 votes
1 answer
39 views

Problem of xepersian with beamer in TexLive 2023

the following code (from my previous post) without xepersian package works fine but when I add xepersian package it doesn't show the logo! (it was Ok using TexLive 2022) \documentclass{beamer} \...
C.F.G's user avatar
  • 361
1 vote
1 answer
94 views

Filling an area between 2 curves in tikz

I use the following tikz code as a part of a more complicated drawing with other curves using the defined coordinates. How can I fill the area between the intersection of these compound curves? I have ...
Hany's user avatar
  • 4,617
0 votes
1 answer
30 views

Error: I do not know the key \tikz\general shadow

It compiles but I see an error: I do not know the key \tikz\general shadow This is the code: \documentclass[10pt]{article} \usepackage{amstext} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{...
Vika's user avatar
  • 249
0 votes
2 answers
51 views

Joining vertices of polyhedra

I need to join each vertex of the 5-gone with the opposite to the current joined vertex of the 10-gone. See the picture (colors have to be black): So far I have the following, but two vertices are ...
Vika's user avatar
  • 249
3 votes
2 answers
437 views

How to draw an axis with fractional units?

With this picture, I tried \documentclass[border=2mm]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \begin{scope} \draw[->] (-5,0) -- (...
Thuy Nguyen's user avatar
4 votes
1 answer
100 views

How to draw very tiny loops in tikz?

I am trying to draw the Brujin Graph D(2,3) in such a way that it no edges cross, but the loops on {0}{11}{22} are causing me problems. Is there a way to make the loops very small using this format? ...
Dedekid's user avatar
  • 85
0 votes
2 answers
60 views

Help with Tikz colouring and arrow drawing

I'm currently trying to guess this image with Tikz (https://postimg.cc/qhZdj8cD). Unfortunately, my solution doesn't look quite as nice yet. What can I change to make it look more like the picture? I ...
mingabua's user avatar
0 votes
0 answers
20 views

centering matlab2tikz tex file in latex

I used matlab2tikz to convert my plot to a tex file and added it into latex but I encountered some problems. Firstly, my plot isn't in the center of the page. How can I tackle this issue? Secondly, ...
Milito's user avatar
  • 35
1 vote
1 answer
42 views

Forest package - Drop nodes to lowest possible layer

I have the following forest code: \documentclass{article} \usepackage[linguistics]{forest} \begin{document} \begin{forest} for tree={ if n children=0{ font=\scshape, ...
Mew's user avatar
  • 571
7 votes
1 answer
105 views

Symmetric blend modes

I draw a lot of images where semi-transparent regions of different colors mix. Now, the color of the intersection obviously depends on the order in which the regions are drawn (at least in the normal ...
Bubaya's user avatar
  • 2,021
1 vote
0 answers
34 views

Removing white space in Simplest way to create a ring diagram in tikz with multiple connected rings?

I have this code that I modified from this link Simplest way to create a ring diagram in tikz with multiple connected rings?. My problem is when I shifted the shapes above the circle, there was still ...
Diana's user avatar
  • 1,151
3 votes
1 answer
47 views

capacity exceeded error when using l-system

Here is my code: \documentclass{article} \usepackage{tikz} \usetikzlibrary{lindenmayersystems} \pgfdeclarelindenmayersystem{Tree}{ \rule{F -> F [ R [+F] [-F] ]} \symbol{R}{ \pgflsystemstep=...
Gau-Syu's user avatar
  • 453
0 votes
1 answer
36 views

Fit text in face of folding polyhedron with tikz

After a good amount of trial and error, I have managed to fit the text I wanted to face 1 of this polyhedron: \documentclass{article} \usepackage[margin=0.5cm]{geometry} \usepackage{tikz} \begin{...
jjmerelo's user avatar
  • 200
2 votes
1 answer
33 views

Fix node position in tikzpicture between \only-slides in beamer

I want to show a graph on a beamer slide. However, using \begin{frame} \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=2cm,semithick] % Nodes \node[draw,circle,fill=cyan!...
Rott's user avatar
  • 23
-1 votes
0 answers
25 views

centered rectangle relative to object

I would like to define a rectangle relative to an image that I import in tikz such that the rectangle is centered with respect to the image. \begin{figure*} \begin{tikzpicture} \node[anchor = south ...
Fly's user avatar
  • 313
0 votes
1 answer
35 views

Can't include an image in a folded cube in Tikz

I'm trying to create a papercraft cube, and can't seem to get an image in one of the faces. I have tried this \documentclass{article} \usepackage[paperwidth=8cm,paperheight=8cm,margin=0.5cm]{geometry} ...
jjmerelo's user avatar
  • 200
4 votes
1 answer
234 views

Curly brace with arrows pointing to specific code

I would like to use horizontal brackets within a code environment like in the following example: That's as far as what I have. \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows.meta} \...
wayne's user avatar
  • 601
3 votes
1 answer
38 views

Using pgfplots to display a dataset and a function at the same time not working

As the title suggests, I'm trying to display a data set and a function in the same graph - more or less like this excel graph, with the blue dots representing the data, and the orange line being the ...
m0n74g3's user avatar
  • 67
1 vote
0 answers
28 views

How Can I change the legend positon

I would like to change the position of the legend, modifying the current position by placing it below and centered between the graphic (c) and (d). \begin{figure} \begin{tikzpicture} \begin{...
TFK's user avatar
  • 11
1 vote
1 answer
53 views

Custom starting point of arrows in TIkZ

I have the following code: \begin{center} \begin{tabular}{c c c c c} T1 & T2 & T3 & T4 & T5 \\ & & & & Read x \tikzmark{a} \\ Read x \tikzmark{b} \\ &...
Janka's user avatar
  • 13
0 votes
2 answers
42 views

scale awesomefont5 icon to fill the box border

Below code create a node with a icon from awesomefont5 library but it's too small. I would like the icon scale to the border dimension. \documentclass[convert]{standalone} \usepackage{tikz} \...
lucky1928's user avatar
  • 3,705
2 votes
2 answers
51 views

Illegal unit, and missing number when trying to define variables

When trying to make a sequence of graphs of step functions, I wrote the following code snippet: \begin{tikzpicture} \pgfmathsetmacro{\n}{2^3}; \pgfmathsetmacro{\step}{1/\n}; \foreach \i in {0,\step,......
Addem's user avatar
  • 783
0 votes
1 answer
62 views

My wheel chart displays fine but I have an error in the logs

I am trying to create a wheel chart and it displays almost fine but i still have an error: Package tikz Error: Cannot parse this coordinate. ‪main.tex, 32‬ See the tikz package documentation for ...
Balansoire's user avatar
4 votes
3 answers
163 views

Customize Tikz Circle Labels to Flow Along with the Circle Curve

I want to label a circle I drew as a conglomeration of arcs and want it labeled on some nodes that will flow along the circle curves. What I currently have are horizontal labels, which do not flow ...
Daniel James's user avatar
1 vote
1 answer
98 views

How to place a box within a box using tikz?

I would like to draw a diagram as below. So far, i wrote this. Can you please help me in modifying this code. \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{tikz, pgfplots} \...
iman fathema's user avatar
1 vote
1 answer
111 views

Recreating a Fancy Chapter Style

I am attempting to create the chapter style below in LaTeX, where the grey box represents a different image chosen for each chapter. I'd like the chapter title (in this example "Complex Numbers&...
wrb98's user avatar
  • 847
5 votes
2 answers
289 views

Label circle in and out with TikZ

I want to label a circle in and out, like this sketch: I have also tried to form the circle in my own very simple way as follows: \documentclass{article} \usepackage{tikz} \begin{document} \begin{...
Daniel James's user avatar
1 vote
1 answer
68 views

TikZ path decoration: How to include the degree symbol

I am accustomed to using the degree symbol in LaTeX and know most of the ways to create it. However I am unable to use the degree symbol within a text decoration. In the following example I simply ...
Aendie's user avatar
  • 257
1 vote
1 answer
71 views

How can I draw event on top of each other on a timeline?

I want to draw events on top of each other on a time-line. As an example, I want to draw following figure, where event boxes could be place in different locations: For https://tex.stackexchange.com/a/...
alper's user avatar
  • 1,256
1 vote
1 answer
45 views

Problem with mdframed, listings and TikZ for a codeblock

Context For a document I am writing, I use mdframed and listings to create a "fancy" codeblock look. I use rounded corners and custom colors for this view. During the creation of this ...
questionman's user avatar
2 votes
4 answers
112 views

Issue drawing all the connectors in digital circuit

I am trying to convert this digital circuit into Latex code. It is a full subtractor. I saw that in the blog there are anyone else that post the same function, but it resolves the circuit in a ...
eng's user avatar
  • 21
0 votes
1 answer
67 views

Correctly scale and space TikZ symbol in math mode

I wish to define a mathematical symbol, similar to \odot, using TikZ. The symbol should thus scale appropriately in accordance with its context (e.g. inline math, footnotes, diagrams, etc.). As a ...
varkor's user avatar
  • 445
0 votes
0 answers
30 views

Making arrow heads smaller globally

In TikZ, single arrows between nodes can be scaled down using the scale command, for instance: \draw[-{>[scale=0.5]}](A)--(B); I would like all arrows in my entire document to have smaller heads. ...
Zuy's user avatar
  • 237
10 votes
1 answer
255 views

Why arc with angles given by "trig format=rad" gives wrong result?

Consider the following MWE: \documentclass[border=10pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[trig format=rad,red] (0:1) arc(0:pi:1); \draw[blue] (0:1) arc(0:180:1)...
Zarko's user avatar
  • 284k