Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [tikz-calc]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
56 views

\NewDocumentCommand with TikZ calc library

recently I was doing a lot of various diagrams and found myself experimenting with the \newcommand to define labels and "variables". As such I wanted to expand and experiment with commands ...
jr.root.cs's user avatar
2 votes
0 answers
67 views

Tikz calc distance modifier erros on rotated lines in matrix

I want to illustrate how to group together certain terms in an infinite table. So far I have made this: I also want to group a₂b₃ with a₃b₂, and make another group for a₃b₃. So far i have made the ...
RBP's user avatar
  • 21
0 votes
0 answers
88 views

Regarding tikz error

main.tex for MWE: \documentclass{report} \usepackage{csquotes} \usepackage{graphicx} \setcounter{tocdepth}{4} \setcounter{secnumdepth}{4} \usepackage[tableposition=top]{caption} \usepackage{subcaption}...
SDe's user avatar
  • 1
0 votes
0 answers
17 views

Wrong output from power operator in TikZ declare function [duplicate]

I'm using the TikZ declare function key and getting some weird results with squaring. \begin{tikzpicture}[declare function={f(\x)=\x*\x;}] \node {\pgfmathparse{f(-.5)} \pgfmathresult}; % outputs *...
RetroCraft's user avatar
9 votes
1 answer
287 views

Determine TikZ bend direction automatically

