TikZ
- 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.
- tikz, multipart node: how to define height of empty partby Zarko on April 4, 2026 at 3:21 am
My question is very similar to this question which unfortunately hasn't answered yet. in one comment is mentioned, that multi part node has a bug. Do anyone know, if meantime was this bug fixed or know some work around it? \documentclass[border=1mm, 11pt]{standalone} \usepackage{tikz} \usetikzlibrary{shapes.multipart} \begin{document} \begin{tikzpicture}[ MPNV/.style args = {#1/#2}{%, rectangle split parts=#1, text width=#2, shape=rectangle split, draw, rectangle split empty part height=7mm, rectangle split part fill={white, cyan!50}, inner sep=1mm, outer sep=0mm, align=center, }, ] \node [MPNV=2/7mm] {\nodepart{one} \rotatebox{90}{some test} \nodepart{two} }; \end{tikzpicture} \end{document} As temporary solution I insert in the second node part the rule \rule{0mm}{5mm}. However, I would be much happier, if I can add some fix to my document preamble. BTW, I use recent version of tikz: 3.1.11a from August 29, 2025.
- pgf-PeriodicTable: Adjust font alignment (and color scheme)by cis on April 3, 2026 at 6:37 pm
First of all: I've noticed that the search for pgf-PeriodicTable isn't currently yielding any significant results. I've created a new tag and hope to vitalize this wonderful package with this post; and I look forward to seeing many more great PTEs in the future. I want to create a very simple periodic table, similar to the one you find with a Google search (see image below); ideally, it should also use this color scheme for the text and background. I'm having a few problems with pgf-PeriodicTable: · How do I ensure that Z (in a slightly larger font) is perfectly left-aligned? · And that Ar is perfectly right-aligned? Since I am not very familiar with the package, suggestions for improvement of a general nature are welcome. My current approach: \documentclass[paper=a5]{scrarticle} \usepackage[margin=5mm, showframe=true, ]{geometry} \usepackage[en]{pgf-PeriodicTable} \begin{document} \pgfPTbuildcell(6,3)% [(1;1-2;Z), (1;2.5-3;Ar),% not sure but I set this (2-4;1-3;CS),(5-6;1-3;name) %,(4.75;1-3;radio)% do not know where to place best yet ] \pgfPTpreviewcell[1.8] \noindent\pgfPT[ % Common =========================== show title=false, show legend=false,% true does not work cell width=7.25mm, cell height=7.25mm, %back color scheme=Wikipedia, % Z =============================== Z font=\tiny\bfseries, Z backcolor=none, Z color=black, % Ar =============================== Ar font=\fontsize{4}{4}\selectfont, Ar precision=1, % names ============================ capitalize element names=true,% please! name font=\fontsize{3.5}{4}\selectfont, ] \end{document}
- Draw a cage for Cuyes using tikz [closed]by Robert on April 3, 2026 at 3:15 pm
I am a LaTeX newbie. Please, help me draw a cage to grow cuyes, with all the accesories. Thanks in advance.
- How to colorized any line drawed with draw (nor with plot expression)?by Mika Ike on April 1, 2026 at 1:44 pm
How to colorized any line drawed with draw (nor with plot expression)? \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ axis lines = middle, %title={Cor baseada no valor de $y$}, title={Color depending on $y$ coordinate}, colormap/hot % Podes usar 'hot', 'cool', 'jet', etc. ] \addplot[ mesh, % Divide o trazo en segmentos para aplicar cores thick, domain=-3:3, samples=100, point meta=y % Indica que a cor depende do valor de y ] {x^2}; % A función matemática \draw[thick, xshift=0.5,rounded corners] (-2,0.5) .. controls (0,-1) and (0,7) .. (1,7.8) .. controls (2,1) and (2,4) .. (3,3) node[anchor=east,pos=0.95] {How to colorize black line with colormap?} node[anchor=north east,pos=0.95] {depending on $y$ coordinate}; \end{axis} \end{tikzpicture} \end{document}
- 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.
- 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 is It possible to draw 2 merging spherical caps with tikz?by Waxler on February 15, 2024 at 2:34 pm
I am trying to reproduce a figure using only tikz. I have produced the figure using Inkscape but I am wondering if I can do it fully in Latex. This is the aimed figure : And with the help of some contributors here, I was able to reproduce the big lines of the figure by running this code : \documentclass{article} \usepackage{tikz} \usepackage{xcolor} \tikzset{hemisphere/.style={#1,shading=ball,ball color=#1,fill opacity=0.75}} \usepackage{tikz-3dplot} \tdplotsetmaincoords{60}{110} \usetikzlibrary{3d,perspective} \begin{document} \begin{figure}[h] \centering \begin{tikzpicture}[isometric view,rotate around z=-90,line cap=round,line join=round] % some dimensions \pgfmathsetmacro\r{1} % radius \pgfmathsetmacro\d{1.9} % distance between centers \pgfmathsetmacro\a{acos(\d/(2*\r)} % angle \pgfmathsetmacro\jr{sqrt(\r*\r-0.25*\d*\d)} % join radius % x-axis and centers \draw[canvas is xy plane at z=0,scale=1.5,fill=gray!7.5] (-\r,-\r) rectangle (\d+\r,\r); \draw[-latex] (0,0) -- (3.5*\r,0) node[right] {$x$}; \draw[dashed,-latex] (0,0) -- (0,2.5*\r) node[right] {$y$}; \draw[-latex] (0,0) -- (-2,2*\r)node[right] {$z$} {[canvas is yz plane at x=0]}; \foreach\i in {0,1} \fill (\i*\d,0) circle (0.2mm); % left hemisphere \draw[black,thin] (225:\r) arc (225:45:\r); \draw[hemisphere=blue,scale = 1] (225:\r) arc (225:360-\a:\r) {[canvas is yz plane at x=0.5*\d] arc (180:0:\jr)} arc (\a:45:\r) arc (0:180:\r cm); % right hemisphere \draw[black,thin] (\d,0) ++ (225:\r) arc (225:180+\a:\r) {[canvas is yz plane at x=0.5*\d] arc (180:0:\jr)} arc (180-\a:45:\r); \draw[hemisphere=green] (\d,0) ++ (225:\r) arc (225:405:\r) arc (0:180:\r cm); \draw[dashed,black,thin]{[canvas is yz plane at x=1.8] (0.05,0) ++ (180:0.95) arc (180:0:0.95)}; \draw[stealth-stealth,red,ultra thin] (1.9,0,0) -- (1.3,1.05,0.3)node[below right,pos = 0.5,scale = 0.3,red] {$a$} {[canvas is yz plane at x=1.8]}; \draw[stealth-stealth,red,ultra thin] (1,0,0) -- (1,0,0.35)node[below right,pos = 0.85,scale = 0.3,red] {$h_0$} {[canvas is yz plane at x=0.5*\d]}; \draw[-latex] (0,0,1.223*\r) -- (-2,2*\r) {[canvas is yz plane at x=0]}; \end{tikzpicture} \end{figure} \end{document} Which gives something like this : You can notice that is somehow similar but my question is : is it possible to draw something that is not fully spherical ? Much more like a spherical cap rather than a full semi-spherical shape ? I have tried to play with the position of the xy plane but I think the problem is with the package \tikzset{hemisphere} Any help/advice would be appreciated ! Thank you in advance, Best regards. UPDATE : I tried to follow the same procedure as the post suggested in the comments this post but didn't manage to do it correctly. I know that I have to get rid of the \draw[hemisphere..] and replace it with another line. My attempt is this but don't work at all : \documentclass{article} \usepackage{tikz} \usepackage{xcolor} \tikzset{hemisphere/.style={#1,shading=ball,ball color=#1,fill opacity=0.75}} \usepackage{tikz-3dplot} \tdplotsetmaincoords{60}{110} \usetikzlibrary{3d,perspective} \usetikzlibrary{shadings} \begin{document} \begin{figure}[h] \centering \begin{tikzpicture}[isometric view,rotate around z=-90,line cap=round,line join=round] % some dimensions \pgfmathsetmacro\r{1} % radius \pgfmathsetmacro\d{1.9} % distance between centers \pgfmathsetmacro\a{acos(\d/(2*\r)} % angle \pgfmathsetmacro\jr{sqrt(\r*\r-0.25*\d*\d)} % join radius % x-axis and centers \draw[canvas is xy plane at z=0,scale=1.5,fill=gray!7.5] (-\r,-\r) rectangle (\d+\r,\r); \draw[-latex] (0,0) -- (3.5*\r,0) node[right] {$x$}; \draw[dashed,-latex] (0,0) -- (0,2.5*\r) node[right] {$y$}; \draw[-latex] (0,0) -- (-2,2*\r)node[right] {$z$} {[canvas is yz plane at x=0]}; \foreach\i in {0,1} \fill (\i*\d,0) circle (0.2mm); % left hemisphere \draw[black,thin] (225:\r) arc (225:45:\r); \shade[ball color=green!50!blue] (0,0) ++ (225:\r) arc (225:0:\r) -- cycle; % right hemisphere \draw[black,thin] (\d,0) ++ (225:\r) arc (225:180+\a:\r) {[canvas is yz plane at x=0.5*\d] arc (180:0:\jr)} arc (180-\a:45:\r); \shade[ball color=green!50!blue] (\d+\r,0) arc (0:180:\r) -- cycle; \draw[dashed,black,thin]{[canvas is yz plane at x=1.8] (0.05,0) ++ (180:0.95) arc (180:0:0.95)}; \draw[stealth-stealth,red,ultra thin] (1.9,0,0) -- (1.3,1.05,0.3) node[below right,pos=0.5,scale=0.3,red] {$a$} {[canvas is yz plane at x=1.8]}; \draw[stealth-stealth,red,ultra thin] (1,0,0) -- (1,0,0.35) node[below right,pos=0.85,scale=0.3,red] {$h_0$} {[canvas is yz plane at x=0.5*\d]}; \draw[-latex] (0,0,1.223*\r) -- (-2,2*\r) {[canvas is yz plane at x=0]}; \end{tikzpicture} \end{figure} \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 make those lines in Tikz?by Mordecai on March 14, 2023 at 10:03 am
Here the lines: I have no idea how to make the little bump. If only it were straight lines 🙂 Colors are: green: #9DC634 orange: #F39614 pink: #F39614 purple: #AB7CB5 Thanks for your help
- 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}
- 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?