TikZ
- Graphing a system of inequalities in 3 dimensionsby Henry Timmons on April 11, 2026 at 2:14 pm
I am trying to graph a system of 3 inequalities in 3 dimensions. These ineuqalities are: y-z>=1/2x, x-z>=0, and x+y>=3z. Currently I am struggling to get even a basic output. My input is: \documentclass[12pt, a4paper]{article} \usepackage{float, ulem, amsmath, amsthm, amssymb, pgfplots, tikz} \pgfplotsset{width=10cm,compat=1.9} \usepgfplotslibrary{external, fillbetween} \tikzexternalize \begin{document} \begin{tikzpicture} \begin{axis}[domain=0:10,y domain=0:10] \addplot3[surf] {y-(\frac{1}{2}*x)}; \addplot3[surf] {x}; \addplot3[surf] {\frac{x+y}{3}}; \end{axis} \end{tikzpicture} \end{document} I am getting the error: "Package tikz Error: Sorry, the system call 'pdflatex -shell-escape - halt-on-error -interaction=batchmode -jobname "output-figure0" "\def\tikzexternalrealjob{output}\input{output}"' did NOT result in a usable output file 'output-figure0' (expected one of .pdf:.jpg:.jpeg:.png:). Please verify that you have enabled system calls. For pdflatex, this is 'pdflatex -shell-escape'. Sometimes it is also named 'write 18' or something like that. Or maybe the command simply failed? Error messages can be found in 'output-figure0.log'."
- I am trying to typeset a solution for finding the next number in a series using TiKZby Brion on April 9, 2026 at 6:30 pm
The following code snippet works, but I'm looking for a more elegant solution. Perhaps one using an inverse tree environment. \documentclass[12pt]{article} \usepackage{tikz} \begin{document} Problem: Find the next number in the following sequence:\\ 7 \quad 10 \quad 15 \quad 22 \quad 31...\\ Solution:\\ \begin{tikzpicture} \node (a) at (0,0) { 7}; \node (b) at (0:0.75) {10}; \node (c) at (0:1.50) {15}; \node (d) at (0:2.25) {22}; \node (e) at (0:3.00) {31}; \node [red] (f) at (0:3.75) {42}; \node (g) at (0.50,-1) { 3} edge [<-] (a) edge [<-] (b); \node (h) at (1.25,-1) { 5} edge [<-] (b) edge [<-] (c); \node (i) at (2.00,-1) { 7} edge [<-] (c) edge [<-] (d); \node (j) at (2.75,-1) { 9} edge [<-] (d) edge [<-] (e); \node [red] (k) at (3.50,-1) {11} edge [red] [<-] (e) edge [red] [->] (f); \node (l) at (1.00,-2) {2} edge [<-] (g) edge [<-] (h); \node (m) at (1.75,-2) {2} edge [<-] (h) edge [<-] (i); \node (n) at (2.50,-2) {2} edge [<-] (i) edge [<-] (j); \node [red] (o) at (3.25,-2) {2} edge [red] [<-] (j) edge [red] [->] (k); \node (p) at (5,-3.5) {}; \draw [->,red] (0,-3.5) .. controls +(up:1cm) and +(left:1.5cm) .. node {}(g); \end{tikzpicture} \setlength{\parskip}{0pt} \setlength{\parindent}{0pt} Compute the difference between each pair of numbers in the list.\\ Observe the pattern (every odd number beginning with 3, in this case.) \end{document}
- Tizk and circuitikz How to put frame around collection of commands inside?by Nasser on April 9, 2026 at 9:36 am
I am using circuitikz to make 2 small diagrams with spring mass. I'd like to put a frame around each. I tried many things, such as using \fbox and \node[draw=black, inner sep=5pt]{...}; but nothing works. I keep getting errors. Below is what I have as MWE \documentclass[tikz, border=2mm]{standalone} \usepackage{circuitikz} \usetikzlibrary{calc} \usepackage{amsmath} \usetikzlibrary{patterns,hobby,decorations.pathmorphing} \usetikzlibrary{fit} \begin{document} \begin{circuitikz}[remember picture, overlay] %\draw[step=1cm, gray, very thin] (current page.south west) grid (current page.north east); \coordinate (A) at (3,-.5); \coordinate (B) at (12,-.5); %ground %\node[draw=black, inner sep=5pt]{ %does not work \pattern[pattern=north east lines] (A) rectangle ($(A)+(4,0.15)$); \draw[thick] (A) -- ($(A)+(4,0)$); \draw ($(A)+(1.5,0)$) to[spring, l_=$k$] ($(A)+(1.5,-2)$); \draw ($(A)+(2.5,0)$) to[damper, l=$c$] ($(A)+(2.5,-2)$); \draw[fill=gray!30] ($(A)+(1,-2)$) rectangle ($(A)+(3,-3)$); \node[font=\Large] at ($(A)+(2,-2.5)$) {$m$}; \draw[thin,dashed] ($(A)+(3.25,-2.5)$) -- ($(A)+(4.5,-2.5)$); \node[align=left,font=\small] at ($(A)+(5.25,-2.5)$) {equilibrium\\position}; \draw[thin, ->] ($(A)+(4,-2.5)$) -- ($(A)+(4,-3)$); \node at ($(A)+(4,-3.2)$) {$x$}; \node at ($(A)+(2,-4)$) {$\boxed{m x'' + c x' + k x = 0}$}; %}; %does not work %------------------------------------ %\fbox{ %does not work \pattern[pattern=north east lines] (B) rectangle ($(B)+(4,0.15)$); \draw[thick] (B) -- ($(B)+(4,0)$); \draw ($(B)+(2,0)$) to[spring, l_=$k$] ($(B)+(2,-2)$); \draw[fill=gray!30] ($(B)+(1,-2)$) rectangle ($(B)+(3,-3)$); \node[font=\Large] at ($(B)+(2,-2.5)$) {$m$}; \draw[thin,dashed] ($(B)+(3.25,-2.5)$) -- ($(B)+(4.5,-2.5)$); \node[align=left,font=\small] at ($(B)+(5.25,-2.5)$) {equilibrium\\position}; \draw[thin, ->] ($(B)+(4,-2.5)$) -- ($(B)+(4,-3)$); \node at ($(B)+(4,-3.2)$) {$x$}; \draw[thick, ->] ($(B)+(2,-3)$) -- ($(B)+(2,-3.5)$); \node at ($(B)+(2,-3.75)$) {$F_0 \cos(\varpi)$}; \node at ($(B)+(2,-4.5)$) {$\boxed{m x'' + k x = F_0 \cos(\varpi)}$}; %} %does not work \end{circuitikz} \end{document} Compiling with lualatex gives this I'd like to make it look like this I do not want to make 2 separate \begin{circuitikz} and put fbox or frame outside each. But want just one \begin{circuitikz} as above, and inside it, put a frame around any collection of commands I want. Is this possible to do? All examples I saw says to put frame around the whole tikz picture. But that is not what I want. May be \node[draw=black, inner sep=5pt]{...}; does not work inside circuitik?
- Issue with \only in beamer with Tikz and fragile is being used [duplicate]by Fractal20 on April 8, 2026 at 9:39 pm
I'm having an issue with specific Tikz pictures in beamer when using \only, even when including the [fragile] in the Beamer frame creation. I have a minimal example below. If the \only is removed, it compiles fine. As is, it gives an illegal parameter error. I haven't had issues with other tikz pictures so I think it might be coming from some of the set up. Any ideas? \documentclass{beamer} \usepackage{tikz} \usetikzlibrary{matrix, positioning,decorations.pathreplacing} \begin{document} \begin{frame}[fragile] \only<1>{ \begin{tikzpicture}[scale=1,b/.style={draw, minimum size=5mm, fill=black},w/.style={draw, minimum size=5mm, fill=white}, m/.style={matrix of nodes, column sep=1pt, row sep=1pt, draw=none, label=below:#1}, node distance=1pt] \node[] (A1) at (0,0) {}; \matrix (A2) [m=, right=of A1]{ 1&0&1\\ }; \end{tikzpicture} } \end{frame} \end{document}
- Improvements to code used for a special headingby yannisl on April 8, 2026 at 11:51 am
The following code snippet draws a box in box for a heading. I would like some help to improve the code so that only the top right corner of the bottom box is rounded. Most of the values are currently hardcoded, as this forms part of a larger code that calls the macro \tikzspecial defines keys that are passed as options. The height of the blue top box should be 3cm, I seem to be about a couple of mm out, any help with that I would also appreciate. \documentclass[10pt,twoside]{book} \usepackage[bottom=2cm,top=2cm, left=3cm, right=4cm,showframe]{geometry} \usepackage{tikz} \usepackage{kantlipsum} \ExplSyntaxOn \makeatletter \NewDocumentCommand{\tikzspecial}{s O +m}{ %% First band \begin{tikzpicture}[remember~picture,overlay,inner~sep=0pt,outer~sep=0pt] \draw[draw=none,fill=cyan,outer~sep=0pt,inner~sep=0pt, xshift={-2cm},yshift=-\dimexpr3cm+10pt] (current~page.north~west) rectangle (\paperwidth,2.5cm); \end{tikzpicture} %% Second band with rounded corners \begin{tikzpicture}[remember~picture,overlay] \node~at~(current~page.north~west)~[yshift=-\dimexpr3cm+5.4pt,xshift=-10pt,%.3 klls corners on left anchor=south~west,inner~sep=10pt, outer~sep=0,white,fill=black, draw=none,rounded~corners=10pt,align=left, text~width=\textwidth]{\leftskip10pt \large \sffamily\LARGE\bfseries \IfBooleanTF{#1}{}{\thechapter.\space} #3\par }; \end{tikzpicture} \vspace*{4\baselineskip} \par \@afterindentfalse \@afterheading } \makeatother \ExplSyntaxOff \begin{document} \parindent=2em % simulate chapter \stepcounter{chapter} \tikzspecial*{Some Special Layout\\ Format} \kant[1-9] \end{document}
- 3d Tikz Graph highlighting a specific interp line and axis problemby FishDrowned on April 7, 2026 at 2:43 pm
I'm currently trying to graphically represent Feynman's technique. Specifically, I have the function rad(atan(sqrt(2-x*x)))/(1+x*x) which is being parametrized as rad(atan(t*sqrt(2-x*x)))/(1+x*x). I managed to create the graph for the function, \documentclass{standalone} \usepackage{tikz,pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ axis lines = center, axis on top, view={50}{30}, xlabel={$x$}, ylabel={$t$}, zlabel={}, xmin=-2, xmax=2, ymin=-2, ymax=2, zmin=-2, zmax=2, tick label style={font=\tiny} ] \addplot3[ surf, shader=faceted interp, faceted color=black!60, opacity=0.85, samples=22, samples y=18, domain=-1.4:1.4, domain y=-2:2, ] {rad(atan(y*sqrt(2-x*x)))/(1+x*x)}; \end{axis} \end{tikzpicture} \end{document} But I'm having trouble figuring out how to a) highlight the specific line along the function that represents rad(atan(sqrt(2-x*x)))/(1+x*x) and b) getting the axis lines to be above and below the 3d surface when the surface is above and below.
- How to plot y = x^{2/3} + 0.8 cos(kx) √(3-x²) in LaTeX TikZby hola on April 7, 2026 at 1:45 pm
I would like to plot the following function in LaTeX using TikZ or pgfplots: \[ y = x^{2/3} + 0.8 \cdot \cos(kx) \cdot \sqrt{3 - x^2} \] The domain is \( - \sqrt{3} \leq x \leq \sqrt{3} \). I need to create a nice graph where: The curve looks smooth I can easily change the value of \( k \) (number of oscillations) The modulated amplitude (the \( \sqrt{3-x^2} \) part) is clearly visible I have tried basic \addplot but I have problems with the fractional power \( x^{2/3} \) and with making the cosine oscillation look good. MWE (Minimal Working Example): \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis} \addplot {x^(2/3)}; % this part works, but adding the rest is difficult \end{axis} \end{tikzpicture} \end{document} pgfplots tikz-pgf plot functions graphics
- How to draw an orientation link with tikzpictureby DLIN on April 6, 2026 at 5:14 pm
I want to draw the above picture in the book Lecture on the topology of 3-manifold. So far, I can only draw the Hopf link: \documentclass[tikz]{standalone} \usepackage{tikz} \usetikzlibrary{knots} \begin{document} \begin{tikzpicture} \begin{knot}[flip crossing={2}] \strand (1.5,0) circle (1.0); \strand (2.5,0) circle (1.0); \end{knot} \end{tikzpicture} \end{document} Q: I do not know what kind of command I should use to draw the above picture.
- Arranging nodes to have a nice circle shapeby user516076 on April 5, 2026 at 1:42 am
I need your help to make the label, i.e. the numbers to be arranged circular nicely and spot-on (not estimating and guessing using rectangle coordinate, which is very difficult). i'm thinking of polar coordinate, but how to implement it so that it can be positioned exactly in the middle of each part? You see, I used manual and it looks ugly and messy... \documentclass[tikz,border=5pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[scale=1.2, every node/.style={font=\Large}] % Radii \def\R{3} \def\r{1.75} % Outer circle (black) \draw[black, line width=1.2pt] (0,0) circle (\R); % Inner circle (cyan) \draw[cyan!70!black, line width=1.2pt] (0,0) circle (\r); % Straight dividing lines (green) \draw[green!60!black, line width=1.2pt] (-\R,0) -- (\R,0); \draw[green!60!black, line width=1.2pt] ({\R*cos(60)},{\R*sin(60)}) -- ({\R*cos(240)},{\R*sin(240)}); \draw[green!60!black, line width=1.2pt] ({\R*cos(120)},{\R*sin(120)}) -- ({\R*cos(300)},{\R*sin(300)}); % Outer ring numbers (red) % Top sector \node[red] at (-0.55, 2.35) {3}; \node[red] at ( 0.55, 2.35) {5}; % Upper-right sector \node[red] at (1.90, 1.65) {4}; \node[red] at (2.30, 0.65) {7}; % Lower-right sector \node[red] at (2.35,-0.65) {0}; \node[red] at (1.90,-1.65) {6}; % Bottom sector \node[red] at (-0.55,-2.35) {2}; \node[red] at ( 0.55,-2.35) {10}; % Lower-left sector \node[red] at (-1.90,-0.65) {4}; \node[red] at (-2.30,-1.65) {1}; % Upper-left sector \node[red] at (-2.30, 0.65) {8}; \node[red] at (-1.90, 1.65) {7}; % Inner circle numbers (red) \node[red] at ( 0.00, 0.95) {?}; \node[red] at ( 1.05, 0.25) {5}; \node[red] at ( 1.00,-0.65) {15}; \node[red] at ( 0.00,-1.10) {8}; \node[red] at (-0.95,-0.60) {11}; \node[red] at (-1.05, 0.25) {6}; \end{tikzpicture} \end{document} At least, I wish to have something similar to this:
- How to adapt a Tikzpicture to the text height?by Mika Ike on April 4, 2026 at 3:09 pm
How to adapt a Tikzpicture to the text height? Spplatter from https://ctan.org/pkg/fontmfizz \documentclass[12pt]{exam} \usepackage[utf8]{inputenc} \usepackage[spanish]{babel} \usepackage{eurosym} \usepackage{multirow} \usepackage[inkscapearea=page]{svg} % só para cargar atrqvuiso, nono para o path de tikz \usepackage{fontawesome7} \usepackage[galician,showseconds=false,showzone=false]{datetime2} \usepackage{unicode-math} \setmainfont{TeX Gyre Pagella} % OpenType version of Palladio/Palatino \setmathfont{TeX Gyre Pagella Math} %\newfontfamily\oldenglish{Old English Text MT} \usepackage{tikz} \usetikzlibrary{svg.path} \begin{document} Agora imos mezclar unha icona(carácter/glifo) dunha fonte \faHouseChimney e otro \tikz{\draw[fill=pink,draw=blue,rotate=0,yscale=-1,scale=1] svg { M23.999,26.112c-3.483-0.418-7.164-2.025-10.217-3.856-3.701-2.249-2.859-5.579-8.0652-4.417-5.0472,1.1313-1.8324,5.4324,0.86046,7.1001,4.6884,2.8745,3.918,1.2779,8.8904,3.6589,2.4074,1.146,4.1677,2.7235,5.3368,4.8239,0.52724,0.97038-2.1169,3.2264-3.8704,1.6642-1.8034-1.6066-5.538,0.77956-5.5322,2.0477,0.0052,1.1273-0.10624,3.6251,4.5829,4.1545,3.4805,0.39298,4.5667,4.4943,2.9491,5.1787-4.7047,1.9945-11.583-0.28724-15.714,2.7056-1.9751,1.4435-3.1972,4.5997-0.21206,5.8065,3.8945,1.5922,9.8389-3.0121,14.117-2.2379,10.591,1.9348,1.3002,8.8326-0.69399,11.17-5.5488,6.566,5.7667,7.0227,9.7142,5.7719,5.3871-1.6959,7.5148-6.0259,12.746-4.3582,2.3503,0.75948,1.6706,4.7191,1.5265,6.2539-0.16448,1.9055-0.88085,3.7365-0.84415,5.6578,0,0.89244-0.02175,1.6959,1.0752,2.0395,1.2057,0.38763,2.4618-0.67046,3.6294-0.13522,1.1867,0.53637,1.2723,2.1601,1.4708,3.1123,0.48528,2.5455,0.47033,5.3152,0,7.8607-0.37382,2.0688-1.6353,4.2121-1.4178,6.3406,0.26779,2.8734,4.7074,3.1416,6.5711,0.96794,1.1147-1.2812,1.3675-3.5889,1.1323-5.1068-1.759-7.3243-4.9031-21.573,4.6707-25.994,6.7695-3.1416,5.5312,1.653,7.6327,4.5253,1.8854,2.5613,3.5384,3.2914,3.9149,0.43383,0.35751-2.6356-0.96921-6.0138-1.0956-8.7239-0.08972-2.0542,2.0825-3.1416,4.112-3.8413,5.1356-1.7421,11.565-1.2812,16.199,1.2361,3.6458,1.9787,2.4508,2.0763,6.8333,3.1028,3.8252,0.89357,5.2567-1.579,4.4125-5.3471-4.7665-4.6397-6.6118-1.286-12.808-2.7002-4.0742-0.92398-2.4716-3.8985,1.2471-3.2842,1.5838,0.26164,2.276-1.9024,1.7552-3.3095-1.2467-3.3687-0.17052-6.8773,2.9243-9.0974,1.6149-1.1618,2.2943-2.6495,2.6178-4.5245,0.37654-1.9956-0.2118-4.4225-2.7973-3.9909-3.0177,0.52059-4.3825,4.1535-7.0958,5.1361-2.9987,1.0716-5.6032-1.1595-5.6752-3.7208-0.08836-2.7855,2.3177-5.2713,2.7296-7.9959,0.79114-5.2994-7.7578-2.932-11.636-4.5095-6.2516-2.5613-1.6916-3.8621,0.32018-7.2122,1.0956-1.7871,3.1238-5.0763,1.4015-7.0257-1.4926-1.7128-3.8456-1.0874-5.2987,0.32678-2.4251,2.3382-1.9031,5.8662-2.3897,8.7396-0.68103,4.1681-1.3791,4.785-6.3896,6.6904-3.431,1.2936-8.3708,0.60848-10.955-1.7139-2.1586-1.9798-1.9411-5.1361-4.2208-6.9671-4.4151-3.5732-6.8633,2.6503-7.9032,5.3592-1.6883,4.5129-3.4269,9.0675-10.542,8.2044z };} obtido dun \verb".svg" (arquivo ou path). \end{document}
- How to draw an SVG using paths in Tikz picture?by Mika Ike on April 4, 2026 at 2:50 pm
How to draw the same image than an SVG using paths in TikZ? The target is get the same TikZ image than the Splatter (fontmfizz) but I can´t. 1.- The TikZ image obtained is vertical flipped, and 2.- Some little parts are not in the expected place \documentclass[12pt]{exam} \usepackage[galician,showseconds=false,showzone=false]{datetime2} \usepackage{unicode-math} \setmainfont{TeX Gyre Pagella} % OpenType version of Palladio/Palatino \setmathfont{TeX Gyre Pagella Math} %\newfontfamily\oldenglish{Old English Text MT} \usepackage{tikz} \usetikzlibrary{svg.path} \begin{document} lorem ipsum kasdjkj dsd ds f sd f ds f ds f ds fsd fa dsf asdf ds f sdaf asdf asdf sad f sad fsdafs \smash{\raisebox{-6em}{\tikz{\draw[fill=violet!82,draw=yellow,rotate=0,yscale=-1,scale=0.5] svg { m28.235,20.103c-0.59539,0.23753-1.8493,0.04972-3.957-0.856-3.599-1.49-5.895-3.36-8.416-5.035-2.486-1.668-5.365-3.379-6.7284-5.1931-1.1392-1.6464,1.9884-2.4412,6.0064-1.3811,5.2395,1.3773,8.2717,4.8177,10.576,6.7541,0.87281,0.70463,4.3397,5.0474,2.5194,5.7114z m68.523,76.118c0.14409,0,3.8782,4.9434,4.668,6.282,1.0249,1.6981,4.8501,5.8809,2.6222,7.6669-1.4722,1.1618-2.7105-0.52059-3.7164-1.519-1.0766-1.0705-6.3033-12.296-3.5737-12.43z m29.958,76.255c0.11396,0.03513,0.21137,0.09847,0.30037,0.156,2.5843,1.3991-2.9327,10.618-3.5239,12.686-0.78314,2.6414-4.5676,5.3907-6.3669,1.611-1.5082-3.2142,8.0274-14.751,9.5905-14.453z M23.999,26.112c-3.483-0.418-7.164-2.025-10.217-3.856-3.701-2.249-2.859-5.579-8.0652-4.417-5.0472,1.1313-1.8324,5.4324,0.86046,7.1001,4.6884,2.8745,3.918,1.2779,8.8904,3.6589,2.4074,1.146,4.1677,2.7235,5.3368,4.8239,0.52724,0.97038-2.1169,3.2264-3.8704,1.6642-1.8034-1.6066-5.538,0.77956-5.5322,2.0477,0.0052,1.1273-0.10624,3.6251,4.5829,4.1545,3.4805,0.39298,4.5667,4.4943,2.9491,5.1787-4.7047,1.9945-11.583-0.28724-15.714,2.7056-1.9751,1.4435-3.1972,4.5997-0.21206,5.8065,3.8945,1.5922,9.8389-3.0121,14.117-2.2379,10.591,1.9348,1.3002,8.8326-0.69399,11.17-5.5488,6.566,5.7667,7.0227,9.7142,5.7719,5.3871-1.6959,7.5148-6.0259,12.746-4.3582,2.3503,0.75948,1.6706,4.7191,1.5265,6.2539-0.16448,1.9055-0.88085,3.7365-0.84415,5.6578,0,0.89244-0.02175,1.6959,1.0752,2.0395,1.2057,0.38763,2.4618-0.67046,3.6294-0.13522,1.1867,0.53637,1.2723,2.1601,1.4708,3.1123,0.48528,2.5455,0.47033,5.3152,0,7.8607-0.37382,2.0688-1.6353,4.2121-1.4178,6.3406,0.26779,2.8734,4.7074,3.1416,6.5711,0.96794,1.1147-1.2812,1.3675-3.5889,1.1323-5.1068-1.759-7.3243-4.9031-21.573,4.6707-25.994,6.7695-3.1416,5.5312,1.653,7.6327,4.5253,1.8854,2.5613,3.5384,3.2914,3.9149,0.43383,0.35751-2.6356-0.96921-6.0138-1.0956-8.7239-0.08972-2.0542,2.0825-3.1416,4.112-3.8413,5.1356-1.7421,11.565-1.2812,16.199,1.2361,3.6458,1.9787,2.4508,2.0763,6.8333,3.1028,3.8252,0.89357,5.2567-1.579,4.4125-5.3471-4.7665-4.6397-6.6118-1.286-12.808-2.7002-4.0742-0.92398-2.4716-3.8985,1.2471-3.2842,1.5838,0.26164,2.276-1.9024,1.7552-3.3095-1.2467-3.3687-0.17052-6.8773,2.9243-9.0974,1.6149-1.1618,2.2943-2.6495,2.6178-4.5245,0.37654-1.9956-0.2118-4.4225-2.7973-3.9909-3.0177,0.52059-4.3825,4.1535-7.0958,5.1361-2.9987,1.0716-5.6032-1.1595-5.6752-3.7208-0.08836-2.7855,2.3177-5.2713,2.7296-7.9959,0.79114-5.2994-7.7578-2.932-11.636-4.5095-6.2516-2.5613-1.6916-3.8621,0.32018-7.2122,1.0956-1.7871,3.1238-5.0763,1.4015-7.0257-1.4926-1.7128-3.8456-1.0874-5.2987,0.32678-2.4251,2.3382-1.9031,5.8662-2.3897,8.7396-0.68103,4.1681-1.3791,4.785-6.3896,6.6904-3.431,1.2936-8.3708,0.60848-10.955-1.7139-2.1586-1.9798-1.9411-5.1361-4.2208-6.9671-4.4151-3.5732-6.8633,2.6503-7.9032,5.3592-1.6883,4.5129-3.4269,9.0675-10.542,8.2044z m84.472,20.141c-0.46364-0.09395-0.4995-0.80523,0.24684-2.441,1.1978-2.7514,3.2175-5.1922,4.92-7.5908,1.7001-2.3768,3.3668-4.9643,5.5286-6.9391,1.9848-1.7473,3.8013-0.91559,3.2896,1.7053-0.66016,3.4141-4.6558,7.3623-6.7652,9.8565-0.75958,0.92329-5.8873,5.7427-7.2198,5.409z m88.466,72.472c-0.3968,0.1723-1.2325,0.03606-2.6372-0.62094-2.3986-1.0812-3.9291-2.4373-5.6092-3.6528-1.6568-1.2099-3.5752-2.4508-4.4841-3.7668-0.75927-1.1943,1.3255-1.7708,4.0031-1.0018,3.4919,0.99907,5.5128,3.4947,7.0483,4.8993,0.58169,0.51113,2.8922,3.6613,1.6791,4.143z M51.882,7.3591c-0.426-0.0546-0.892-0.3354-1.307-0.9496-0.743-1.0353-0.642-1.9171-0.767-2.7944-0.113-0.8689-0.383-1.8219,0.118-2.5152,0.50011-0.61071,2.4544-0.21454,3.6617,0.79567,1.5778,1.3162,0.83608,2.7148,0.69686,3.6142-0.03464,0.33374-1.1388,2.0314-2.4021,1.8494z m50.199,46.064c-0.42596-0.05463-0.89232-0.33545-1.3068-0.94963-0.74288-1.0353-0.64204-1.9171-0.76702-2.7944-0.11349-0.8689-0.38317-1.8219,0.11743-2.5152,0.50011-0.61071,2.4544-0.21454,3.6617,0.79566,1.5778,1.3162,0.83608,2.7148,0.69686,3.6142-0.03464,0.33374-1.1388,2.0314-2.4021,1.8494z };}}} askdlfhjsdajkf hjasdkh fjksdah jkh jkh jk hjk hlkj askdlfhjsdajkf hjasdkh fjksdah jkh jkh jk hjk hlkj askdlfhjsdajkf hjasdkh fjksdah jkh jkh jk hjk hlkj askdlfhjsdajkf hjasdkh fjksdah jkh jkh jk hjk hlkj askdlfhjsdajkf hjasdkh fjksdah jkh jkh jk hjk hlkj askdlfhjsdajkf hjasdkh fjksdah jkh jkh jk hjk hlkj \vspace{3em} \begin{tikzpicture} \draw[fill=orange,draw=cyan] svg{ m28.235,20.103c-0.59539,0.23753-1.8493,0.04972-3.957-0.856-3.599-1.49-5.895-3.36-8.416-5.035-2.486-1.668-5.365-3.379-6.7284-5.1931-1.1392-1.6464,1.9884-2.4412,6.0064-1.3811,5.2395,1.3773,8.2717,4.8177,10.576,6.7541,0.87281,0.70463,4.3397,5.0474,2.5194,5.7114z m68.523,76.118c0.14409,0,3.8782,4.9434,4.668,6.282,1.0249,1.6981,4.8501,5.8809,2.6222,7.6669-1.4722,1.1618-2.7105-0.52059-3.7164-1.519-1.0766-1.0705-6.3033-12.296-3.5737-12.43z m29.958,76.255c0.11396,0.03513,0.21137,0.09847,0.30037,0.156,2.5843,1.3991-2.9327,10.618-3.5239,12.686-0.78314,2.6414-4.5676,5.3907-6.3669,1.611-1.5082-3.2142,8.0274-14.751,9.5905-14.453z M23.999,26.112c-3.483-0.418-7.164-2.025-10.217-3.856-3.701-2.249-2.859-5.579-8.0652-4.417-5.0472,1.1313-1.8324,5.4324,0.86046,7.1001,4.6884,2.8745,3.918,1.2779,8.8904,3.6589,2.4074,1.146,4.1677,2.7235,5.3368,4.8239,0.52724,0.97038-2.1169,3.2264-3.8704,1.6642-1.8034-1.6066-5.538,0.77956-5.5322,2.0477,0.0052,1.1273-0.10624,3.6251,4.5829,4.1545,3.4805,0.39298,4.5667,4.4943,2.9491,5.1787-4.7047,1.9945-11.583-0.28724-15.714,2.7056-1.9751,1.4435-3.1972,4.5997-0.21206,5.8065,3.8945,1.5922,9.8389-3.0121,14.117-2.2379,10.591,1.9348,1.3002,8.8326-0.69399,11.17-5.5488,6.566,5.7667,7.0227,9.7142,5.7719,5.3871-1.6959,7.5148-6.0259,12.746-4.3582,2.3503,0.75948,1.6706,4.7191,1.5265,6.2539-0.16448,1.9055-0.88085,3.7365-0.84415,5.6578,0,0.89244-0.02175,1.6959,1.0752,2.0395,1.2057,0.38763,2.4618-0.67046,3.6294-0.13522,1.1867,0.53637,1.2723,2.1601,1.4708,3.1123,0.48528,2.5455,0.47033,5.3152,0,7.8607-0.37382,2.0688-1.6353,4.2121-1.4178,6.3406,0.26779,2.8734,4.7074,3.1416,6.5711,0.96794,1.1147-1.2812,1.3675-3.5889,1.1323-5.1068-1.759-7.3243-4.9031-21.573,4.6707-25.994,6.7695-3.1416,5.5312,1.653,7.6327,4.5253,1.8854,2.5613,3.5384,3.2914,3.9149,0.43383,0.35751-2.6356-0.96921-6.0138-1.0956-8.7239-0.08972-2.0542,2.0825-3.1416,4.112-3.8413,5.1356-1.7421,11.565-1.2812,16.199,1.2361,3.6458,1.9787,2.4508,2.0763,6.8333,3.1028,3.8252,0.89357,5.2567-1.579,4.4125-5.3471-4.7665-4.6397-6.6118-1.286-12.808-2.7002-4.0742-0.92398-2.4716-3.8985,1.2471-3.2842,1.5838,0.26164,2.276-1.9024,1.7552-3.3095-1.2467-3.3687-0.17052-6.8773,2.9243-9.0974,1.6149-1.1618,2.2943-2.6495,2.6178-4.5245,0.37654-1.9956-0.2118-4.4225-2.7973-3.9909-3.0177,0.52059-4.3825,4.1535-7.0958,5.1361-2.9987,1.0716-5.6032-1.1595-5.6752-3.7208-0.08836-2.7855,2.3177-5.2713,2.7296-7.9959,0.79114-5.2994-7.7578-2.932-11.636-4.5095-6.2516-2.5613-1.6916-3.8621,0.32018-7.2122,1.0956-1.7871,3.1238-5.0763,1.4015-7.0257-1.4926-1.7128-3.8456-1.0874-5.2987,0.32678-2.4251,2.3382-1.9031,5.8662-2.3897,8.7396-0.68103,4.1681-1.3791,4.785-6.3896,6.6904-3.431,1.2936-8.3708,0.60848-10.955-1.7139-2.1586-1.9798-1.9411-5.1361-4.2208-6.9671-4.4151-3.5732-6.8633,2.6503-7.9032,5.3592-1.6883,4.5129-3.4269,9.0675-10.542,8.2044z m84.472,20.141c-0.46364-0.09395-0.4995-0.80523,0.24684-2.441,1.1978-2.7514,3.2175-5.1922,4.92-7.5908,1.7001-2.3768,3.3668-4.9643,5.5286-6.9391,1.9848-1.7473,3.8013-0.91559,3.2896,1.7053-0.66016,3.4141-4.6558,7.3623-6.7652,9.8565-0.75958,0.92329-5.8873,5.7427-7.2198,5.409z m88.466,72.472c-0.3968,0.1723-1.2325,0.03606-2.6372-0.62094-2.3986-1.0812-3.9291-2.4373-5.6092-3.6528-1.6568-1.2099-3.5752-2.4508-4.4841-3.7668-0.75927-1.1943,1.3255-1.7708,4.0031-1.0018,3.4919,0.99907,5.5128,3.4947,7.0483,4.8993,0.58169,0.51113,2.8922,3.6613,1.6791,4.143z M51.882,7.3591c-0.426-0.0546-0.892-0.3354-1.307-0.9496-0.743-1.0353-0.642-1.9171-0.767-2.7944-0.113-0.8689-0.383-1.8219,0.118-2.5152,0.50011-0.61071,2.4544-0.21454,3.6617,0.79567,1.5778,1.3162,0.83608,2.7148,0.69686,3.6142-0.03464,0.33374-1.1388,2.0314-2.4021,1.8494z m50.199,46.064c-0.42596-0.05463-0.89232-0.33545-1.3068-0.94963-0.74288-1.0353-0.64204-1.9171-0.76702-2.7944-0.11349-0.8689-0.38317-1.8219,0.11743-2.5152,0.50011-0.61071,2.4544-0.21454,3.6617,0.79566,1.5778,1.3162,0.83608,2.7148,0.69686,3.6142-0.03464,0.33374-1.1388,2.0314-2.4021,1.8494z }; \end{tikzpicture} \end{document} In addition(optional/secondary): Opt1.- is posible use directly the .svg file in the \draw[fill=violet] svg { .... } Opt2.- Is possible use the SVG option transform="matrix(1,0,0,-1,0,0)" in Tikz path?
- Picking marbles probability courseby Arne Timperman on April 4, 2026 at 1:21 pm
For my probability course, I want to create the following figure with marbles. EDIT: red purple means, it could be red or purble I could create this in Tikz, placing each marble separately, but that does not seem like the correct method to me. AI returned the following (incorrect code). \documentclass[10pt,a4paper,svgnames,openleft,explicit]{book} \usepackage{tikz} \usetikzlibrary{decorations.pathreplacing} \begin{document} \begin{center} \begin{tikzpicture} % Parameters \def\r{0.35} % radius \def\dx{1.0} % x distance \def\dy{1.0} % y distance % --- BOVENSTE 4 RIJEN: rood/paars half --- \foreach \row in {0,1,2,3}{ \foreach \col in {0,...,7}{ % paars rechts \fill[purple] (\col*\dx, -\row*\dy) arc[start angle=-45, end angle=135, radius=\r] -- (\col*\dx, -\row*\dy) -- cycle; % rood links \fill[red] (\col*\dx, -\row*\dy) arc[start angle=135, end angle=315, radius=\r] -- (\col*\dx, -\row*\dy) -- cycle; } } % --- ONDERSTE 4 RIJEN: geel --- \foreach \row in {4,5,6,7}{ \foreach \col in {0,...,7}{ \fill[yellow] (\col*\dx, -\row*\dy) circle (\r); } } % --- ACCOLADE + tekst --- \draw[line width=1pt] (8.5, -0.3) -- (8.5, -3.7) decorate[decoration={brace, amplitude=8pt}]{(8.5,-3.7) -- (8.5,-0.3)}; \node[right] at (8.7, -2) {geen 6 gele}; \end{tikzpicture} \end{center} \end{document} Resulting in this figure Any suggestions?
- Drawing a planar graph with loops [closed]by Trevor3 on April 4, 2026 at 11:57 am
I have been trying to draw the following diagram in TikZ: I've tried my best to produce the above figure using Microsoft Paint but have no idea whatsoever how to do it in TikZ (though it doesn't look that complicated). Any help is greatly appreciated.
- Draw a line wrap around cylinders [closed]by Hoàng on April 4, 2026 at 10:29 am
I new to Tikz and want to draw an image like this: I have stuck to draw the line wrap around, it wraps exactly 10 rounds. Thank you many for help.
- pgf-PeriodicTable: monochrome (black/white) Periodic table - problem with radiation symbol and 'Ra' shorthandby cis on April 4, 2026 at 6:57 am
I want to create a perfect monochrome Periodic table (for black and white printing, etc.). 1/2. Instead of the colored "radioactive symbol" (which seems to be set hard-coded by the package), I'd like to use an asterisk '*' or a simple text character. 2/2. Secondly, the term 'Ra' in the legend must also be replaced by the star (or the other symbol used). Note: The aforementioned "radioactive symbol" seems to be (hard-coded) retrieved from the file /texmf-dist/tex/latex/pgf-periodictable/pgfPT_radio_symbol.pdf → which is located near the package file. One could therefore "hack" the problem by placing a PDF file with the same name in one's working directory. However, I'm wondering if there's a more elegant solution. PS: Since I'm not yet very familiar with the package, general suggestions for improvement are welcome. My progress so far: \documentclass[paper=a4, paper=landscape]{scrarticle} \usepackage[margin=11mm,showframe=false,]{geometry} \usepackage{lmodern} \usepackage{pgf-PeriodicTable} \begin{document} \pgfPT[ cell font=\sffamily,% normal LaTeX font (avoids font warnings of pgf-PeriodicTable) csSolid, show title=false, %Z list={1,...,36,87,88},% test Z backcolor=white, Z color=black, Z font=\footnotesize\bfseries, %CS render mode=fill and outline,% default CS outline color=black,% Outline always black CS solid=black, % Solid: black CS liquid=gray,% Liquid: gray CS synt=white,% Synthetic: white ("inline color") CS gas=lightgray,% Gaseous: white (only outline visible) light gray name color=black, name font=\fontsize{5.125pt}{6.125pt}\selectfont,% default: \tiny but seems to large Ar color=black, capitalize element names=true,% please! period label color=black,% Color of period numbers (left) group label color=black,% Color of group numbers (top) %legend radio color=red,% test MNM line width=1.4pt,% default: 0.8pt MNM line color=black,% default: red!80!black %show MNM line=false,% alternative ] \end{document} PPS: The star for "radioactive" is not that unusual.
- I am trying to make a really cool animation using Koch snowflakes, but don't know howby Jasper on March 22, 2026 at 3:28 pm
I was scrolling through reels earlier and came across a really cool animation: https://www.youtube.com/shorts/aQbq_Fpyyb4. Note: You can analyze the gif frame by frame using the method suggested by MS-SPO in the comments, or by using the website ez-gif, or by using custom python scripts. I interchangeably use ez-gif and python for these sorts of things, and in this instance used ez-gif. I did some digging and found this old post, which I modified slightly. % Source - https://tex.stackexchange.com/a/205608 % Posted by Mark Wibrow % Retrieved 2026-03-22, License - CC BY-SA 3.0 \documentclass[tikz, border=5]{standalone} \usetikzlibrary{lindenmayersystems} \tikzset{koch snowflake/.style={insert path={% l-system [l-system={rule set={F -> F-F++F-F}, axiom=F++F++F, step=0.75cm/3^#1, angle=60, order=#1,anchor=center}] -- cycle}}} \begin{document} \begin{tikzpicture} \path[fill=orange,koch snowflake=4]; \end{tikzpicture} \end{document} I am however without a clue as to how to go about producing this gif I found. I am seeking assistance in creating this gif.
- How to create lines perfectly lie on a circle shape with TikZ?by user516076 on March 12, 2026 at 6:49 am
It's very difficult to make a perfect line that lies on exact circle. This is my full work: \documentclass[tikz,border=1pt]{standalone} \usepackage{tikz} \usepackage{calligra} \usepackage[T1]{fontenc} \begin{document} \begin{tikzpicture}[line width=1pt] \path[use as bounding box] (-5.6,-1.2) rectangle (6.4,7.2); % Circle \draw (2.6,3.0) circle (3.1); % Secant line P-T-U \draw (-5.0,0.1) -- (4.7,5.6); % Chords \draw (2.6,2.3) -- (1.2,1.7); % short chord near S \draw (1.2,1.7) -- (4.0,1.4); % S to V \draw (4.0,1.4) -- (4.7,5.6); % V to U % Angle at S \draw (1.2,1.7) ++(0.55,0) arc[start angle=0,end angle=123,radius=0.55]; % Angle at V \draw (4.0,1.4) ++(-0.55,0) arc[start angle=180,end angle=95,radius=0.55]; % Labels \node[font=\fontsize{34}{34}\selectfont] at (-5.0,-0.4) {$P$}; \node[font=\fontsize{34}{34}\selectfont] at (0.2,2.9) {$T$}; \node[font=\fontsize{34}{34}\selectfont] at (5.2,5.9) {$U$}; \node[font=\fontsize{34}{34}\selectfont] at (4.3,0.4) {$V$}; \node[font=\fontsize{34}{34}\selectfont] at (0.9,0.7) {$S$}; % Angle labels \node[font=\fontsize{28}{28}\selectfont] at (2.0,2.5) {$123^\circ$}; \node[font=\fontsize{28}{28}\selectfont] at (3.6,2.0) {$85^\circ$}; \end{tikzpicture} \end{document} and this is the result: What I want: Please along with full MWE ready to copy paste, could you explain, what the trick is and what to add and where to add, so that I can also learn? T.I.A.
- tiered list with a heading with tree-like |- line connectors that enumerate itemsby Mampac on March 1, 2026 at 4:08 pm
how do i get a list that has a heading (in this example, "Deep Learning Methods" as the heading), from which level-2 entries are connected with solid lines? so far i draw the connector lines with tikz like this: which looks fine except for the extra-bolded trunk of the tree due to multiple retracing of the same connector path in my current implementation. it is super-subtle, but when you zoom out of the PDF file, you can see marginal pixel strips lacking at the upper part of the tree trunk where it's thinner than the rest. the MRE is as follows: \documentclass{article} \usepackage{tikz} \usetikzlibrary{tikzmark,calc} \tikzset{ taxonomy/.style={ overlay, remember picture } } \newcommand{\subcatindent}{1.3em} \newcommand{\methodsindent}{2.3em} \begin{document} unrelated text\\ \textbf{\tikzmarknode{dl}{\underline{Deep Learning Methods}}}\\ \hspace*{\subcatindent}\textbf{\tikzmarknode{dl_convo}{Convolution}}\\ \hspace*{\methodsindent}AE-based\\ \hspace*{\subcatindent}\textbf{\tikzmarknode{dl_ae}{Autoencoders}}\\ \hspace*{\methodsindent}Method D2\\ \hspace*{\subcatindent}\textbf{\tikzmarknode{dl_gan}{GANs}}\\ \hspace*{\methodsindent}Method D3\\ \hspace*{\subcatindent}\textbf{\tikzmarknode{dl_diff}{Diffusion}}\\ \hspace*{\methodsindent}Method D3\\ \hspace*{\subcatindent}\textbf{\tikzmarknode{dl_att}{Attention-Driven}}\\ \hspace*{\methodsindent}Method D3\\ \hspace*{\subcatindent}\textbf{\tikzmarknode{dl_ens}{Ensemble}}\\ \hspace*{\methodsindent}Method D3 \begin{tikzpicture}[taxonomy] \newcommand{\srcOffsetX}{+0.3em} \newcommand{\srcOffsetY}{-1.0ex} \coordinate (dl_start) at ($(dl.south west)+(\srcOffsetX,\srcOffsetY + 0.3ex)$); \coordinate (dl_lowest) at (dl_ens.west); \coordinate (dl_trunk) at ($(dl_start |- dl_lowest)$); \draw (dl_start) -- (dl_trunk); \draw (dl_trunk) |- (dl_convo.west); \draw (dl_trunk) |- (dl_ae.west); \draw (dl_trunk) |- (dl_gan.west); \draw (dl_trunk) |- (dl_diff.west); \draw (dl_trunk) |- (dl_att.west); \draw (dl_trunk) |- (dl_ens.west); \end{tikzpicture} \end{document} is there a way to dynamically and systematically implement this so that the connectors are drawn exactly at the place where the previous one turned 90 degrees to the right? ideally, i could turn this in a custom list environment, but so far i don't see a clear way of solving the retracing problem.
- Putting two flowcharts on the same page side by side in Latexby Destr on January 31, 2026 at 12:27 pm
So i have the following code in latex and i'm trying to put these two flowcharts side by side, for some reason i cant do that and instead one is on top of the other , i can't understand what i do wrong. Below is the code and here is the resulting image \documentclass{article} \usepackage[dvipsnames]{xcolor} \usepackage{tikz} \usetikzlibrary{arrows.meta, positioning, calc} \usepackage{xcolor} \usepackage{graphicx} \usetikzlibrary{shapes.geometric, arrows.meta, positioning,calc} \usepackage{algorithm} \usepackage{algorithmic} \begin{document} \begin{figure}[ht] \centering % ================= LEFT DIAGRAM ================= \begin{minipage}[t]{0.30\textwidth} \centering \begin{tikzpicture}[ scale=0.75, transform shape, node distance=1cm, every node/.style={font=\scriptsize}, block/.style={rectangle, draw, rounded corners, minimum width=2.6cm, minimum height=0.7cm, align=center}, adder/.style={circle, draw, minimum size=0.45cm, inner sep=0pt}, arrow/.style={->, thick} ] \tikzset{ inputoutput/.style={block, fill=cyan!40}, linear/.style={block, fill=green!40}, mixup/.style={block, fill=BrickRed!40}, penc/.style={block, fill=purple!40}, cmamba/.style={block, fill=red!40}, rms/.style={block, fill=yellow!40} } \node[inputoutput] (input) {Input}; \node[mixup, above=of input] (mixup) {Channel Mixup}; \node[linear, above=of mixup] (lin1) {Linear}; \node[penc, above=of lin1] (penc) {Positional Encoding}; \node[adder, above=of penc] (add) {$+$}; \node[cmamba, above=of add] (cmamba) {CMamba}; \node[rms, above=of cmamba] (rms) {RMS Norm}; \node[linear, above=of rms] (lin2) {Linear}; \node[inputoutput, above=of lin2] (output) {Output}; \draw[arrow] (input) -- (mixup); \draw[arrow] (mixup) -- (lin1); \draw[arrow] (lin1) -- (penc); \draw[arrow] (penc) -- (add); \draw[arrow] (add) -- (cmamba); \draw[arrow] (cmamba) -- (rms); \draw[arrow] (rms) -- (lin2); \draw[arrow] (lin2) -- (output); \draw[arrow] (input.east) -- ++(1.2,0) |- (add.east); \end{tikzpicture} \caption*{(a) Overall Architecture} \end{minipage} \hfill % ================= RIGHT DIAGRAM ================= \begin{minipage}[t]{0.30\textwidth} \centering \begin{tikzpicture}[ scale=0.7, transform shape, node distance=0.45cm, every node/.style={font=\scriptsize}, block/.style={rectangle, draw, rounded corners, minimum width=3.2cm, minimum height=0.7cm, align=center}, mult/.style={circle, draw, minimum size=0.45cm, inner sep=0pt}, arrow/.style={->, thick} ] \node[block, fill=green!40] (linL) {Linear}; \node[block, fill=RoyalBlue!40, above=of linL] (conv) {Conv1D}; \node[block, fill=magenta!40, above=of conv] (siluL) {SiLU}; \node[block, fill=red!40, above=of siluL] (ssm) {SSM}; \node[block, fill=green!40, right=0.8cm of linL] (linR) {Linear}; \node[block, fill=magenta!40, above=of linR] (siluR) {SiLU}; \node[mult] (mult) at ($(ssm.north)!0.5!(siluR.north) + (0,2cm)$) {$\times$}; \draw[arrow] (linL) -- (conv); \draw[arrow] (conv) -- (siluL); \draw[arrow] (siluL) -- (ssm); \draw[arrow] (linR) -- (siluR); \draw[arrow] (ssm.north) |- (mult.west); \draw[arrow] (siluR.north) |- (mult.east); \node[block, fill=yellow!40, above=0.4cm of mult] (rms2) {RMS Norm}; \draw[arrow] (mult) -- (rms2); \end{tikzpicture} \caption*{(b) CMamba Block (Expanded)} \end{minipage} \caption{Overview of the model architecture and the internal structure of the CMamba block.} \label{fig:cmamba_combined} \end{figure} \end{document}
- How to avoid duplicate chapter title and absolutely position chapter title with TikZby Chen Mortenfeld on June 12, 2025 at 7:50 pm
I'm customizing chapter titles in my book using the titlesec and tikz packages. For special chapters like the "Preface", I want to: Show a custom TikZ-styled title box that is positioned exactly \TitleBoxOffset below the top of the page (absolute positioning, not relative). Avoid having the chapter title (e.g., "Preface") appear twice on the page — once inside my TikZ box and once from LaTeX's default chapter title mechanism. So basically "Preface" appears twice, and the location is set manually. Here's my code in the .sty file: \usepackage[explicit]{titlesec} \usepackage{tikz} \usepackage{xcolor} \usepackage{etoolbox} % for \IfStrEq \newcommand{\CurrentChapterTitle}{} \newlength{\ChapterTopSkip} \newcommand{\ChapterHook}[1]{% \renewcommand{\CurrentChapterTitle}{#1}% \IfStrEq{#1}{Preface}{% \titleformat{\chapter} [block] {\centering} {} % no label {0pt} {% \begin{tikzpicture} \node[ draw=lightblue, line width=1pt, rounded corners=10pt, minimum width=0.8\linewidth, minimum height=2cm, align=center, fill=white, fill opacity=1, text opacity=1 ] {\scalebox{1.4}{\textcolor{lightblue}{\Huge{#1}}}}; \end{tikzpicture} } % \titlespacing*{\chapter}{0pt}{-\topskip}{20pt} \titlespacing*{\chapter}{0pt}{-95pt}{20pt} } {% \titleformat{\chapter}[block] {\normalfont\scshape\Huge\centering} {\fontsize{140pt}{140pt}\selectfont\thechapter\\} {0pt} {\normalfont\scshape\Huge\centering #1} }% } % % Patch \chapter to call ChapterHook \let\oldchapter\chapter \renewcommand{\chapter}[1]{% \ChapterHook{#1}% \oldchapter{#1}% } % Suppress LaTeX’s default \@makechapterhead \makeatletter \renewcommand{\@makechapterhead}[1]{} \makeatother Update: I updated the code block to include the packages. Thanks to the comments, I managed to make the word "Preface" appear only once, by using: \usepackage[explicit]{titlesec} see the update code. Now my only issue is the position of the title that I define manually — I want it to be at position 0 relative to the page boundaries, and then I’ll subtract a fixed predefined offset from it. Thank you!
- How to align text with graphs and add a bracket with Tikz?by hana on November 11, 2024 at 4:56 pm
Could anyone help align the text and the graphs as shown in the right figure? Also, could you help with adding the brackets? By bracket, I mean to say that the values in YY column can form tuples of graphs from each row. For example, YY1 is the combination of the first graph from each row. Please suggest if you know a better way than using brackets. \documentclass[conference]{IEEEtran} \IEEEoverridecommandlockouts \usepackage{cite} \usepackage{amsmath,amssymb,amsfonts} \usepackage{algorithmic} \usepackage{graphicx} \usepackage{textcomp} \usepackage{xcolor} \usepackage{booktabs} \usepackage{tikz} \usepackage{lipsum} \def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}} \begin{document} \lipsum[1] % Define the side length, horizontal distance, and circle size as global variables \def\sideLength{0.5} % You can change this value \def\hDistance{1} % You can change this value \def\circleSize{1.5pt} % Circle size for the vertices \begin{table}[h!] \centering \caption{Sample Table with Graphs Using TikZ} \label{tab:sample_table} \begin{tabular}{cccc} % 4 columns \toprule No. & XX & Graph & YY \\ % Header row \midrule 1 & Value 1 & \begin{tikzpicture} \fill[red] (0,0) circle (\circleSize); % Draw and fill Vertex A \node at (0,-0.2) {A}; % Label A \end{tikzpicture} & Value YY1 \\ 2 & Value 2 & \begin{tikzpicture} % Draw the edge between A and B \draw[black] (0,0) -- (\sideLength,0); % Edge between A and B % Now fill the vertices \fill[red] (0,0) circle (\circleSize); % Vertex A (filled) \node at (0,-0.2) {A}; \fill[red] (\sideLength,0) circle (\circleSize); % Vertex B (filled) \node at (\sideLength,-0.2) {B}; \end{tikzpicture} & Value YY2 \\ 3 & Value 3 & \begin{tikzpicture} % Draw the edges for the first graph (equilateral triangle) \draw[black] (0,0) -- (\sideLength,0); % Edge A-B \draw[black] (\sideLength,0) -- (\sideLength/2,{\sideLength*sqrt(3)/2}); % Edge B-C \draw[black] (\sideLength/2,{\sideLength*sqrt(3)/2}) -- (0,0); % Edge C-A % Fill the vertices \fill[red] (0,0) circle (\circleSize); % Vertex A \node at (0,-0.2) {A}; \fill[red] (\sideLength,0) circle (\circleSize); % Vertex B \node at (\sideLength,-0.2) {B}; \fill[red] (\sideLength/2,{\sideLength*sqrt(3)/2}) circle (\circleSize); % Vertex C \node at (\sideLength/2,{\sideLength*sqrt(3)/2+0.2}) {C}; % Second graph (path: edges between A-B and B-C) \begin{scope}[xshift=\hDistance cm] \draw[black] (0,0) -- (\sideLength,0); % Edge A-B \draw[black] (\sideLength,0) -- (\sideLength/2,{\sideLength*sqrt(3)/2}); % Edge B-C \fill[red] (0,0) circle (\circleSize); % Vertex A \node at (0,-0.2) {A}; \fill[red] (\sideLength,0) circle (\circleSize); % Vertex B \node at (\sideLength,-0.2) {B}; \fill[red] (\sideLength/2,{\sideLength*sqrt(3)/2}) circle (\circleSize); % Vertex C \node at (\sideLength/2,{\sideLength*sqrt(3)/2+0.2}) {C}; \end{scope} % Third graph (star: edges from C to A and B) \begin{scope}[xshift=2*\hDistance cm] \draw[black] (\sideLength/2,{\sideLength*sqrt(3)/2}) -- (0,0); % Edge C-A \draw[black] (\sideLength/2,{\sideLength*sqrt(3)/2}) -- (\sideLength,0); % Edge C-B \fill[red] (0,0) circle (\circleSize); % Vertex A \node at (0,-0.2) {A}; \fill[red] (\sideLength,0) circle (\circleSize); % Vertex B \node at (\sideLength,-0.2) {B}; \fill[red] (\sideLength/2,{\sideLength*sqrt(3)/2}) circle (\circleSize); % Vertex C \node at (\sideLength/2,{\sideLength*sqrt(3)/2+0.2}) {C}; \end{scope} % Fourth graph (V-shape: edges from A to C, and A to B) \begin{scope}[xshift=3*\hDistance cm] \draw[black] (0,0) -- (\sideLength/2,{\sideLength*sqrt(3)/2}); % Edge A-C \draw[black] (0,0) -- (\sideLength,0); % Edge A-B (corrected) \fill[red] (0,0) circle (\circleSize); % Vertex A \node at (0,-0.2) {A}; \fill[red] (\sideLength,0) circle (\circleSize); % Vertex B \node at (\sideLength,-0.2) {B}; \fill[red] (\sideLength/2,{\sideLength*sqrt(3)/2}) circle (\circleSize); % Vertex C \node at (\sideLength/2,{\sideLength*sqrt(3)/2+0.2}) {C}; \end{scope} \end{tikzpicture} & Value YY3 \\ 4 & Value 4 & ... & Value YY4 \\ \bottomrule \end{tabular} \end{table} \end{document}
- Tikz symbols over colors in tableby David Moldes on November 14, 2023 at 1:53 pm
I am using the tikz package to create checkmarks and crosses, but if I color the rows, then they are only partially seen. Here is a minimal working example: \documentclass[table]{article} \usepackage{graphicx, xcolor} % Required for inserting images \usepackage{tabularx,booktabs} \usepackage{amsmath,amsfonts,amssymb,amscd,amsthm} \usepackage{multirow} \usepackage{array} \usepackage{multicol} \definecolor{DarkGreen}{rgb}{0.0, 0.5, 0.0} \definecolor{DarkRed}{rgb}{0.76, 0.13, 0.28} \definecolor{lavender}{rgb}{0.9, 0.9, 0.98} \usepackage{tikz} \def\checkmark{\color{DarkGreen}\tikz\fill[scale=0.4](0,.35) -- (.25,0) -- (1,.7) -- (.25,.15) -- cycle;} \def\cross{\color{DarkRed}$\mathbin{\tikz [x=1.4ex,y=1.4ex,line width=.2ex, red] \draw (0,0) -- (1,1) (0,1) -- (1,0);}$} \begin{document} \begin{table}[] \begin{tabular}{lccccc} \toprule & \multicolumn{3}{c}{\textbf{Proteins}} & \textbf{CHs} & \multicolumn{1}{l}{} \\ \cline{2-5} \multicolumn{1}{c}{\textbf{DES}} & \textit{BCA Microplate} & \textit{BCA 1 mL} & \textit{Bradford} & \textit{Dubois} & \textit{\textbf{Apt?}} \\ \toprule \rowcolor{lavender} \textit{ChCl:Lactic acid} & -22,6\% & 13,2\% & 15,0\% & 4,3\% & \multirow{2}{*}{\checkmark} \\ \rowcolor{lavender} \textit{ChCl:Lactic acid} & -32,0\% & 6,3\% & -7,5\% & 12,9\% & \\ \textit{ChCl:2Lactic acid} & -43,6\% & 8,3\% & 10,8\% & 11,9\% & \multirow{2}{*}{\checkmark} \\ \textit{ChCl:2Lactic acid} & -46,7\% & -2,0\% & -3,1\% & 20,8\% & \\ \rowcolor{lavender} \textit{ChCl:3Lactic Acid} & -41,7\% & 6,4\% & 5,9\% & 12,9\% & \multirow{2}{*}{\checkmark} \\ \rowcolor{lavender} \textit{ChCl:3Lactic Acid} & -51,1\% & -1,6\% & 3,9\% & 35,1\% & \\ \textit{ChCl:6Lactic Acid} & -57,3\% & -3,3\% & 3,1\% & 42,9\% & \multirow{2}{*}{\cross} \\ \textit{ChCl:6Lactic Acid} & -54,6\% & -1,1\% & 6,4\% & 28,0\% & \\ \bottomrule \end{tabular} \end{table} \end{document}
- Animated Brownian motion with fadingby JeT on June 9, 2023 at 8:28 am
I try to reproduce this interesting visual on brownian motion and to make an animation out of it. \documentclass[10pt]{standalone} \usepackage{tikz} \usetikzlibrary{fadings} \begin{document} \begin{tikzpicture} \foreach \Y in {1,...,10} {\draw[path fading=west] (3*rnd,1-2*rnd) foreach \X in {1,...,100} {-- ++ (0.05,0.2-0.4*rnd)}; } \end{tikzpicture} \end{document} This is only the first step to get an Animation I have no idea on how to move forward though :/ Source. BrownianMotion
- TikZ: add the rotation arms of a Roulette Wheelby cis on May 13, 2023 at 2:24 pm
How could I add a thing in the middle like this here \documentclass[margin=5mm]{standalone} \usepackage{tikz} \usetikzlibrary{shapes.geometric} \begin{document} \begin{tikzpicture}[font=\tiny\sffamily, thin] % Roulette Wheel \pgfmathtruncatemacro\s{36} \pgfmathsetmacro\R{1.7}% Outer Radius Number \pgfmathsetmacro\r{1.4}% Inner Radius Number \pgfmathsetmacro\Radius{0.5*(\R+\r)}% Fill-Radius Number \pgfmathsetlengthmacro\LW{1cm*(\R-\r)}% Line Width of Fill \pgfmathsetmacro\rT{1.0}% Inner Radius Wheel \pgfmathsetmacro\rA{2.3}% Outer Radius Wheel \pgfmathsetmacro\rD{0.5*(\rA+\R)-0.025}% Radius of Diamonds \pgfmathsetmacro\wM{360/(\s+1)}% Middle Point Angle % List of Numbers \def\RLT{0, 32, 15, 19, 4, 21, 2, 25, 17, 34, 6, 27, 13, 36, 11, 30, 8, 23, 10, 5, 24, 16, 33, 1, 20, 14, 31, 9, 22, 18, 29, 7, 28, 12, 35, 3, 26} % Array of List \def\RLTa{{\RLT}} \foreach \Place in {0,...,\s}{%% \pgfmathsetmacro\wStart{90-0.5*\wM-\Place*\wM}% Startangle \pgfmathsetmacro\wEnd{\wStart+\wM}% Endangle \pgfmathsetmacro\wMiddle{\wStart+0.5*\wM)}% % Fill Number Areas \pgfmathsetmacro\rscolor{mod(\Place,2)==0 ? 1 : 0} \ifnum\Place=0 \colorlet{rscolor}{green!66!black} \else% \ifnum\rscolor=1 \colorlet{rscolor}{black} \else \colorlet{rscolor}{red}% \fi\fi% \path[draw=rscolor, line width=\LW, ] ([shift=(\wStart:\Radius)]0,0) arc[start angle=\wStart, end angle=\wEnd, radius=\Radius]; % Write Numbers \path[draw=none] (\wMiddle:\r) -- (\wMiddle:\R) node[inner sep=0pt, midway, rotate={-\Place*\wM}, text=white, ]{\pgfmathprint{\RLTa[\Place]}}; % Poches \draw[] (\wStart:\rT) -- (\wStart:\R); }%% % Circles \draw[] circle[radius=\R]; \draw[] circle[radius=\r]; \draw[] circle[radius=\rT]; \draw[double,double distance=0.4pt] circle[radius=\rA]; % Diamonds \foreach \w in {60, 120,...,360}{%% \node[shape=diamond, draw, inner sep=0pt, minimum width=1mm, minimum height=2.5mm, very thin, rotate=\w, ] at (\w:\rD){}; }%% \foreach \w in {30, 90,...,330}{%% \node[shape=diamond, draw, inner sep=0pt, minimum width=2mm, minimum height=1mm, very thin, rotate=\w, ] at (\w:\rD){}; }%% \end{tikzpicture} \end{document}
- How to change the color and arrow of the circular diagram of the smartdiagram [closed]by user12585 on July 18, 2021 at 12:17 pm
https://texdoc.org/serve/smartdiagram/0 page 4 has a basic circular diagram. \begin{center} \smartdiagram[circular diagram]{Set up,Run,Analyse,Modify~/ Add} \end{center} I want to set each box shape rectangle without any shades each box has no filling color (transparent) arrow color black and a direct edge Please advise.
- Problem with TikZ and pause/onlside in beamer [duplicate]by Alexander Härtel on September 30, 2020 at 9:24 am
i have some problems with tikz and pause in beamer. The graphic crashes every time after the second frame. I have already tried onslide, pasue and only. Without pause etc. the TikZ picture works... Can anyone help me here? best regards Alex Sorry for the chaotic code \documentclass[aspectratio=169,xcolor=table]{beamer} % Define block styles \usepackage[ngerman]{babel} \usetikzlibrary{shapes.geometric, arrows} \usetikzlibrary{shapes.geometric}% für Ellipse \usetikzlibrary{calc} \tikzset{ pfeil/.style={stealth-}, beschr/.style={remember picture,overlay,font=\small}} \usepackage{tikz} \usetikzlibrary{shapes.geometric, arrows} \usepackage{tikz} \usetikzlibrary{snakes} \begin{document} \begin{frame} \usetikzlibrary{arrows, arrows.meta, calc, positioning, shapes} \tikzstyle{block} = [rectangle, draw, fill=white!20, text width=3cm, text centered, rounded corners, minimum height=2.1cm] \tikzstyle{block1} = [rectangle, draw, fill=gray!10, text width=3.2cm, text centered, rounded corners, minimum height=2.1cm] \tikzstyle{block2} = [rectangle, draw, fill=gray!20, text width=3.2cm, text centered, rounded corners, minimum height=2.1cm] \tikzstyle{block3} = [rectangle, draw, fill=gray!25, text width=3.4cm, text centered, rounded corners, minimum height=2.1cm] \tikzstyle{line} = [draw, -latex'] \centering {\begin{tikzpicture}[node distance = 0.4cm, auto] \footnotesize % Place nodes \only<1>{ \node [block] (Messdaten) {\textbf{Start: ..}}; } \only<1-2>{ \node [block1, right =of Messdaten] (Maxima) {Unterteilung...}; \path [line] (Messdaten.east) -- (Maxima); } \only<1-3>{ \node [block2, right =of Maxima] (SdkF) {Summe der kleinsten Fehlerquadrate....}; \path [line] (Maxima.east) -- (SdkF); } \only<1-4>{ \node [block3, right =of SdkF] (BSpline) {\textit{B-Spline Approximation}}; \path [line] (SdkF.east) -- (BSpline); } \only<1-5>{ \node [block2, below =of Messdaten] (Phasenv) {Elimination}; \path [line] (BSpline.south) -- ++(0,-5.5pt) -| (Phasenv); } \only<1-6>{ \node [block1, right =of Phasenv] (Aufsp) {Unterteilung ..}; \path [line] (Phasenv.east) -- (Aufsp); } \only<1-7>{ \node [block1, right =of Aufsp] (Minima) {Suche ..}; \path [line] (Aufsp.east) -- (Minima); } \only<1-8>{ \node [block, right =of Minima] (Rissschl) {\textbf{Ende..}}; \path [line] (Minima.east) -- (Rissschl); } \end{tikzpicture} } \end{frame} \end{document}
- Is there a bug in the `arrows.meta` or `bending` library with the `double` option in TikZ 3.1.5b?by AndréC on July 10, 2020 at 4:56 pm
When the bending library is loaded, the double arrows are no longer attached to the line. \documentclass[tikz,border=5mm]{standalone} \usetikzlibrary{bending} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture}[] % Old arrows library prior to Tikz 3.0 \begin{scope}[>=latex] \draw (90:1.5)--(0,0)--(0:1.5); \draw [blue,,->] (0:5mm)arc[start angle=0,delta angle=90,radius=5mm]; \draw [red,double,->] (0:10mm)arc[start angle=0,delta angle=90,radius=10mm]; \node[align=left,anchor=west] at (0,-1){With old library\\ arrows no bug}; \end{scope} % New arrows.meta library introduced with Tikz 3.0 \begin{scope}[>={Triangle[]},xshift=4cm] \draw (90:1.5)--(0,0)--(0:1.5); \draw [blue,,->] (0:5mm)arc[start angle=0,delta angle=90,radius=5mm]; \draw [red,double,->] (0:10mm)arc[start angle=0,delta angle=90,radius=10mm]; \end{scope} \begin{scope}[>=Stealth,xshift=6cm] \draw (90:1.5)--(0,0)--(0:1.5); \draw [blue,,->] (0:5mm)arc[start angle=0,delta angle=90,radius=5mm]; \draw [red,double,->] (0:10mm)arc[start angle=0,delta angle=90,radius=10mm]; \node[align=left,anchor=center] at (0,-1){With new library\\ arrows.meta: bug}; \end{scope} \end{tikzpicture} \end{document}
- Annotating a table with arrowsby Maryà on August 12, 2019 at 6:40 am
I want to recreate the following table on latex Here is my MWE \documentclass{article} \usepackage{colortbl} \begin{document} \begin{table}[h] \begin{tabular}{|>{\columncolor[gray]{.8}}c|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|m{1cm}|} \hline \footnotesize{ $x$ } & 0.900 & 0.990 & 0.999 & 1.000 & 1.001 & 1.010 & 1.100 \\ \hline \footnotesize{ $f(x)$} & 1.810 & 1.980 & 1.998 & 2.000 & 2.002 & 2.020 & 2.210 \\ \hline \end{tabular} \end{table} \end{document}
- Creating a triangular tableby soandos on April 26, 2013 at 3:01 am
Is there a way to create something that looks like this? I have looked at the \rotatebox command, but that will not get the same "jagged" edges on the bottom, and looked at How to draw a diagonally-split grid with TikZ? which seems applicable (especially in conjunction with the \rotatebox). I was able to make this: With code adapted from the link, but I have no idea how to customize it. \documentclass[12pt]{article} \usepackage[english]{babel} \usepackage{amsfonts} \usepackage{tikz} \usepackage{rotating} \usetikzlibrary{calc,decorations.shapes} \tikzset{ decorate with/.style args={#1 separated by #2}{ fill, decorate,decoration={shape backgrounds,shape=#1,shape size=1.5mm, shape sep={#2, between borders}} } } \pgfkeys{/tikz/.cd, num quad/.initial=5, num quad/.get=\numquad, num quad/.store in=\numquad, } \begin{document} \usetikzlibrary{calc,decorations.shapes} \rotatebox{315}{\begin{tikzpicture}[x=0.5025cm,y=0.5025cm,line cap=round] \foreach \x [count=\xi] in {1,...,\numquad}{ \foreach \y [count=\yi] in {\x,...,\numquad}{ \node [draw, minimum size=0.5cm,outer sep=0pt,inner sep=0pt] (u-\xi\yi) at (\xi,-\yi) {}; } } \end{tikzpicture} } \end{document}
- TiKZ decoration doesn't workby Turion on May 17, 2011 at 5:05 pm
I am trying to get TikZ decorations to work, but so far without success. In this minimal example, I am trying to compile an example found in pgfmanual.pdf in section 20.2: \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations} \begin{document} \begin{tikzpicture} \draw decorate [decoration=zigzag] {(0,0) -- (2,2)}; \end{tikzpicture} \end{document} I always get this error "! Package pgfkeys Error: I do not know the key '/pgf/decoration/crosses' and I am going to ignore it. Perhaps you misspelled it." What is the problem?