Consider the following example: \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture} \node (A) {A}; \node (B) [right=2cm of A] {B}; \draw[->,...
Alan Munn's user avatar
  • 219k
5 votes
2 answers
271 views

Drawing planar mechanisms in tikz

I am trying to improve this picture made in Word by using Tikz. I have made some advancements but there are some questions that kept me stuck. Regarding the angles, I need to draw a line at some ...
Frank R.'s user avatar
1 vote
1 answer
50 views

Placing nodes along an ellipse with variables

My question is almost exactly the same as here: I would like to place a node along an ellipse, but using variables. I built a MWE based on the best rated answer: \documentclass[tikz, border = 5mm]{...
mistral's user avatar
  • 45
3 votes
0 answers
70 views

Why is $(O) + ($(X)!(O)!(D)$)$ is not projecting correctly

\documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} % Draw the axes \draw[->] (-1,0) -- (7,0) node[right] {$x$}; \draw[->] (0,-1) --...
munish's user avatar
  • 131
0 votes
0 answers
48 views

Generating 3D coordinates using let command

I want to create a tikz figure with 3d coordinates. I wanted to use 3D coordinates to make life easier, but when I implemented the cross-product using the let command, an error "Dimension too ...
MKHoffmann's user avatar
4 votes
2 answers
207 views

Rotating a plane around its edge on TikZ

I'm trying to rotate the red plane in the right side around the its edge AB, the question is actually about rotating anything around a arbitrary path, I know the rotate around command and that I can ...
Mrcp82's user avatar
  • 43
4 votes
2 answers
692 views

How to create a vertical timeline in LaTeX with proportional division of entries (possibly avoiding repetition of years)?

I could use some help in creating a vertical timeline with specific requirements. The timeline should display dates on the left side of a vertical line, with the corresponding labels on the right. The ...
BlueIris's user avatar
  • 339
3 votes
3 answers
145 views

TikZ node width depending on two nodes distance

I am trying to make a schematic, where I need to have a rectangle with the minimum width set to the distance between two other rectangle nodes. I tried to follow the solutions from Compute the x ...
Krzysztof's user avatar
  • 121
0 votes
1 answer
121 views

Page Background for Certain Pages Only

Consider the code: \documentclass{article} \usepackage{background} \usetikzlibrary{calc} \usepackage{lipsum} \backgroundsetup{ color=black, scale=1, opacity=1, angle=0, contents={\tikz\draw[line ...
DDS's user avatar
  • 8,986
1 vote
0 answers
46 views

What are all the possibilities of the calc library to position a point or a line?

I know how to draw with the calc library a perpendicular line of given length a perpendicular line passing through a point a line of any angle passing through a point Are there any other ...
rpapa's user avatar
  • 12.4k
0 votes
1 answer
89 views

Evaluate rotation based on atan x

I would like to express the angle of rotation for the tangent line in terms of atan x using the slope (which is calculated earlier in the problem). I can get it to work using the angle but I do not ...
Garth Fleming's user avatar
2 votes
2 answers
108 views

Displaying decimal divisions

Here is a way to display decimal divisions. I have indicated the problem I am facing. I suspect that the use of some calculation is needed here. I know that xlop exists, but for several reasons I am ...
projetmbc's user avatar
  • 13.4k
1 vote
1 answer
39 views

TikZ - Positionning labels in a basic Venn digaramm

The code given below can produce the following diagram, but the positioning of the labels for the percent values are made by hand... Can this human activity be avoided? MWE \documentclass[tikz]{...
projetmbc's user avatar
  • 13.4k
3 votes
1 answer
238 views

Parallelogram Rule and Head to Tail Rule

Here's my current MWE: \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \tikzset{>=stealth} \colorlet{veccol}{green!45!black} \tikzstyle{vector}=[->,very thick,veccol] \begin{...
SingularisArt's user avatar
3 votes
2 answers
434 views

How to Draw Electrons on Bonds Using Chemfig and Contain a Chemfig withn a Box?

I have been playing around with the "chemfig" package to get electrons drawn on a given bond. I used the "chemmove" command to draw the electrons, but it is inefficient to modify ...
Jon's user avatar
  • 133
1 vote
2 answers
259 views

Rotation number of a vector field

I am trying to define what is the rotation number of a vector field and for this I need to show the following graph (or one quite similar) my attempt is as follows (I used as template the code given ...
Zaragosa's user avatar
  • 599
4 votes
1 answer
103 views

Centering a line between to nodes using tikz

I'm trying to create a tikz picture where I have an image with some text to the right of it. Between the image and the text I want to draw a vertical line that is the same distance away from the edge ...
user avatar
0 votes
1 answer
39 views

TikZ - Calculate the middle of a polyline

In the code below, I poorly put a text below the middle of a polyline. I would like to automate this: the parameter is -.75 in ++(0,-.75) used to draw the polyline. What is the best way to achieve ...
projetmbc's user avatar
  • 13.4k
1 vote
1 answer
62 views

Tikz : Point C at distance k on line AB

I'd like to define the point C on line AB such that AC=k, using the calc library and the let... in... command. This does not work, why? Is there a unit problem (C seems to be pretty close to A)? I ...
Hugues VERMEIREN's user avatar
2 votes
1 answer
450 views

tikz cosine function plot without pgf

I am trying to plot a function with cosine and exp. It can plot the exp part but not the cosine. I have tried cos, \cos, cosine, \cosine none work. This code used to work for 3 months ago maybe ...
Simon Chemnitz-Thomsen's user avatar
1 vote
1 answer
51 views

On defining a macro using \edef and assigning the x-component of a given node to it

Let us assume that we have a node in Tikz and we want to have a macro called \myx using \edef to assign the x-component of the node to \myx. Below is my code: \documentclass{standalone} \usepackage{...
Aria's user avatar
  • 1,523
2 votes
1 answer
93 views

Problem with \tikzdeclarecoordinatesystem

I create a new coordinate system with \tikzdeclarecoordinatesystem. Compiles true when scale=1 and false otherwise. Why? Can you help me? Thanks alot. This is my code. \documentclass[tikz, border=2mm]{...
ducanh2021's user avatar
3 votes
2 answers
159 views

Weird Tikz positioning behaviour; calc, \graph, subgraph

I have the following code. It behaves as expected when only one middle node is drawn; however, when both are there the result is surprising. Why is that? How can I fix it? \documentclass[border=2mm]{...
Aria's user avatar
  • 393
1 vote
2 answers
272 views

TikZ: fill a percentual part of a rectangle node

I have a rectangle node, say 2cm times 3cm. Is there a TikZ-like way to fill a percent value, say p, of that rectangle, similar as shown in the picture (for 34.5%). So the yellow area shall be e.g. ...
cis's user avatar
  • 8,266
0 votes
1 answer
332 views

Recursive function in pgfplots

I'm trying to plot Legendre polynomials, which can be done very easily by calling a recursive function. For instance, in Python this would like like this: def legendre(xi, p): if p==0: ...
aaragon's user avatar
  • 3,051
3 votes
1 answer
302 views

Draw Arcs On Spherical Caps With Fill

I asked this question: Draw Arcs On Spherical Caps and a user was kind to answer. However, I am trying to improve on design by changing some colors, adding fill, and adding coordinate (x,y,z) axis ...
Vladimir's user avatar
  • 827
1 vote
1 answer
77 views

How to calc coordinates of a middle of calculated segment?

\documentclass[12pt]{scrartcl} \usepackage{pgfplots} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \coordinate (a) at (-2,5); \coordinate (b) at (-2,0); \...
Allok's user avatar
  • 405
3 votes
1 answer
533 views

Using tikz-calc addition of coordinates along with macros

I am trying to use tikz-calc to automatically calculate coordinates in custom macros, using the coordinate addition function ($ (x,y) + (a,b) $). Things seem to go awry when I try to add coordinates ...
Jordan Mitchell Barrett's user avatar
1 vote
2 answers
369 views

how to draw n horizontal y-axis parallel lines intersect m vertical x-axis parallel lines

use \foreach command add node circle \begin{tikzpicture}[scale=0.5] \draw[->] (-10, 0) -- (10, 0) node[right] {$x$}; \draw[->] (0, -10) -- (0, 10) node[above] {$y$}; { \foreach \n in {8,7,...
esvhei temvvjin's user avatar
4 votes
3 answers
609 views

Calculation summations in Latex

Anyone can help me please? I need to calculate the sum 1+1/2+1/3+...1/n (n given) by using only Latex commands. I have no idea how can I do this. Many thanks.
Angelo Aliano Filho's user avatar
1 vote
1 answer
94 views

tipfr package: how to write some buttons (request: only pdfLaTeX)

Related of this my previous question here: Search for a package to generate graphic displays of calculators I'm searching to write something as \sin^{-1} for my students similar to this picture taken ...
Sebastiano's user avatar
  • 55.2k
5 votes
2 answers
1k views

TikZ: Get (dimensionless) distance between node anchors

In the following picture I want node C to be as wide as the distance between (A.north east) and (B.south west) as indicated in the picture; I tried defining a new node D with \n1 as minimum width, and ...
mathbekunkus's user avatar
  • 1,389
2 votes
2 answers
474 views

Tangent Circles using TikZ

I am trying to use TikZ to draw tangent circles contained in a rectangle, but I have encountered some difficulties. I am also soliciting general feedback on using TikZ better, so I am giving a fair ...
bclzyjhr's user avatar
  • 447
2 votes
1 answer
134 views

Tikz, error in computation of coordinates

I would like to draw 3 vectors starting at (m) and with computed length, but things go wrong. Basically I get an error or a rendering error (according to the differend attempts) in the 1st and 3rd ...
PeptideChain's user avatar
  • 1,335
3 votes
2 answers
270 views

Expansion of "\coord" macro in TikZ "let" command

Please consider this code: \documentclass[border=10pt]{standalone} \usepackage{tikz} \usetikzlibrary{calc} \def\coord(#1){coordinate(#1)} \begin{document} \begin{tikzpicture} \node[draw](A) at (...
Rmano's user avatar
  • 41.4k
3 votes
1 answer
525 views

tikz arithmetic with numbers and lengths

Consider this example: \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \def\starty{3} \def\length{1}; \coordinate(a1) at (1, \starty); \...
Viesturs's user avatar
  • 7,965
2 votes
1 answer
134 views

Can tikz projections be computed in three dimensions?

According to the pgf manual, the syntax <coordinate>!<projection coordinate!<angle>:<second coordinate> can be used to project <projection coordinate> orthogonally onto ...
Brian Fitzpatrick's user avatar
6 votes
1 answer
860 views

best way to draw planes in 2d?

I would like to replicate the following image and I would like to know how to represent the third state into the page by using the tikz-3dplot package, maybe starting from the answer to a previous ...
Nenne's user avatar
  • 697
1 vote
0 answers
82 views

How to Calculate x-Position in a pgfplots with Information from a Table

Situation and Problem This question is a follow-up and based on marmots answers to this question and this. The general situation is described there. Now I want to simplify input. More specifically I ...
BadAtLaTeX's user avatar
  • 1,149
2 votes
1 answer
811 views

Drawing a set with a particular shape

I would like to draw a non-convex set as in the following image and I like to start from my MWE: \documentclass[12pt,a4paper]{book} \usepackage{tikz} \usetikzlibrary{calc, shadings} \usetikzlibrary{...
Nenne's user avatar
  • 697
3 votes
1 answer
162 views

Dynamic bar plot from file

I need to draw a bar chart based on the data from the file. The data looks something like this \begin{filecontents*}{tls.dat} Name Abbreviation percentage Bod-Kin LS1 60 Intraper LS2 40 ...
Almic7's user avatar
  • 131
2 votes
1 answer
129 views

Defining intersections and nodes

I've replicated the figure below through the following MWE \documentclass[12pt,a4paper]{article} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture}[dot/.style={circle,...
Nenne's user avatar
  • 697
5 votes
2 answers
363 views

Drawing perpendicular lines, filling areas

I still have some trouble with perpendicular lines. This is the figure I'd like to replicate This is my MWE \documentclass[12pt,a4paper]{article} \usepackage{tikz} \usetikzlibrary{calc} \begin{...
Nenne's user avatar
  • 697
2 votes
1 answer
4k views

Drawing a simple plane in 3D space

I'm trying to produce this simple 3d picture, but, since it's the first time I draw a 3d pic, I'm not sure about how to get the plane passing through the line X. The following code shows a first ...
Nenne's user avatar
  • 697
4 votes
2 answers
404 views

Intersections in Tikz

The following code produces , however I would like to highlight the intersection area between the line through the coordinates A and B and that perpendicular to the vector x.3, defined in the \...
Nenne's user avatar
  • 697
3 votes
1 answer
655 views

Drawing lines using \foreach

I'd like to get a picture similar to that uploaded below. Basically, I'm trying to add perpendicular lines to every ray on the positive orthant. This is my attempt, could you tell me what is wrong in ...
Nenne's user avatar
  • 697