TikZ
- aligning an element at the top tabular [duplicate]by Khánh Bùi on November 19, 2025 at 12:53 pm
I don't know how to put the "solution" at the top of the column. Here is my code. Can anyone help me? \begin{tabular}{c|c} \input{picture} & solution \end{tabular} %the picture is tikz code
- TQFT non-usual cobordism drawingby MATIAS EZEQUIEL STICCA GONZLEZ on November 19, 2025 at 12:43 am
I'm currently trying to recreate something like this: Using of course the tikz tqft library. So, I first tried to do the "easiest" part, that is the drawing alone of every cobordism used in the relation. So, here's my attempt for that: \documentclass[10pt,border=3mm,tikz]{standalone} \usepackage{tikz} \usetikzlibrary{shapes.geometric,tqft} \usepackage{tqft} \tikzset{tqft/use nodes=true} \begin{document} \begin{tikzpicture}[ tqft, mycobordism/.style={ draw, boundary lower style={draw}, boundary upper style={draw}, circle width=0.4cm, circle depth=0.15cm, } ] \node[ tqft cap, mycobordism, cobordism height=2cm, flow=east, anchor=center ] (a) at (-0.7,0) {}; \node at (0, -0.8) {$\epsilon$}; \node at (0, -1.1) {counit}; \end{tikzpicture} \begin{tikzpicture} \tikzset{ tqft/use nodes=false, } \pic[ tqft, incoming boundary components=0, outgoing boundary components=2, genus=0, every lower boundary component/.style={draw}, every outgoing boundary component/.style={draw}, cobordism edge/.style={draw}, ]; \end{tikzpicture} \end{document} Aaaaand, as you may see, the problems begins. First, it seems that if you use a cobordism that is not the "primary ones" (I mean, pair of pants, cup, etc) then you have to add the command node=false, and then I'm unable to do two things: labelling the cobordism and rotating it so it's not looking down. Well, I can worry about the equalities later, but I'd appreciate if someone has some idea of how to "glue" cobordisms in general, so I can try it on my own and learn how to do it, because these ones are the simplest ones that I need to do. Anyways, thank you!
- interaction between command \IfNoValueTF and baseline in TikZby Léo S. on November 18, 2025 at 10:12 pm
I am trying to define a command that draw TikZ pictures whose baseline is centered, with an optional argument to modify the y-coordinate of the baseline. I came up with the following code. When the optional parameter is provided, it behaves as expected. However, when no parameter is provided, it doesn't do what I expected: instead, it seems to pick the top as the baseline. If I manually replace the parameters, it behaves as expected. What is it that I am missing? \documentclass{article} \usepackage{tikz} \NewDocumentCommand{\tikzpic}{mO{}}{ \begin{tikzpicture}[ baseline=(base), ] #1 \IfNoValueTF{#2} {\coordinate (base) at (current bounding box.center);} {\coordinate (base) at (0,#2);} \end{tikzpicture} } \begin{document} command \tikzpic{ \draw (0,0) rectangle (1,1); } \medbreak expected behaviour \begin{tikzpicture}[ baseline=(base), ] \draw (0,0) rectangle (1,1); \coordinate (base) at (current bounding box.center); \end{tikzpicture} \end{document}
- How to stretch a content like the wave?by Sunshine on November 18, 2025 at 8:34 pm
For example, the 'orange' we want the effect below: The text moves vertically according to the height(of the waveline path) below. If there are some words on a piece of cloth, imagine what will happen?
- circuiTikZ: Transistor where the lines of the emitter and collector start at the same pointby cis on November 18, 2025 at 2:56 pm
Is there a circuitikz-package-like way, to get a transistor like this? This means where the lines of the emitter and collector start at the same point. \documentclass[margin=5mm]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[] \draw (0,0) node[npn](T){}; \draw (T.B) node[left]{B} (T.C) node[above]{C} (T.E) node[below]{E}; \end{circuitikz} \end{document}
- How to align this flowchart in TikZ?by Yilin Cheng on November 18, 2025 at 12:13 am
(In order to ensure that each post should only focus on one key point, I have reformulated my question and provided the modified TikZ code. )For the problem How can I use straight lines to connect elements inside nested TikZ environments?, how to align?
- How can I use straight lines to connect elements inside nested TikZ environments?by Yilin Cheng on November 17, 2025 at 6:13 am
I am currently refining the flowchart in this problem Why does \begin{figure}[H] disrupt line spacing?. The solution in the problem involves using nested TikZ, but I have encountered another issue that I cannot resolve: For example, connecting nodes B and C across two separate TikZ environments, but the generated result is: and I want to get: LaTeX code is as follows (not exactly a minimal working example, but relatively concise): \documentclass{ctexart} \usepackage{ctex} \usepackage{setspace} \setstretch{1.5} \usepackage{float} \usepackage{tikz} \usepackage{standalone} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture}[remember picture,foo/.style={draw,inner sep=5pt},>=stealth] \node[foo,font=\bfseries] (O) {A}; \node[foo,font=\bfseries] (A) [below=of O] {\begin{tikzpicture}[remember picture,nodes={foo,draw,minimum width=1cm}] \node (X_1) {B}; \end{tikzpicture} }; \node[foo,font=\bfseries] (B) [below=of A] {\begin{tikzpicture}[remember picture,nodes={foo,draw,minimum width=1cm}] \node (X_2) {C}; \end{tikzpicture} }; \draw[-] (X_1.south) -- (X_2.north); \end{tikzpicture} \end{document} Is there any feasible approach to address this concern? Your comments and alternatives are highly appreciated. PS: I have drafted the flowchart according to the method proposed by @Explorer, but certain aspects lack aesthetic refinement, and the connecting lines are not entirely vertically aligned. \documentclass{ctexart} \usepackage{ctex} \usepackage{setspace} \setstretch{1.5} \usepackage{float} \usepackage{tikz} \usetikzlibrary{positioning,fit,calc} \begin{document} \begin{tikzpicture}[ >=stealth, foo/.style 2 args={draw,font=\bfseries,inner sep=5pt,minimum width=#1 cm,minimum height=#2 cm}, foo/.default={1}{0.8}, box/.style={draw,inner sep=8pt,rounded corners=2pt,minimum width=15cm,minimum height=2.5cm}, small/.style={draw,inner sep=3pt,minimum width=1cm,minimum height=0.6cm,font=\small} ] \node[foo] (O) {test}; \node[foo] (A) [left=2cm of O] {test}; \node[foo] (B) [right=2cm of O] {test}; \draw[->] (A) -- (O); \draw[->] (B) -- (O); \node[small] (X_o) [below=2.5cm of O] {test}; \node[small] (X_a) [left=3cm of X_o.center] {test}; \node[small] (X_b) [right=3cm of X_o.center] {test}; \node[small] (X_c) [below=1.2cm of X_o] {test}; \node[small] (X_d) [above=1.2cm of X_a] {test}; \node[small] (X_e) [below=2.4cm of X_a] {test}; \draw[->] (X_d) -- (X_a); \draw[<-] (X_a) -- (X_o); \draw[<-] (X_b) -- (X_o); \draw[<-] (X_c) -- (X_o); \draw[<-] (X_e) -- (X_a); \draw[->] (X_c) -| ([xshift=1.2em]X_a.south); \draw[->] (X_c) -| (X_b.south); \node[box] (X_box) [fit=(X_o)(X_a)(X_b)(X_c)(X_d)(X_e)] {}; \node[font=\bfseries,anchor=north] at (X_box.north) {test}; \draw[<-] (X_box.north) -- (O); \node[small,text width=5em,align=center] (Y_o) [below=4cm of X_o] {test}; \node[small,text width=5em,align=center] (Y_a) [below=1cm of Y_o] {test}; \node[small,text width=5em,align=center] (Y_dfp) [below=1cm of Y_a] {test}; \node[small,text width=1em,align=center] (Y_c) [left=0.3cm of Y_a] {test}; \node[small,text width=1em,align=center] (Y_d) [right=0.3cm of Y_a] {test}; \node[small,text width=3em,align=center] (Y_e) [left=3cm of Y_o.center] {test}; \node[small,text width=3em,align=center] (Y_i) [below=1cm of Y_e] {test}; \node[small,text width=1em,align=center] (Y_j) [below left=0.8cm and -0.5cm of Y_i] {test}; \node[small,text width=1em,align=center] (Y_k) [below right=0.8cm and -0.5cm of Y_i] {test}; \node[small,text width=3em,align=center] (Y_f) [right=3cm of Y_o.center] {test}; \node[small,text width=3em,align=center] (Y_g) [below=1cm of Y_f] {test}; \node[small,text width=3em,align=center] (Y_h) [below=1cm of Y_g] {test}; \draw[-] (Y_o) -- (Y_a); \draw[-] (Y_a) -- (Y_dfp); \draw[-] (Y_c.north) |- (Y_o.west); \draw[-] (Y_c.east) -- (Y_a.west); \draw[-] (Y_d.north) |- (Y_o.east); \draw[-] (Y_d.west) -- (Y_a.east); \draw[-] (Y_dfp.west) -| (Y_c.south); \draw[-] (Y_dfp.east) -| (Y_d.south); \draw[-] (Y_e) -- (Y_i); \draw[-] ([xshift=-0.3em]Y_i.south) -- ++(0,-0.5) -| (Y_j.north); \draw[-] ([xshift=0.3em]Y_i.south) -- ++(0,-0.5) -| (Y_k.north); \draw[-] (Y_f) -- (Y_g); \draw[-] (Y_g) -- (Y_h); \node[box] (Y_box) [fit=(Y_o)(Y_a)(Y_dfp)(Y_c)(Y_d)(Y_e)(Y_i)(Y_j)(Y_k)(Y_f)(Y_g)(Y_h)] {}; \node[anchor=east,text width=1em,font=\linespread{1.}\bfseries] at (Y_box.east) {test}; \draw[<-] (Y_box.north) -- (X_box.south); \node[small,text width=4em,align=center] (Z_o) [below=2.2cm of Y_dfp] {test}; \node[small,text width=4em,align=center] (Z_hedge) [left=3cm of Z_o.center] {test}; \node[small,text width=4em,align=center] (Z_f) [right=3cm of Z_o.center] {test}; \node[box] (Z_box) [fit=(Z_hedge)(Z_o)(Z_f)] {}; \node[font=\linespread{1.}\bfseries,anchor=east,text width=1em,] at (Z_box.east) {test}; \draw[->] (Y_dfp.south) -- (Z_o.north); \draw[<-] (Z_f) -- (Y_h); \draw[<-] ([xshift=-0.3em]Z_hedge.north) -- ++(0,0.5) -| (Y_j.south); \draw[<-] ([xshift=0.3em]Z_hedge.north) -- ++(0,0.5) -| (Y_k.south); \node[small,text width=7em,align=center] (U_o) [below=1.5cm of Z_o] {(\textbf{test})\\test}; \node[small,text width=6em,align=center] (U_g) [left=3cm of U_o.center] {(\textbf{test})\\test}; \node[small,text width=6em,align=center] (U_f) [right=3cm of U_o.center] {(\textbf{test})\\test}; \node[box] (U_box) [fit=(U_g)(U_o)(U_f)] {}; \node[font=\linespread{1.}\bfseries,anchor=east,text width=1em,] at (U_box.east) {test}; \draw[->] (Z_hedge.south) -- (U_g.north); \draw[->] (Z_o.south) -- (U_o.north); \draw[->] (Z_f.south) -- (U_f.north); \node[foo] (Z) [below=1cm of U_o] {\textbf{test}}; \draw[<-] (Z.north) -- (U_box.south); \end{tikzpicture} \end{document} why the vertical lines are still skewed when U_o.center and Z_o.center should be aligned (I have let the [left=3cm of U_o.center] and [left=3cm of Z_o.center])? PS: I will update this ... PS: I update in link and the problem is completely: https://tex.stackexchange.com/a/755001/307309 and thanks to @Explorer and @MS-SPO.
- help with 3D Surface plot TikZby Mark Roelands on November 16, 2025 at 9:20 pm
Can someone please help with coding the surface plot for $\sqrt{(x - 1)^2 + y^2} + \sqrt{(x + 1)^2 + y^2} - 4 = -|z|$ in TikZ for my article in LateX? I have been trying, but can't seem to manage it. This is what I have so far, it only plots one half of the surface on a square but not within the disk: \begin{tikzpicture} \begin{axis}[ hide axis, colormap/cool, ] \addplot3[ mesh, samples=50, domain=-2:2, ] {deg(sqrt((x - 1)^2 + y^2) + sqrt((x + 1)^2 +y^2) - 4)}; \end{axis} \end{tikzpicture}
- TikZ forest: how to add vertical dots to the 'top' or bottom of a directory tree?by Grass on November 16, 2025 at 9:51 am
cfr provides us with a nice starting MWE to create directory trees: \documentclass[border=10pt,multi,tikz]{standalone} \usepackage[edges]{forest} \definecolor{folderbg}{RGB}{124,166,198} \definecolor{folderborder}{RGB}{110,144,169} \newlength\Size \setlength\Size{4pt} \tikzset{% folder/.pic={% \filldraw [draw=folderborder, top color=folderbg!50, bottom color=folderbg] (-1.05*\Size,0.2\Size+5pt) rectangle ++(.75*\Size,-0.2\Size-5pt); \filldraw [draw=folderborder, top color=folderbg!50, bottom color=folderbg] (-1.15*\Size,-\Size) rectangle (1.15*\Size,\Size); }, file/.pic={% \filldraw [draw=folderborder, top color=folderbg!5, bottom color=folderbg!10] (-\Size,.4*\Size+5pt) coordinate (a) |- (\Size,-1.2*\Size) coordinate (b) -- ++(0,1.6*\Size) coordinate (c) -- ++(-5pt,5pt) coordinate (d) -- cycle (d) |- (c) ; }, } \forestset{% declare autowrapped toks={pic me}{}, declare boolean register={pic root}, pic root=0, pic dir tree/.style={% for tree={% folder, font=\ttfamily, grow'=0, }, before typesetting nodes={% for tree={% edge label+/.option={pic me}, }, if pic root={ tikz+={ \pic at ([xshift=\Size].west) {folder}; }, align={l} }{}, }, }, pic me set/.code n args=2{% \forestset{% #1/.style={% inner xsep=2\Size, pic me={pic {#2}}, } } }, pic me set={directory}{folder}, pic me set={file}{file}, } \begin{document} \begin{forest} pic dir tree, pic root, for tree={% folder icons by default; override using file for file icons directory, }, [system [config ] [lib [Access ] [Plugin ] [file.txt, file ] ] ] \end{forest} \end{document} But how do I add vdots at the top of the directory tree --- more precisely, right below [system] --- and at the bottom of the directory tree? Here are the respective illustrations of the results I wish to achieve: I tried looking at edge path, the names of the forest nodes, and forest anchors in forest's documentation, but I couldn't get anywhere close to the results I want. Edit (Ref: cfr’s first comment I want something like this: I tried \begin{forest} pic dir tree, pic root, for tree={% folder icons by default; override using file for file icons directory, }, [system,extensible edge [config ] [lib, extend [file.txt, file, extend ] [file, file] ] ] \end{forest} with cfr’s MWE but it gave (Ref: cfr’s second comment When we use for tree={edge=rounded corners}, as in the following MWE, we have extraneous white space, which the removal of |- !u.child anchor seems to solve: \documentclass[border=10pt,multi,tikz]{standalone} % ateb: https://tex.stackexchange.com/a/754955/ \usepackage[edges]{forest} \definecolor{folderbg}{RGB}{124,166,198} \definecolor{folderborder}{RGB}{110,144,169} \newlength\Size \setlength\Size{4pt} \tikzset{% folder/.pic={% \filldraw [draw=folderborder, top color=folderbg!50, bottom color=folderbg, sharp corners] (-1.05*\Size,0.2\Size+5pt) rectangle ++(.75*\Size,-0.2\Size-5pt); \filldraw [draw=folderborder, top color=folderbg!50, bottom color=folderbg, sharp corners] (-1.15*\Size,-\Size) rectangle (1.15*\Size,\Size); }, file/.pic={% \filldraw [draw=folderborder, top color=folderbg!5, bottom color=folderbg!10, sharp corners] (-\Size,.4*\Size+5pt) coordinate (a) |- (\Size,-1.2*\Size) coordinate (b) -- ++(0,1.6*\Size) coordinate (c) -- ++(-5pt,5pt) coordinate (d) -- cycle (d) |- (c) ; }, } \forestset{% declare autowrapped toks={pic me}{}, declare boolean register={pic root}, pic root=0, pic dir tree/.style={% for tree={% folder, font=\ttfamily, grow'=0, }, before typesetting nodes={% for tree={% edge label+/.option={pic me}, edge=rounded corners, }, if pic root={ tikz+={ \pic at ([xshift=\Size].west) {folder}; }, align={l} }{}, }, }, pic me set/.code n args=2{% \forestset{% #1/.style={% inner xsep=2\Size, pic me={pic {#2}}, } } }, pic me set={directory}{folder}, pic me set={file}{file}, declare toks={real siblings}{}, extensible edge/.style={% delay={% prepend={[\strut, delay={% do dynamics, temptoksa=, for following siblings={% if temptoksa={}{}{% temptoksa+={,}, }, temptoksa+/.option=name, }, real siblings/.register=temptoksa, folder, grow'=0, before computing xy={% l'=0pt, s'=-15pt, }, delay n=2{% split option={real siblings}{,}{append}, }, }, edge path'={% (!u.parent anchor) ++(\foresteregister{folder indent},0pt) -- ++(0pt,-5pt) edge [dotted] ([xshift=\foresteregister{folder indent}].parent anchor) }, ]}, }, }, extend/.style={% delay={% append={[\strut, folder, grow'=0, before computing xy={% l'=0pt, s'=-15pt, }, if n children=0{% before drawing tree={% delay={% y/.min={>O{y}}{parent,descendants}, }, }, }{}, edge path'={% (!uu.parent anchor |- !u.child anchor) ++(\foresteregister{folder indent},0pt) coordinate (a) -- ([yshift=15pt].parent anchor -| a) edge [dotted] (.parent anchor -| a) }, ]}, }, }, } \begin{document} \begin{forest} pic dir tree, pic root, for tree={% folder icons by default; override using file for file icons directory, }, [system [config ] [lib [Access ] [Plugin ] [file.txt, file ] ] ] \end{forest} \begin{forest} pic dir tree, pic root, for tree={% folder icons by default; override using file for file icons directory, }, [system, extensible edge, [config ] [lib [Access ] [Plugin ] [file.txt, file ] ] ] \end{forest} \begin{forest} pic dir tree, pic root, for tree={% folder icons by default; override using file for file icons directory, }, [system [config ] [lib, extend [Access ] [Plugin ] [file.txt, file,extend ] ] ] \end{forest} \begin{forest} pic dir tree, pic root, for tree={% folder icons by default; override using file for file icons directory, }, [system,extensible edge [config ] [lib, extend [Access ] [Plugin ] [file.txt, file, extend ] ] ] \end{forest} \end{document}
- How to draw a rectangle in tikz at scale 0.9 without broken line joinsby msrd0 on November 15, 2025 at 10:28 am
I have a tikz picture that I apply scale=0.9 to that \draws a rectangle, like this: \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[scale=0.9] \draw[draw=red, fill=red, fill opacity=0.3, thick] (0.24999999999999997, 5.8) -| (0.44999999999999996, 6.2) -| cycle; \end{tikzpicture} \end{document} This results in one corner not having the correct line join: If I would remove the scale argument, the line joint would be correct, but the whole picture no longer fits on my page. I also would like to avoid having to manually multiply all coordinates with 0.9. As a workaround, I could draw a second rectangle over it, with the "missing" corner in a different location. Is there a better solution?
- Artifacts with externalize and geometryby Sak on November 14, 2025 at 11:36 pm
I'm using TikZ externalization in my main LaTeX document, but when I include a PDF that was generated with different geometry and layout settings, it corrupts all subsequent TikZ externalizations. Project Structure: . ├── figures/ # Externalized tikz outputs ├── tikzfigure/ │ ├── figures -> ../figures # symbolic link │ ├── otd.pdf # to be included PDF │ └── otd.tex └── Poster_Presentation_outline.tex # Main document Main Document (Poster_Presentation_outline.tex): \documentclass[9pt]{extarticle} \usepackage{tikz} \usetikzlibrary{arrows.meta,external} \tikzexternalize[prefix=figures/] \usepackage{pdfpages} \begin{document} \pagestyle{plain} \tikzexternaldisable \newpage \includepdf[pages=-,landscape,fitpaper=true]{tikzfigure/otd.pdf} \newpage \tikzexternalenable \begin{tikzpicture}[scale=1.2] \draw[thick] (0,0) circle (2); \draw[thick] (-1.2,-1.2) rectangle (1.2,1.2); \coordinate (O) at (0,0); \coordinate (A) at (1.2,1.2); \coordinate (B) at (0,1.2); \coordinate (C) at (0,2); \coordinate (D) at (1.414,1.414); \draw[{Stealth[length=1.5mm]}-{Stealth[length=1.5mm]}, gray] (O) -- (-2,0) node[midway, below] {$R_I$}; \draw[{Stealth[length=1.5mm]}-{Stealth[length=1.5mm]}, gray] (1.3,0) -- (1.3,1.2) node[midway, right] {$\frac{L}{2}$}; \draw[{Stealth[length=1.5mm]}-{Stealth[length=1.5mm]}, gray] (0,0) -- (1.2,0) node[midway, below] {$\frac{L}{2}$}; \draw[{Stealth[length=1.5mm]}-{Stealth[length=1.5mm]}, gray] (-1.2,-1.4) -- (1.2,-1.4) node[midway, below] {$L$}; \draw[{Stealth[length=1.5mm]}-{Stealth[length=1.5mm]}, red!50!black] (A) -- (D) node[midway, above right=0.1] {$\phi_{\text{min}}$}; \draw[{Stealth[length=1.5mm]}-{Stealth[length=1.5mm]}, blue!50!black] (B) -- (C) node[midway, right] {$\phi_{\text{max}}$}; \draw[-{Stealth[length=1.5mm]}, dashed, gray] (O) -- (A) node[midway, above left=-0.2] {$\frac{L\sqrt{2}}{2}$}; \end{tikzpicture} \end{document} PDF Source (otd.tex): \documentclass{article} \usepackage{pdflscape} \usepackage{afterpage} \usepackage{tikz} \usepackage[landscape]{geometry} \geometry{papersize={297mm,330mm}, margin=20mm} \usetikzlibrary{external} \tikzexternalize[prefix=figures/] \usepackage{fancyhdr} \pagestyle{fancy} \fancypagestyle{plain}{ \fancyhf{} \renewcommand{\headrulewidth}{0pt} \fancyhead[L]{\textit{S. name1, F. name2, A. name3 et al.}} \fancyhead[R]{\textit{EG5416C - Exploring Engineering Project Management}} \fancyfoot[C]{\footnotesize6} } \setlength{\headsep}{0.2in} \setcounter{section}{2} \setcounter{subsection}{3} \begin{document} \pagestyle{plain} \centering \vspace*{2em} \subsection{OTD} \vspace*{\fill} \begin{tikzpicture}[ scale=0.7,every node/.append style={transform shape},myarrow/.style={-{Stealth[length=1.5mm,width=2mm]}}, mynode/.style={draw,fill=green!20!white,rectangle,inner xsep=5pt,inner ysep=20pt,text width=3cm,align=center,rounded corners=2mm,scale=0.8}, mynode2/.style={draw=white,fill=green!10!white,rectangle,inner xsep=5pt,inner ysep=20pt,text width=5cm,align=center,rounded corners=2mm,scale=0.8}] \def\opa{0} \def\posA{3} \def\posB{12} \def\firstx{-abs(\posA)} \def\firsty{abs(\posB)} \pgfmathsetmacro{\r}{sqrt(abs(\posA)^2 + abs(\posB)^2)} \pgfmathsetmacro{\angleLeft}{atan2(-\posA,-\posB)} \pgfmathsetmacro{\angleRight}{atan2(-\posA,\posB)} \pgfmathsetmacro{\span}{\angleRight - \angleLeft} \pgfmathsetmacro{\step}{\span/3} \pgfmathsetmacro{\angleOne}{\angleLeft + \step} \pgfmathsetmacro{\angleTwo}{\angleLeft + 2*\step} \pgfmathsetmacro{\xOne}{\r*cos(\angleOne)-0.1} \pgfmathsetmacro{\yOne}{\r*sin(\angleOne)+0.1} \pgfmathsetmacro{\xTwo}{\r*cos(\angleTwo)+0.1} \pgfmathsetmacro{\yTwo}{\r*sin(\angleTwo)+0.1} \def\cr{5} \def\opa{0.2} \node[mynode, rounded corners=0mm, inner sep=1cm, text width=5cm,fill=green!30!white] (main) at (0,0) {\LARGE Main Objective}; \node[mynode] (structural) at (-\posB,-\posA) {Structural Integrity}; \node[mynode] (efficiency) at (\xOne,\yOne) {Achieve operational efficiency}; \node[mynode] (safety) at (\xTwo,\yTwo) {Maintain safety compliance}; \node[mynode] (sustainability) at (\posB,-\posA) {Meet sustainability standards}; \node[mynode2, anchor=center] (LBC) at ($(-\posB,-\posA) + (150:\cr cm)$) {\textbf{Load-Bearing Capacity:} Support combined 5 t load (lid + internals) during lifting and assembly.}; \node[mynode2, anchor=center] (LSI) at ($(-\posB,-\posA) + (188:\cr cm)$) {\textbf{Lifting \& Support Interfaces:} Include lifting eyes, collars, or guided mounts for safe vessel handling.}; \node[mynode2, anchor=center] (AS) at ($(-\posB,-\posA) + (230:\cr cm)$) {\textbf{Anchoring \& Stability:} Maintain rigidity and resist tipping or lateral loads during operation.}; \draw[myarrow] (structural) .. controls (-\posB-0.5,-\posA+2) and ($(-\posB+3,-\posA) + (150:\cr cm)$) .. (LBC); \draw[myarrow] (structural) -- (LSI); \draw[myarrow] (structural) .. controls (-\posB,-\posA-1.5) and ($(-\posB+2.85,-\posA+1.2) + (230:\cr cm)$) .. (AS); \node[mynode2, anchor=center] (MR) at ($(\posB,-\posA) + (180-150:\cr cm)$) {\textbf{Material Recyclability:} Select frame materials that can be recycled at the end of the lifecycle.}; \node[mynode2, anchor=center] (EEF) at ($(\posB,-\posA) + (180-188:\cr cm)$) {\textbf{Energy-Efficient Fabrication:} Choose manufacturing methods that minimize energy consumption and waste.}; \node[mynode2, anchor=center] (WM) at ($(\posB,-\posA) + (180-230:\cr cm)$) {\textbf{Waste Minimization:} Reduce offcuts and scrap during production; design for easy disassembly and reuse.}; \draw[myarrow] (sustainability) .. controls (\posB+0.5,-\posA+2) and ($(\posB-3,-\posA) + (180-150:\cr cm)$) .. (MR); \draw[myarrow] (sustainability) -- (EEF); \draw[myarrow] (sustainability) .. controls (\posB,-\posA-1.5) and ($(\posB-2.85,-\posA+1.2) + (180-230:\cr cm)$) .. (WM); \node[mynode2, anchor=center] (AWO) at ($(\xOne,\yOne) + (190:\cr cm)$) {\textbf{Assembly Workflow Optimization:} Develop a clear, efficient method for assembling and disassembling the frame with minimal downtime.}; \node[mynode2, anchor=center] (OMA) at ($(\xOne,\yOne) + (235:\cr cm)$) {\textbf{On-Site Maintenance Access:} Provide clearance and lifting features for module removal and replacement without external workshops.}; \node[mynode2, anchor=center] (OR) at ($(\xOne,\yOne) + (300:\cr cm)$) {\textbf{Operational Reliability:} Maintain alignment and structural stability during repeated maintenance cycles.}; \draw[myarrow] (efficiency) .. controls (\xOne-1.5,\yOne-0.5) and ($(\xOne+3,\yOne+0.1) + (190:\cr cm)$) .. (AWO); \draw[myarrow] (efficiency) .. controls (\xOne-0.5,\yOne-1.5) and ($(\xOne+2,\yOne+2) + (235:\cr cm)$) .. (OMA); \draw[myarrow] (efficiency) .. controls (\xOne+0.5,\yOne-1.5) and ($(\xOne-1.6,\yOne+2.2) + (300:\cr cm)$) .. (OR); \node[mynode2, anchor=center] (LS) at ($(\xTwo,\yTwo) + (180-300:\cr cm)$) {\textbf{Lifting Stability:} Ensure the frame and lifting features maintain structural stability during lid and internal component handling.}; \node[mynode2, anchor=center] (LPI) at ($(\xTwo,\yTwo) + (180-235:\cr cm)$) {\textbf{Load Path Integrity:} Verify safe load transfer through the frame under both static and dynamic lifting conditions.}; \node[mynode2, anchor=center] (OSC) at ($(\xTwo,\yTwo) + (180-190:\cr cm)$) {\textbf{Operator Safety Clearances:} Maintain adequate access and spacing to prevent collision or pinch hazards during assembly and maintenance.}; \draw[myarrow] (safety) .. controls (\xTwo+1.5,\yTwo-0.5) and ($(\xTwo-3,\yTwo+0.1) + (180-190:\cr cm)$) .. (OSC); \draw[myarrow] (safety) .. controls (\xTwo+0.5,\yTwo-1.5) and ($(\xTwo-2,\yTwo+2) + (180-235:\cr cm)$) .. (LPI); \draw[myarrow] (safety) .. controls (\xTwo-0.5,\yTwo-1.5) and ($(\xTwo+1.6,\yTwo+2.2) + (180-300:\cr cm)$) .. (LS); \draw[myarrow] (main) .. controls (0,-7) and (-\posB+2,-\posA) .. (structural); \draw[myarrow] (main) .. controls (0,-7) and (\xOne,\yOne+2) .. (efficiency); \draw[myarrow] (main) .. controls (0,-7) and (-\xOne,\yOne+2) .. (safety); \draw[myarrow] (main) .. controls (0,-7) and (\posB-2,-\posA) .. (sustainability); \end{tikzpicture} \vspace*{\fill} \end{document} \includepdf doesnt isolate the PDF’s geometry i presume, so TikZ externalization is “inherits” them, corrupting figure output. here is the otd.pdf that is included and this is what it does to other tikz Am willing to give code for these if needed i provided one in the current main tex I Tried wrapping \includepdf with \tikzexternaldisable / \tikzexternalenable and using landscape, fitpaper=true options in \includepdf, ive been playing arround alot but cant seem to understand why the artifact form and how to fix them. None of my approaches prevent TikZ externalization from being affected. How can I safely include this PDF otd.pdf without its contents leaking into the TikZ externalization process?
- How to draw disconnected nodes in a forest?by John Doe on November 14, 2025 at 4:05 pm
Suppose I have the following forest: \documentclass{article} \usepackage{forest} \begin{document} \begin{forest} for tree={ grow=east, parent anchor=east, child anchor=west, align=center, inner sep=2pt, l=1em, l sep+=0em, s sep=5pt, anchor=base west, outer sep=0pt, edge path={ \noexpand\path [draw, \forestoption{edge}] (!u.parent anchor) -- +(5pt,0) |- (.child anchor)\forestoption{edge label}; }, for root={ parent anchor=east, text width=3cm, }, } [{My Cool Taxonomy},child anchor=north, parent anchor=east, anchor=center [ First Child, [Charlie [Test9, draw=black, no edge], [Test8, draw=black, no edge], [Test7, draw=black, no edge], [Test6, draw=black, no edge], ] [Bravo, [Test5, draw=black, no edge], [Test4, draw=black, no edge], [Test3, draw=black, no edge], ], [Alpha,, [Test2, draw=black, no edge], [Test1, draw=black, no edge], ] ] ] \end{forest} \end{document} which produces the following output: How can I draw the third-level nodes (Test1, ..., Test9) next to each other without an edge while considering their respective level? These nodes should grow from east to west. My desired output would be:
- How to color the circle line of Tikz nodes with radial gradient using the node definition \node[...] with the built-in option "color"?by user2379123 on November 14, 2025 at 12:44 pm
This is my code: \documentclass[margin=1mm]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[C/.style = {circle, draw, inner sep=5pt, node contents={}}] \node[shading = axis, circle, left color=blue, right color=red, shading angle=135] (a) [C]; \end{tikzpicture} \end{document} This is the output: I want to color the black circle line with the filled radial gradient. Normally, I would use the node definition \node[color=...] with the predefined option "color" to obtain the result. But it just seems to be working for single colors. How can I use this option for color gradients? Do you have any idea?
- How can I draw a filled plane using tikz/closedcycleby katang on November 13, 2025 at 11:26 pm
I want to make a 3-D figure with a spatial diagram line and draw its projections onto the three axes planes. For better visibility, I want to mark the projections' positions with shaded planes. The MWE and the result are shown below. It looks like that \closedcycle wants to close anyhow in the plane containing the z-axis. Is there any option to draw a plane perpendicular to the z-axis (i.e., to the other two planes)? (I also tried \addplot3 [surf, fill] and fill between, but to no avail.) \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis} %XZ plane \addplot3 [fill=red!20,opacity=30,draw=none,fill opacity=0.5,] coordinates {(0,120,3900)(3,120,3900)} \closedcycle; %YZ plane \addplot3 [fill=green!20,opacity=30,draw=none,fill opacity=0.5,] coordinates {(3,-40,3900)(3,120,3900)} \closedcycle; %XY plane \addplot3 [fill=blue!20,opacity=30,draw=none,fill opacity=0.5,] coordinates {(0,-40,3900)(3,120,3900)} \closedcycle; \end{axis} \end{tikzpicture} \end{document} As a reply to @Jasper, I attach the figure here I need one more plane, for the blue diagram line. The thick spatial curve is projected to the axial planes. Thanks to all for your helpfulness and the useful hints.
- How to add stripes/layers to a Tikz cubeby Lucas on November 13, 2025 at 1:40 pm
I have the following cube and I would like to add stratified layers/stripes vertically, i.e. travelling in the x_1 direction I come across a red layer, then blue layer, then red, then blue etc. How can I do this? \documentclass[tikz,border=5pt]{standalone} \usepackage{tikz} \begin{document} \begin{center} \begin{tikzpicture} \pgfmathsetmacro{\cubeSize}{3} \pgfmathsetmacro{\axisLength}{1.2} \draw[black,fill=gray!50] (0,0,0) -- ++(-\cubeSize,0,0) -- ++(0,-\cubeSize,0) -- ++(\cubeSize,0,0) -- cycle; \draw[black,fill=gray!60] (0,0,0) -- ++(0,0,-\cubeSize) -- ++(0,-\cubeSize,0) -- ++(0,0,\cubeSize) -- cycle; \draw[black,fill=gray!40] (0,0,0) -- ++(-\cubeSize,0,0) -- ++(0,0,-\cubeSize) -- ++(\cubeSize,0,0) -- cycle; \draw[->,thick] (-6,0,0) -- ({-6+\axisLength},0,0) node[right] {$x_1$}; \draw[->,thick] (-6,0,0) -- (-6,-\axisLength,0) node[below] {$x_2$}; \draw[->,thick] (-6,0,0) -- (-6,0,-\axisLength) node[above left] {$x_3$}; \end{tikzpicture} \end{center} \end{document}
- \tikzmath defined functions sometimes won't parse in \addplot, producing spurious errorsby Francis Cook on November 13, 2025 at 12:38 pm
This is my first post so the graph may not appear and/or the format may look weird. Apologies if that is so. The graph is produced when the line \addplot[red, thick] {myexp(x,4)}; is commented out When included, numerous errors result, seemingly spurious because it is not being parsed as expected, for example "! Illegal unit of measure (pt inserted)." Unfortunately, I cannot see my mistake. I have tried everything I can think of, including spaces before and/or after pretty much every reference and even trying to use "declare function" (but I couldn't make that work the with complex, iterative logic). I am puzzled by the fact that a simple, two argument function (myfunc) can be called successfully, one with more complex logic (expterm) can be called successfully, but a complex one, with a loop and calls (myexp) fails. Any help/suggestions gratefully received. I am hoping to fix this with \tikzmath rather than use the equivalent pgfplots function definitions etc The code is as follows \documentclass{article} \usepackage{pgfplots} \usetikzlibrary{math} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture} % Define the function using tikzmath - scope is within the tikzpicture % note that the \tikzmath block is sensitive to blank lines % so don't leave any lines blank % inclde non math lines like drawing commands within double curly braces {{ }} \tikzmath{ function myfunc(\x,\a) { return sin(\x r) + \a*\x; }; function expterm(\x,\n) { if \n == 0 then { return 1; } else { if \n == 1 then { return \x; } else { return \x ^ \n / factorial(\n); }; }; }; function myexp(\x,\n) { \s=0; for \i in {0,1,...,\n-1}{ \s=\s+expterm(\x,\i); }; return \s; }; } \begin{axis}[ domain=-2*pi:2*pi, xmin=-2*pi, xmax=2*pi, ymin=-3, ymax=3, restrict y to domain=-3:3, samples=100, axis lines=middle, xtick={ -2*pi, -3*pi/2, -pi, -pi/2, pi/2, pi, 3*pi/2, 2*pi }, xticklabels={ $-2\pi$, $-\frac{3\pi}{2}$, $-\pi$, $-\frac{\pi}{2}$, $\frac{\pi}{2}$, $\pi$, $\frac{3\pi}{2}$, $2\pi$ }, width=14cm, height=14cm, xlabel=$x$, ylabel={$y = f(x)$}, title={Function defined in \texttt{\textbackslash tikzmath}} ] % Use the tikzmath function in an addplot \addplot[blue, thick] {myfunc(x,0.3)}; \addplot[green, thick] {expterm(x,3)}; % \addplot[red, thick] {myexp(x,4)}; \end{axis} \end{tikzpicture} \end{document}
- dvipsnames colours changing between tikz and tcolorbox [duplicate]by Craig on November 13, 2025 at 10:53 am
Why is the colour RedViolet (or any colour) appearing differently in the tikzpicture and the tcolorbox, when the color is defined by its dvips name? \documentclass{standalone} \usepackage[dvipsnames]{xcolor} \usepackage{tikz,tcolorbox} \begin{document} \begin{tikzpicture} \shade[rounded corners=22pt, left color=RedViolet, right color=RedViolet] (0,0) rectangle ++(5,1.5); \end{tikzpicture} \begin{tcolorbox}[ title=Hello World, colframe=RedViolet, width=3cm ] \end{tcolorbox} \end{document}
- match tikz \node placement with beamer's natural inputby user1850133 on November 13, 2025 at 10:00 am
I have a beamer document in which I placed text (first input on that slide) without using any special command or environment. Now on the next slide. I was expecting that tikz places \node at (0,0) { ... } exactly where beamer placed that first input on the previous slide. Actually there is a slight gap. So here I'd like to know if there's a way to make tikz place text exactly at the same place as the natural input of beamer. I also want to know if there is a way to get the coordinates of the last node placed by tikz. \documentclass[aspectratio=169,t]{beamer} \mode<presentation> \usetheme{moloch} \usepackage{tabularray,blindtext,tikz} \usetikzlibrary {fadings,patterns} \UseTblrLibrary{tikz,booktabs} \SetTblrInner{rowsep={2pt}} \newcommand{\titles}[1]{{\bfseries #1\vspace{.5em}}} \tikzfading[name=fade top,bottom color=transparent!100, top color=transparent!0] \begin{document} \begin{frame}{première} \end{frame} \begin{frame}{pgf input}% \begin{tikzpicture}% \node at (0,0) [font=\bfseries] {titre}; \end{tikzpicture}% % \titles{\centering titre}% \end{frame} \begin{frame}{basic input}% \titles{\centering titre}% \end{frame} \end{document} EDIT: based on the answer of the user who answered to my post I have written this code but the text input using the tikzmark set on the second slide of the document, is not at the right position. So, if anyone could debug it... EDIT 2: It seems i needed to define the anchor. I passed \tikzmark{...} in the <2-> slide and use it just after the permanent "title" on that slide to show that it is falling at the same position. And I use it again after the table, and this time too it falls exactly on the previous \node at (pic cs:.... I still need to resolve the problem with the space that appears between the title "titre" and the table. \documentclass[aspectratio=169,t]{beamer} \usetheme{moloch} \usepackage{tikz,tabularray} \newcommand{\titles}[1]{{\bfseries #1\vspace{.5em}}} \usetikzlibrary{tikzmark} \NewDocumentCommand{\titremaker}{m}{% \begin{tikzpicture} \node at (0,0) [font=\bfseries,inner sep=0pt] {#1}; \end{tikzpicture}\vskip.5em} \NewDocumentCommand{\titreoverlay}{O{purple} m m}{% \begin{tikzpicture}[remember picture,overlay,inner sep=0pt] \node at (pic cs:#3) [anchor=south west,font=\bfseries,#1] {#2}; \end{tikzpicture}\vskip.5em} \begin{document} \begin{frame}{super prems} this frame only to avoid the slight positional shift of okular on the first page of pdf documents \end{frame} \begin{frame} \frametitle{pgf input}% \only<2->{\tikzmark{titrepos}}% \titremaker{titre}% \only<2->{% \titreoverlay[blue]{titre}{titrepos}} \only<3->{% \vspace{-1cm}}% {% \only<2>{\SetTblrInner{cell{1}{1}={fg=brown}}} \only<3>{\SetTblrInner{cell{1}{2}={fg=brown}}} \begin{tblr}{colspec={lll},cells={yellow!20}} un & deux & trois\\ quatre & cinq & six\\ \end{tblr}} \only<4->{% \titreoverlay{titre}{titrepos}} \end{frame} \end{document}
- Strange node naming scope issues across two tikzpictures environment?by Explorer on November 13, 2025 at 1:27 am
This post raised from my previous answer, and pascal974's comment: Consider the following two codes: \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture} \foreach[remember=\n as \lastn] \n in {0,...,5}{ \node (\n) [right = of \lastn] {\n}; } \end{tikzpicture} \end{document} It would complain that as expected: ! Package pgf Error: No shape named `0' is known. See the pgf package documentation for explanation. Type H <return> for immediate help. ... l.10 } ? However, if I add \tikz \node (0) {}; in another tikzpicture, the definition of node's namespace looks like "penetrated" the tikzpicture, which affect the next node named 0 as below: \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{positioning} \begin{document} \tikz \node (0) {}; \begin{tikzpicture} \foreach[remember=\n as \lastn] \n in {0,...,5}{ \node (\n) [right = of \lastn] {\n}; } \end{tikzpicture} \end{document} My question is: Why the namespace of \node is shared across different tikzpictures? It looks like some information leak happened here? I believe that this case is different with cfr's this excellent solution.
- How come when filling in TikZ, there is a visible gap between adjacent fills?by Jasper on November 12, 2025 at 1:00 am
How come when filling in TikZ, there is a visible gap between adjacent fills? \documentclass[tikz,border=1cm]{standalone} \begin{document} \begin{tikzpicture} \fill (0,0) -- (1,1) -- (1,0) -- cycle; \fill (0,0) -- (1,1) -- (0,1) -- cycle; \end{tikzpicture} \end{document}
- Default TikZiT styles or templates for technical diagrams?by Felix Lindner on November 7, 2025 at 9:01 pm
I’m new to TikZiT and was wondering — is there any default or example style template available with basic elements like arrows, circles, and similar shapes? Also, where can I find or download ready-made style packages for technical schematic drawings (for example, engineering or process diagrams)? Like this drawings for a electric engine
- Centering Loop in rectangleby Nick B on October 28, 2025 at 11:38 pm
I am trying to create this image from Bryan Passwater. I can move my digits around, and would like the numbers to be centered (same distance from border on each side (see image). Is there a better way to make this? \documentclass{article} \usepackage{parskip,fullpage,hyperref} \usepackage{tikz} \usetikzlibrary{positioning,arrows.meta} \usetikzlibrary{backgrounds} %<- New Today \title{Drawing in the Background Using TiKZ} \author{\href{https://www.youtube.com/@UnlockingLaTeXGraphics}{@UnlockingLaTeXGraphics}} \date{} \begin{document} \begin{tikzpicture}[font=\Huge] % box (width 14, height 2) \draw (0,0) rectangle (14,2); % digits 0..9, evenly spaced from x=1 to x=13 at mid-height y=1.5 \foreach \n in {0,...,9} \node[align=center] at ({1 + 1.32*\n}, 1) {\n}; \end{tikzpicture} \end{document}
- Parsing command arguments with xstring within tikzpicture blockby UnderscorePoY on October 26, 2025 at 10:26 pm
I'm trying to write a custom command to automatically adapt the shape of intervals in Tikz. I'm currently trying to pass an orientation argument to the command \intervalle to parse it via another command \intervalleParseOrientation. Here's a MWE: \documentclass[crop,tikz]{standalone} \usepackage{xstring} \newcommand{\intervalleParseOrientation}[2]{ \IfStrEqCase{#1}{ {h}{{#2}, 0} {v}{0, {#2}} }[\GenericError{}{}{}{h (horizontal) or v (vertical)}] } \newcommand{\intervalle}[1]{ \draw[|-|] (0, 0) -- (\intervalleParseOrientation{h}{1}); } \begin{document} \begin{tikzpicture} \intervalle{1}; \end{tikzpicture} \end{document} This gives the error Illegal parameter number in definition of \tikz@scan@point@coordinate., pointing at the argument within the call to \intervalle. Anyone happens to have encountered such error ? I'd really appreciate some help on that one. Thanks in advance!
- How to add space between x axis labels and draw a vertical line after a set of IDs?by Student on November 21, 2024 at 8:13 pm
I'm trying to add space between x axis labels 10 Flows, 20 Flows, and 30 Flows and also properly draw a line after for every 1 to 8 IDs. Could someone help me with this problem? Code: % restructured data file: % - 'n' values are sorted ascending % - added column 'z' to know which data belong to which measurement % - added a dummy line at the end of each data set to produce an empty entry % for the separation of the blocks % - put all data in one file \begin{filecontents}{data.txt} z n pFA pFB 10 1 6 1 10 2 7 1 10 3 8 4 10 4 9 7 10 5 10 9 10 6 0 0 10 7 9 4 10 8 12 6 20 1 6 1 20 2 7 1 20 3 8 4 20 4 9 7 20 5 10 9 20 6 0 0 20 7 9 4 20 8 12 6 30 1 6 1 30 2 7 1 30 3 8 4 30 4 9 7 30 5 10 9 30 6 0 0 30 7 9 4 30 8 12 6 \end{filecontents} \documentclass[border=5pt]{standalone} \usepackage{pgfplots} \usetikzlibrary{patterns} \pgfplotsset{compat=1.3} \begin{document} \begin{tikzpicture} \begin{axis}[ footnotesize, % set the `width' of the plot to the maximum length ... width=\textwidth, % ... and use half this length for the `height' height=0.5\textwidth, ymin=0, ymax=100, %yticklabel=\pgfmathprintnumber{\tick}\,$\%$, % use `data' for the positioning of the `xticks' ... xtick=data, % ... and use table data for labeling the `xticks' xticklabels from table={data.txt}{n}, % add extra ticks "at the empty entries to add the vertical lines extra x ticks={8,16}, % this ticks shouldn't be labeled ... extra x tick labels={}, % ... but grid lines should be drawn without the tick lines extra x tick style={ grid=major, major tick length=0pt, }, xlabel={X Axis Label}, ylabel={Y Axis Label}, % because of the category labels, shift the `xlabel' a bit down xlabel style={ yshift=-4ex, }, legend pos=north west, legend entries={ {\color{black}{Algorithm A}}, {\color{red}{Algorithm B}}, }, area legend, % adjust `bar width' so it fits your needs ... bar width=10pt, % ... and with that you also have to adjust the x limits enlarge x limits=0.05, % set `clip mode' to `individual' so the category labels aren't clipped away clip mode=individual, ] % plot the "red" ybars \addplot [ ybar, draw=black, pattern color=black, pattern=dots, ] table [ % use just the `coordindex' as x coordinate, % the correct labeling is done with `xticklabels from table' x expr=\coordindex, y=pFA, ] {data.txt}; % plot the "blue" ybars \addplot [ ybar, draw=red, pattern color=red, pattern=north east lines, ] table [ x expr=\coordindex, y=pFB, ] {data.txt}; % add the category labels \begin{scope}[ % because the reference point will be the lower axis line the % labels have to be moved a bit more down to don't overlap with % the `xticklabels' every label/.append style={ label distance=2ex, }, ] \node [label=below:10 Flows] at (axis cs:4,\pgfkeysvalueof{/pgfplots/ymin}) {}; \node [label=below:20 Flows] at (axis cs:12,\pgfkeysvalueof{/pgfplots/ymin}) {}; \node [label=below:30 Flows] at (axis cs:20,\pgfkeysvalueof{/pgfplots/ymin}) {}; % \node [label=below:40 Flows] % at (axis cs:20,\pgfkeysvalueof{/pgfplots/ymin}) {}; %\node [label=below:50 Flows] % at (axis cs:26,\pgfkeysvalueof{/pgfplots/ymin}) {}; \end{scope} \end{axis} \end{tikzpicture} \end{document} Output:
- Prevent quantikz from altering tikz behaviour?by mavzolej on March 21, 2024 at 2:18 am
This code \documentclass{article} \usepackage{tikz-cd} % \usetikzlibrary{quantikz2} \begin{document} \begin{tikzcd}[ampersand replacement=\&] A \arrow[rrrr, ""] \& \& \& \& B \arrow[rd, ""] \\ \& \& \& \& \& C \\ D \arrow[rrrr, ""] \& \& \& \& E \arrow[ru] \end{tikzcd} \end{document} produces this: This code \documentclass{article} \usepackage{tikz-cd} \usetikzlibrary{quantikz2} \begin{document} \begin{tikzcd}[ampersand replacement=\&] A \arrow[rrrr, ""] \& \& \& \& B \arrow[rd, ""] \\ \& \& \& \& \& C \\ D \arrow[rrrr, ""] \& \& \& \& E \arrow[ru] \end{tikzcd} \end{document} produces this: How do I get the first result if I need to use quantikz in my document? Loading quantikz locally for each diagram seems painful.
- Drawing a mass-spring-dashpot systemby Dimitris on November 20, 2022 at 1:57 am
With circuitikz package I can create circuits like the RLC circuit on the left in the figure above. Is there a similar library for mechanical oscillations systems as the mass-spring-dashpot system on the right? Thank you very much.
- How to extend textblock to next page?by TheodoreTsg on July 8, 2021 at 11:09 pm
I am trying to update my CV but my textblock need to extend to next page. As you can see in the image the textblock breaks and it doesn't change page. Im new to Latex but I also know from my research that textblock won't "detect" next page with textpos. My code: \begin{textblock}{6}(0.5, 0.2) \begin{flushleft} \hspace{13pt} \ifthenelse{\equal{\givenprofilepic}{}}{}{\begin{tikzpicture}[x=\imagescale,y=-\imagescale] \clip (600/2, 567/2) circle (567/2); \node[anchor=north west, inner sep=0pt, outer sep=0pt] at (0,0) {\includegraphics[width=\imagewidth]{\givenprofilepic}}; \end{tikzpicture}} {\Huge\color{mainblue}\givencvname} \begin{flushright} {\Large\color{black!80}\givencvjobtitle} \end{flushright} \renewcommand{\arraystretch}{2} \begin{tabular}{p{0.3cm} @{\hskip 0.5cm}p{5cm}} \ifthenelse{\equal{\givencvdate}{}}{}{\textsc{\Large\icon{\Info}} & \givencvdate\\} \ifthenelse{\equal{\givencvaddress}{}}{}{\textsc{\Large\icon{\Letter}} & \givencvaddress\\} \ifthenelse{\equal{\givennumberphone}{}}{}{\textsc{\Large\icon{\Telefon}} & \givennumberphone\\} \ifthenelse{\equal{\givencvsite}{}}{}{\textsc{\Large\icon{\Mundus}} & \href{\givencvsite} {\textcolor{cerulean}\givencvsite}\\} \ifthenelse{\equal{\givencvsiteone}{}}{}{\textsc{\Large\icon{\Mundus}} & \href{\givencvsiteone}{\textcolor{cerulean}\givencvsiteone}\\} \ifthenelse{\equal{\givencvmail}{}}{}{\textsc{\large\icon{@}} & \href{mailto:\givencvmail} {\givencvmail}\\ \\} \end{tabular} \profilesection{Skills}{4.6cm} \givensoftware\\ \profilesection{Software}{3.4cm}\\ \givenskill \giventextskill\\ \profilesection{Languages}{2.7cm}\\ \givenlang \noindent \scriptsize \noindent \end{flushleft} \end{textblock} Also I am thinking of extending the rectangle as you can see in the code below: \begin{tikzpicture}[remember picture,overlay] \node [rectangle, fill=asidecolor, anchor=north, minimum width=9.80cm, minimum height=\paperheight] (box) at (-5cm,0.5cm){}; \end{tikzpicture} I am unable to extend the rectangle which would be a fine solution by me. Any idea?
- Externalize tikz-forest with shaded arrowby fsperrle on February 20, 2018 at 9:23 pm
I have just discovered externalize and want to use it in my document that contains lots of trees with shaded arrows. The arrows are shaded with some "hack" that I found on this site (unfortunately I can't seem to find the source at the moment). It works perfectly fine---albeit slow---when used in my document, but fails when externalised. I get this error ! Extra }, or forgotten \endgroup. \pgf@externalend ->\unskip \egroup \egroup {\def \pgf@external@trim {0}\def ... l.88 \end{forest} Unfortunately I am no Tex-Expert and can't seem to figure out what's going wrong. Here is a MWE: \documentclass[a4paper,12pt, twoside,dvipsnames]{article} \usepackage[dvipsnames]{xcolor} \usepackage{tikz} \usetikzlibrary{external} \tikzexternalize[mode=list and make, prefix=ext-tikz/] \usepackage[external]{forest} \usetikzlibrary{fadings, arrows.meta} \makeatletter \newif\iftikz@shading@path \tikzset{ % There are three circumstances in which the fading sep is needed: % 1. Arrows which do not update the bounding box (which is most of them). % 2. Line caps/joins and mitres that extend outside the natural bounding % box of the path (these are not calculated by PGF). % 3. Other reasons that haven't been anticipated. fading xsep/.store in=\pgfpathfadingxsep, fading ysep/.store in=\pgfpathfadingysep, fading sep/.style={fading xsep=#1, fading ysep=#1}, fading sep=0.0cm, shading path/.code={% % Prevent this stuff happning recursively. \iftikz@shading@path% \else% \tikz@shading@pathtrue% % \tikz@addmode installs the `modes' (e.g., fill, draw, shade) % to be applied to the path. It isn't usualy for doing more % changes to the path's construction. \tikz@addmode{% \pgfgetpath\pgf@currentfadingpath% % Get the boudning box of the current path size including the fading sep \pgfextract@process\pgf@fadingpath@southwest{\pgfpointadd{\pgfqpoint{\pgf@pathminx}{\pgf@pathminy}}% {\pgfpoint{-\pgfpathfadingxsep}{-\pgfpathfadingysep}}}%% \pgfextract@process\pgf@fadingpath@northeast{\pgfpointadd{\pgfqpoint{\pgf@pathmaxx}{\pgf@pathmaxy}}% {\pgfpoint{\pgfpathfadingxsep}{\pgfpathfadingysep}}}% % Clear the path \pgfsetpath\pgfutil@empty% % Interrupt the path and picture to create a fading. \pgfinterruptpath% \pgfinterruptpicture% \begin{tikzfadingfrompicture}[name=.] \path [shade=none,fill=none, #1] \pgfextra{% % Set the softpath. Any transformations in #1 will have no effect. % This will *not* update the bounding box... \pgfsetpath\pgf@currentfadingpath% % ...so it is done manually. \pgf@fadingpath@southwest \expandafter\pgf@protocolsizes{\the\pgf@x}{\the\pgf@y}% \pgf@fadingpath@northeast% \expandafter\pgf@protocolsizes{\the\pgf@x}{\the\pgf@y}% }; % Now get the bounding of the picture. \xdef\pgf@fadingboundingbox@southwest{\noexpand\pgfqpoint{\the\pgf@picminx}{\the\pgf@picminy}}% \xdef\pgf@fadingboundingbox@northeast{\noexpand\pgfqpoint{\the\pgf@picmaxx}{\the\pgf@picmaxy}}% % \end{tikzfadingfrompicture}% \endpgfinterruptpicture% \endpgfinterruptpath% % Install a rectangle that covers the shaded/faded path picture. \pgfpathrectanglecorners{\pgf@fadingboundingbox@southwest}{\pgf@fadingboundingbox@northeast}% % Make the fading happen. \def\tikz@path@fading{.}% \tikz@mode@fade@pathtrue% \tikz@fade@adjustfalse%10pt % Shift the fading to the mid point of the rectangle \pgfpointscale{0.5}{\pgfpointadd{\pgf@fadingboundingbox@southwest}{\pgf@fadingboundingbox@northeast}}% \edef\tikz@fade@transform{shift={(\the\pgf@x,\the\pgf@y)}}% }% \fi% } } \begin{document} \begingroup \centering \begin{forest} [, phantom, for children={fit=band}, s sep'+=60pt [ 2, name=l1 ] [ 2, name=r1 ] ] \path [left color=orange, right color=MidnightBlue, shading path={draw=transparent!0, dashed, -Latex}] (l1) .. controls ++(0,-1) and ++(0,-1) .. (r1); \end{forest} \endgroup \end{document} I tried to reduce the example as much as possible, but it still remains a lot of code. The tikzset part is copied from this site, and I honestly have no idea what it does - it works though, unless forest is externalised. Edit: The issue seems to be limited to forest, this tikzpicture can be externalised without problems: \begin{tikzpicture} \path [left color=orange, right color=MidnightBlue, shading path={draw=transparent!0, dashed, -Latex}] (0,1) .. controls ++(0,-1) and ++(0,-1) .. (1,1); \end{tikzpicture}
- Windows API error 5: "Access is denied" when trying to compile TikZ pictureby siyu on April 13, 2012 at 5:26 pm
I installed PGF but are unable to compile the following document: \documentclass[10pt]{article} \usepackage{pgf,tikz} \begin{document} \begin{tikzpicture} \draw (0,0) --(1,2); \end{tikzpicture} \end{document} This is the console output: initexmf.exe: Windows API error 5: Access is denied. initexmf.exe: Data: C:\ texify.exe: The operation failed for some reason. texify.exe: Data: C:\Program Files\MiKTeX 2.9\miktex\bin\initexmf.exe What to do?
- How to draw a poset Hasse Diagram using TikZ?by Andry on March 9, 2012 at 2:39 am
I need to draw an Hasse Diagram using LaTeX. TikZ is the solution I would like to use. I tried with a simple structure involving trees but obviously when I need to join two nodes, it is not possible. I searched a little but found no immediate solutions for Hasse Diagrams in TikZ. Which one is the fastest structure I can use? I would like also to have the tree syntax flexibility without manually specifying where nodes should be places. I just want to specify nodes and connections.