• Tikz snail's outline rotation text layout
    by mathrm alpha on June 14, 2026 at 2:31 am

    Although this was mentioned last time: TeX chinese image poetry image text layout However, it seems no one has mentioned the layout of the snail's rotating circle text in the TeX code. Source: https://jedi.nehs.hc.edu.tw/newsletter/306/poem.html I wrote a LaTeX program that rotates text, but the result isn't quite like this image; it's just a reference to the circle rotation text format. Furthermore, the "比羚羊還要快。" part is missing display. \documentclass{article} \usepackage{tikz,xeCJK} \usepackage[margin=0.5in]{geometry} \setCJKmainfont{Noto Sans CJK TC} \usetikzlibrary{decorations.text} \begin{document} \centering \begin{tikzpicture} % Define colors based on the image \definecolor{snailbody}{RGB}{240, 200, 180} \definecolor{shellbase}{RGB}{220, 170, 150} % Body and Tail \fill[snailbody] (-3.5, 0.5) .. controls (-4, -1) and (-3.5, -3.5) .. (0, -3.5) -- (6, -2.5) -- (0, -2.8) .. controls (-2, -2.8) and (-3, -1) .. (-3.5, 0.5); % Head \fill[snailbody] (-3.5, 0.5) circle (0.9); % Antennae \draw[snailbody, line width=4pt] (-3.9, 1.2) -- (-4.3, 2.6); \fill[snailbody] (-4.3, 2.7) circle (0.2); \draw[snailbody, line width=4pt] (-3.1, 1.2) -- (-2.9, 2.6); \fill[snailbody] (-2.9, 2.7) circle (0.2); % Shell (large circle) \fill[shellbase] (0.5, 0) circle (3.7); %text parts \path [ decorate, decoration={ text along path, text={背著重重的家,上山下海,尋找食物,我總比別人慢一步,我想如果我拋棄沉重的家,我一定爬得比羚羊還要快。}, text align=center } ] (0.5, 0) ++(180:4.0) arc (180:0:4.0); \end{tikzpicture} \end{document} Although there are similar: How to fine tune rotation of text along circular path? However, There was no mention of a text rotation format resembling a snail's outline.

  • How to change the thickness of the sides of the triangle? [closed]
    by Intuition on June 13, 2026 at 8:02 pm

    I want to draw the triangle in the following figure with sides a little thicker than the other sides please. Any help\hint on that?

  • Coil decoration on curved path looks strange
    by nogrodrigo on June 13, 2026 at 3:52 pm

    I am trying to achieve something like this in TikZ: The black path should go straight up and the red one should go down bent to the right, both must look like a coil. I have tried to do this using bezier curves and arcs, but the coil decoration of the bent path looks very strange, it's pointy in some parts. What am I doing wrong? MWE: \documentclass{article} \usepackage{xcolor} \usepackage{tikz} \usetikzlibrary{decorations.pathmorphing} \begin{document} \begin{tikzpicture} \draw[-latex, decorate, decoration = {coil, aspect = 1.2}, color = red] (0,2) arc (90:-90:1); \draw[-latex, decorate, decoration = {coil, aspect = 1.2}] (0,0) -- (0,2); \draw[-latex, decorate, decoration = {coil, aspect = 1.2}] (3,0) -- (3,2); \draw[-latex, decorate, decoration = {coil, aspect = 1.2}, color = red] (3,2) .. controls (4,2) and (4,0) .. (3,0); \end{tikzpicture} \end{document}

  • Tikz customize in big operators symbols, can't display big tikz operators
    by mathrm alpha on June 13, 2026 at 8:59 am

    I followed the LaTeX question reference below to adapt it to the tikz big operators version, but it didn't display in tikz "⅌" symbol. How can I define a big plus operator that works like \bigcup? ⅌ apply in tikz text symbols? % Source - https://tex.stackexchange.com/a/394912 % Posted by GuM, modified by community. See post 'Timeline' for change history % Retrieved 2026-06-13, License - CC BY-SA 3.0 \documentclass{article} \usepackage{tikz,iftex,amsmath} \usepackage{graphicx} \makeatletter \newcommand*\@bigper[1]{\vcenter{\hbox{#1$\m@th ⅌$}}} \newcommand*\bigper{% \DOTSB % omit this line if you are not using the amsmath package \mathop{% \mathchoice {\@bigper ⅌}% {\@bigper \LARGE}% {\@bigper {}}% {\@bigper \footnotesize}% }% \slimits@ % omit this line if you are not using the amsmath package } \makeatother \ifPDFTeX \usepackage[utf8]{inputenc} \else \usepackage{newunicodechar} \fi \DeclareRobustCommand{\TikZPerSign}{% \tikz[ baseline=-.25ex, x=.13em, y=.13em, line cap=round, line join=round ]{% % Fixed box: this is important for text-like behaviour. \path[use as bounding box] (-3.05,-3.35) rectangle (3.95,4.35); % 1. The horizontal ellipse \draw[line width=.05em] (0.4,0) ellipse[x radius=2.2,y radius=.7]; % 2. The main U shape \draw[line width=.05em] (-.6,1.5) .. controls (-.6,-3.2) and (.6,-3.2) .. (.6,1.5); % 3. The top-left flourish \draw[line width=.05em] (-.6,1.5) .. controls (-1.8,2.8) and (-3.0,1.5) .. (-2.2,1.2); \fill (-.5,1.9) circle[radius=.22]; % 4. The large right loop \draw[line width=.05em] (.6,1.5) .. controls (.6,4.2) and (3.5,3.2) .. (3.5,.5) .. controls (3.5,-.8) and (2.5,-1.2) .. (1.8,-1.0); }% } \ifPDFTeX \DeclareUnicodeCharacter{214C}{\TikZPerSign} \else \newunicodechar{⅌}{\TikZPerSign} \fi \begin{document} $$\sum^1_2 \bigper^3_4$$ \end{document}

  • TeX chinese image poetry image text layout
    by mathrm alpha on June 12, 2026 at 4:06 am

    Someone helped me figure out how to create LaTeX Chinese image poetry, The vertical CJK text was not arranged according to the size of the shape. Source: https://jedi.nehs.hc.edu.tw/newsletter/306/poem.html LaTeX code I've tried with tikz text typesetting: \documentclass{article} \usepackage{tikz} \usepackage[margin=0.5in]{geometry} \usepackage{xeCJK} \definecolor{carcolor}{RGB}{242, 186, 166} \begin{document} \centering \begin{tikzpicture} % Wheels (車輪) \fill[carcolor, rounded corners=6pt] (1.8, 0.7) rectangle (2.6, 1.5); \fill[carcolor, rounded corners=6pt] (3.4, 0.7) rectangle (4.2, 1.5); % Main body of the car (主車身) \fill[carcolor, rounded corners=10pt] (0, 1) rectangle (6, 2.3); % Top cabin part (車頂) \fill[carcolor, rounded corners=12pt] (1.6, 2.2) rectangle (4.4, 3.6); \linespread{0.8}\selectfont \scriptsize % 第 1 行:叭叭(最右側,車身內) \node[text width=0.35cm, align=center] at (5.2, 1.65) {叭\\叭}; % 第 2 行:我是(車身內) \node[text width=0.35cm, align=center] at (4.8, 1.65) {我\\是}; % 第 3 行:一輛車(進入車頂邊緣) \node[text width=0.35cm, align=center] at (4.3, 1.9) {一\\輛\\車}; % 第 4 行:我可以載人(深入車頂) \node[text width=0.35cm, align=center] at (3.8, 2.3) {我\\可\\以\\載\\人}; % 第 5 行:也可以載貨物(深入車頂) \node[text width=0.35cm, align=center] at (3.3, 2.45) {也\\可\\以\\載\\貨\\物}; % 第 6 行:雖然身不大(深入車頂) \node[text width=0.35cm, align=center] at (2.8, 2.45) {雖\\然\\身\\不\\大}; % 第 7 行:卻是大力士(深入車頂) \node[text width=0.35cm, align=center] at (2.3, 2.45) {卻\\是\\大\\力\\士}; % 第 8 行:不管是跑車(進入車頂邊緣) \node[text width=0.35cm, align=center] at (1.8, 2.3) {不\\管\\是\\跑\\車}; % 第 9 行:客車或是貨車(字數多,稍微往下靠在車身與車頂間) \node[text width=0.35cm, align=center] at (1.3, 1.9) {客\\車\\或\\是\\貨\\車}; % 第 10 行:全都是(左側,車身內) \node[text width=0.35cm, align=center] at (0.8, 1.65) {全\\都\\是}; % 第 11 行:神奇 車!(最左側,車身內) \node[text width=0.35cm, align=center] at (0.4, 1.65) {神\\奇\\車\\!}; \end{tikzpicture} \end{document} I only realized how strange the text position and height were when I used it. Advanced Extension: Tikz snail's outline rotation text layout

  • How do I draw the feedback loop in my latex code for my research paper?
    by Sajid Mahfuz on June 11, 2026 at 10:21 pm

    How do I create the feedback loop shown in the image? I’ve also been trying to make all the arrow lengths uniform, but I keep failing (bear with me, I’m a beginner in LaTeX), and I need the diagram to be larger. I’ve attached my code and the image. \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows.meta, positioning, calc} \begin{document} \begin{center} \begin{tikzpicture}[ node distance=1.2cm and 1.2cm, block/.style={ draw, rectangle, minimum width=2.5cm, minimum height=0.9cm, line width=1pt, align=center }, innerblock/.style={ draw, rectangle, minimum width=1.8cm, minimum height=0.9cm, line width=1pt, % changed from 0.5pt to 1pt align=center }, disturbance/.style={ draw, rectangle, minimum width=1.8cm, minimum height=0.9cm, fill=red!10, line width=1pt, align=center }, arrow/.style={-{Triangle[length=2mm,width=2mm]}, line width=1pt} ] % ================= INPUT ================= \node[circle, draw, minimum size=0.8cm, line width=1pt] (sum) at (0,0) {}; % changed to 1pt % X inside circle (also 1pt) \draw[line width=1pt] (sum.north east) -- (sum.south west); \draw[line width=1pt] (sum.north west) -- (sum.south east); \draw[arrow] (-1.2,0) -- (sum.west); \node[left=1.2cm] {$Z_D$}; % ================= CONTROL ================= \node[block, above right=0.5cm and 1.0cm of sum] (sdre) {SDRE}; \node[block, below right=0.5cm and 1.0cm of sum] (pi) {PI}; \draw[arrow] (sum.east) -- ++(0.2,0) |- (sdre.west); \draw[arrow] (sum.east) -- ++(0.2,0) |- (pi.west); % ================= ACTUATION ================= \node[block, right=1.0cm of sdre] (actuator) {Actuator}; \node[block, right=1.0cm of pi] (thrust) {Thrust}; \draw[arrow] (sdre.east) -- (actuator.west); \draw[arrow] (pi.east) -- (thrust.west); % ================= THRUST MAP ================= \node[block, below=0.8cm of pi] (thrustMap) {Thrust Map}; \draw[arrow] (pi.south) -- (thrustMap.north); \draw[arrow] (thrustMap.east) -| (thrust.south); % ================= DYNAMICS ================= \node[innerblock, right=1.0cm of actuator] (att_dyn) {Attitude Dynamics}; \node[innerblock, right=1.0cm of thrust] (alt_dyn) {Altitude Dynamics}; \draw[arrow] (actuator.east) -- (att_dyn.west); \draw[arrow] (thrust.east) -- (alt_dyn.west); % ================= DISTURBANCES ================= \node[disturbance, above=0.6cm of att_dyn] (distAtt) {Gust}; \node[disturbance, below=0.6cm of alt_dyn] (distAlt) {Gust}; \draw[arrow] (distAtt.south) -- (att_dyn.north); \draw[arrow] (distAlt.north) -- (alt_dyn.south); % ================= OUTPUT MERGE ================= \coordinate (mergeTop) at ($(att_dyn.east)+(0.6,0)$); \coordinate (mergeBottom) at ($(alt_dyn.east)+(0.6,0)$); \draw[line width=1pt] (att_dyn.east) -- (mergeTop); \draw[line width=1pt] (alt_dyn.east) -- (mergeBottom); \draw[line width=1pt] (mergeTop) -- (mergeBottom); % Midpoint of the vertical line \coordinate (mergeMid) at ($(mergeTop)!0.5!(mergeBottom)$); % Output arrow from that midpoint \draw[arrow] (mergeMid) -- ++(0.8,0) node[right] {Output}; \end{tikzpicture} \end{center} \end{document}

  • Two overlapping circles with lens effect between two colored rectangles in TikZ
    by Morace Elegbele on June 11, 2026 at 3:43 pm

    I am trying to reproduce the following header style for exercises in a LaTeX document using TikZ. The header consists of two rectangles side by side: A blue rectangle on the left with rounded corners An orange rectangle on the right with rounded corners Each rectangle has a circle on its inner edge (right edge of the blue one, left edge of the orange one). The two circles overlap and their intersection should appear as a white lens-shaped area (vesica piscis effect), as if the circles were drawn on top of the rectangles and cut through both. The exercise number is placed inside the blue circle area, and the word "Exercice" appears in the orange rectangle. I tried using even odd rule and \clip with \begin{scope} but I cannot get the intersection to look clean — either one circle hides the other, or the background rectangle shows through. Here is my current code: [coller votre code ici] And here is the image I want to reproduce: [joindre l'image] How can I achieve this effect cleanly in TikZ? My code: \documentclass[a4paper,12pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{tikz} \usepackage{xcolor} \definecolor{bleuFonce}{RGB}{30,100,180} \definecolor{orangeTitre}{RGB}{255,140,0} \newcounter{numexo} \newcommand{\titreExercice}{% \stepcounter{numexo}% \begin{tikzpicture} % Rectangle bleu avec bords arrondis \fill[bleuFonce, rounded corners=8pt] (0,0) rectangle (4.5,0.7); % Grand cercle bleu débordant à gauche \fill[bleuFonce,even odd rule] (2.3,0.35) circle(0.42); % Cercle blanc intérieur gauche \fill[white] (2.3,0.35) circle (0.28); % Rectangle orange avec bords arrondis (par dessus à droite) \fill[orangeTitre, rounded corners=8pt] (2.8,0) rectangle (5.8,0.7); % Grand cercle orange débordant à gauche du rectangle orange \fill[orangeTitre,even odd rule] (2.8,0.35) circle (0.42); % Cercle blanc intérieur droit \fill[white] (2.8,0.35) circle (0.28); % Numéro dans le cercle blanc gauche \node[bleuFonce, font=\large\bfseries] at (0.1,0.35) {\thenumexo}; % Texte "Exercice" en blanc \node[white, font=\large\bfseries] at (4.5,0.35) {Exercice}; \end{tikzpicture}% } \begin{document} \titreExercice \bigskip \titreExercice \end{document}

  • Drawing tikz five line style arrows in text display
    by mathrm alpha on June 11, 2026 at 12:15 pm

    Although a five-line arrow was unearthed, but: This is simply a very long, cramped five-line tikz arrows result, not the size of the blue arrow in the image. Furthermore, none of the arrows in the @Explorer answer (in the image) scaled down to the the same text size. This is example diagram text in: A \LLleftarrow B \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{nfold} \begin{document} \begin{tikzpicture} \draw[double equal sign distance, nfold=5, arrows=-Implies] (0,-0.7) -- (3,-0.7); \end{tikzpicture} \end{document} References: Drawing a quadruple arrow

  • tikz: absolute coordinates of a node placed in a second node positioned relative to a third node
    by pluton on June 10, 2026 at 4:18 pm

    A MWE is probably better than lengthy explanations: \documentclass[tikz,10pt]{standalone} \usetikzlibrary{positioning} % savedbox with a sketch \newsavebox{\sdbox} \sbox{\sdbox}{% \begin{tikzpicture}[scale=0.35] \node (rbox) [fill=red] at (1,0) {}; \node (bbox) [fill=blue] at (1,1) {}; \end{tikzpicture}% } \begin{document} \begin{tikzpicture}[scale=0.5,font=\small] % blocks \node (comp) {computer}; \node[right = 1cm of comp] (sb) {\usebox{\sdbox}}; % arrow \draw[->] (rbox) -- (comp); \end{tikzpicture} \end{document} Upon compilation, you'll notice that the arrow does not link the node (rbox) from its absolute position after the node (sb) is drawn, as it should go from the red rectangle to the computer box. Would it be possible to achieve that goal?

  • How to tweak the bounding box of `overarrows`? [duplicate]
    by Explorer on June 10, 2026 at 10:00 am

    This post comes from my previous solution, then I simplified them: \documentclass{article} \usepackage{showframe} \usepackage[tikz]{overarrows} \usetikzlibrary{decorations.markings} \NewOverArrowCommand[tikz]{\underarrowA}{% add tikz options={line cap=round,decoration={markings,mark=at position 0.5 with {\draw[-](-1pt,-1pt)--(1pt,1pt);\draw[-](-1pt,1pt)--(1pt,-1pt);}}}, add path options={postaction={decorate}}, arrows={->[scale=0.5]}, path = {(0,0) -- (1,0)}, center arrow, arrow under, min length=15, space after arrow=0.4ex, } \NewOverArrowCommand[tikz]{\underarrowC}{% path options={arrows={<[scale=0.5]->[scale=0.5]}},% path={% (0,0) -- (0.5,0) to[loop below,in=-45,out=225,min distance=4mm,every loop/.style={}] (0.5,0) -- (1,0) }, center arrow, arrow under, min length=15, space after arrow=0.4ex, } \setlength{\parindent}{0pt} \setlength{\fboxsep}{0pt} \usepackage{lipsum} \begin{document} $\underarrowA{v} \qquad \underarrowA{vvv} \qquad \underarrowA{ABCD} $ $\underarrowC{v} \qquad \underarrowC{vvv} \qquad \underarrowC{ABCD} $ \fbox{$A\underarrowA{v}B$} \fbox{$A\underarrowC{v}B$} \bigskip \end{document} We could see from the above that the bounding box of arrowC is larger than expected. I wonder whether there are good suggesion to refine this?

  • PGFPlots / TikZ: Filtering data from a file when the x-axis contains string values
    by joseldsm on June 10, 2026 at 9:57 am

    I am generating a plot in PGFPlots/TikZ where the x-axis contains string values and the y-axis contains numerical data. The data is imported from a CSV file, and everything works correctly so far. However, when I use skip coordinates between index, the filtering is applied to the y-values and not to the x-axis categories. In this case, I want to draw only the data with the string value B. Is there a way to correctly apply this filtering to both x-axis ? Thanks! Here is the MWE. Keep in mind that in my case the data are extract from csv file. \documentclass{article} \usepackage{pgfplots} \usepackage{pgfplotstable} \pgfplotsset{compat=1.18} \pgfplotstableread{ String Value A 0 A 6 A 4 B 9 B 5 B 1 B 3 B 7 C 4 C 7 C 9 C 3 }\data \begin{document} \begin{tikzpicture} \begin{axis}[ ybar, ymin=0, xtick=data, xticklabels from table={\data}{String}, nodes near coords ] \addplot table[ x expr=\coordindex, y={Value}, skip coords between index={0}{3}, skip coords between index={8}{100} ]{\data}; \end{axis} \end{tikzpicture} \end{document}

  • Make a special integral symbols in tikz
    by mathrm alpha on June 10, 2026 at 8:34 am

    Although you can draw \int extended parts "\qsymb" in Tikz, it doesn't fit when zoomed in with math-mode. \documentclass{article} \usepackage{tikz} \usepackage{graphicx} \usepackage{amsmath} \usepackage[margin=0.5in]{geometry} \newcommand{\qsymb}{% \mathbin{ \vcenter{\hbox{ \scalebox{0.075}{ \begin{tikzpicture}[line width=2.5pt, line cap=round, line join=round, yscale=0.6] \draw (0.2, 2.4) -- (2.7, 3.9) -- (4.7, 2.9) -- (2.2, 1.4) -- cycle; \draw (2.2, 1.4) -- (4.2, 0.4) -- (1.7, -0.6) -- (-0.3, 0.4) -- cycle; \end{tikzpicture}% }% }}% }% } \newcommand{\qint}{\int\!\!\!\!\!\!\!\!\qsymb} \newcommand{\qiint}{\iint\!\!\!\!\!\!\!\!\!\!\qsymb} \begin{document} $A \qint B \qiint C$\\ $$A \qint B \qiint C$$ \end{document}

  • ⅌ apply in tikz text symbols?
    by mathrm alpha on June 8, 2026 at 11:58 am

    The original drawing instructions in ⅌: \documentclass{article} \usepackage{tikz} \usepackage[margin=0.5in]{geometry} \begin{document} \centering \begin{tikzpicture}[scale=2] % The stylized symbol is a calligraphic character, likely a script 'P' or 'V' with an ellipse. % We recreate it using thick paths and curves. % 1. The horizontal ellipse \draw[line width=6pt] (0.4, 0) ellipse (2.2 and 0.7); % 2. The main "U" shape (the stems) % Left stem starts from the flourish, goes down, curves at the bottom, and goes up to form the right stem. \draw[line width=14pt, line cap=round] (-0.6, 1.5) .. controls (-0.6, -3.2) and (0.6, -3.2) .. (0.6, 1.5); % 3. The flourish on the top left % A decorative hook and a small "bud" on top of the left stem. \draw[line width=14pt, line cap=round] (-0.6, 1.5) .. controls (-1.8, 2.8) and (-3.0, 1.5) .. (-2.2, 1.2); \fill (-0.5, 1.9) circle (0.25); % 4. The large loop on the right (completing the 'P' shape) % It starts from the top of the right stem, loops over to the right, and curves back down. \draw[line width=14pt, line cap=round] (0.6, 1.5) .. controls (0.6, 4.2) and (3.5, 3.2) .. (3.5, 0.5) .. controls (3.5, -0.8) and (2.5, -1.2) .. (1.8, -1.0); \end{tikzpicture} \end{document} However, after reading his/her command usage, This convert to can typed ⅌ text symbols method doesn't seem to work for multiple overlapping shapes in tikz (or maybe I just don't know how to use it). Is there better method to declare tikz picture with proper baseline and fontsize?

  • Improved visualization of the domains of integration in ℝ³
    by Sebastiano on April 24, 2026 at 9:26 pm

    Before of this question, I would like to thank the authors of the answers and everyone who appreciated my question. I had previously created these two figures related to two triple integrals. Is there a better way to improve their presentation and make them clearer and more visually appealing? T={(x, y, z) ∈ ℝ³: (x²+y²)¹/² ≤ z ≤ 1} \documentclass[12pt]{article} \usepackage{tikz,tikz-3dplot} \begin{document} \begin{center} \tdplotsetmaincoords{60}{130} \begin{tikzpicture}[tdplot_main_coords,scale=3] \pgfmathsetmacro{\h}{0.6} \pgfmathsetmacro{\raggio}{\h} \draw[thick,->] (0,0,0) -- (1.5,0,0) node [below left] {\footnotesize$x$}; \draw[dashed] (0,0,0) -- (-1.5,0,0); \draw[thick,->] (0,0,0) -- (0,1.5,0) node [right] {\footnotesize$y$}; \draw[dashed] (0,0,0) -- (0,-1.5,0); \draw[thick,->] (0,0,1.0) -- (0,0,1.5) node [above] {\footnotesize$z$}; \draw[dashed] (0,0,0) -- (0,0,1.0); \foreach \altura in {0.01,0.02,...,1.0}{ \draw[cyan,opacity=0.5] plot[domain=0:2*pi,smooth,variable=\t] ({\altura*cos(\t r)},{\altura*sin(\t r)},{\altura}); } \draw[blue,thick,fill=brown!50,opacity=0.6] plot[domain=0:2*pi,smooth,variable=\t] ({\raggio*cos(\t r)},{\raggio*sin(\t r)},{\h}); \draw[dashed,fill=yellow,opacity=0.4] plot[domain=0:2*pi,smooth,variable=\t] ({\raggio*cos(\t r)},{\raggio*sin(\t r)},0); \foreach \t in {0,10,30,60,90,120,150,250,280,310}{ \draw[black,dashed,thin,opacity=0.7] ({\raggio*cos(\t)},{\raggio*sin(\t)},{\h}) -- ({\raggio*cos(\t)},{\raggio*sin(\t)},0); } \fill[gray,opacity=0.1] (-1.2,-1.2,\h) -- (1.2,-1.2,\h) -- (1.2,1.2,\h) -- (-1.2,1.2,\h) -- cycle; \draw[red,very thick] (0,0,\h) -- (0,\raggio,\h); \node at (0,1.5,\h) {\small $z=h$}; \node at (0,0.5,0.75) {\small $z$}; \node at (0,0.25,-0.35) {\small $T(z=0)$}; \node at (0,.75,1.3) {\small $T(z=h)=T(z)$}; \end{tikzpicture} \end{center} \end{document} C= {(x,y,z)∈ ℝ³: z∈ [0, 2], x²+ y²≤ z} \documentclass[12pt]{article} \usepackage{tikz,tikz-3dplot} \begin{document} \begin{center} \tdplotsetmaincoords{70}{130} \begin{tikzpicture}[tdplot_main_coords,scale=2.5] \pgfmathsetmacro{\h}{.6} \pgfmathsetmacro{\raggio}{sqrt(\h)} \draw[thick,->] (0,0,0) -- (1.5,0,0) node [below left] {$x$}; \draw[thick,->] (0,0,0) -- (0,1.5,0) node [right] {$y$}; \draw[thick,->] (0,0,0) -- (0,0,1.5) node [above] {$z$}; \draw[red,very thick] plot[domain=-1:1,smooth,variable=\t] (0,{\t},{\t*\t}); \draw[blue,fill=yellow,opacity=0.4] plot[domain=0:2*pi,smooth,variable=\t] ({\raggio*cos(\t r)},{\raggio*sin(\t r)},{\h}); \draw[fill=yellow,dashed,opacity=0.5] plot[domain=0:2*pi,smooth,variable=\t] ({\raggio*cos(\t r)},{\raggio*sin(\t r)},{0}) node [above] {\tiny $C(z)$}; \foreach \t in {0,10,...,350}{ \draw[gray, dashed, thin,opacity=0.4] ({\raggio*cos(\t)},{\raggio*sin(\t)},{\h}) -- ({\raggio*cos(\t)},{\raggio*sin(\t)},0); } \foreach \altura in {0.0125,0.025,...,1.0}{ \pgfmathsetmacro{\radio}{sqrt(\altura)} \draw[cyan,thick,opacity=0.5] plot[domain=0:2*pi,smooth,variable=\t] ({\radio*cos(\t r)},{\radio*sin(\t r)},{\altura}); } \fill[orange!30,opacity=0.4] (-1,-1,\h) -- (1,-1,\h) -- (1,1,\h) -- (-1,1,\h) -- cycle; \draw[blue,very thick] (0,0,\h) -- (0,{\raggio},\h); \node[black, above right] at (0,{\raggio/2},\h) {\tiny $\sqrt{z}$}; \draw[blue,fill=yellow,dotted,thick,opacity=0.4] plot[domain=0:360,smooth,variable=\t] ({\raggio*cos(\t)},{\raggio*sin(\t)},{\h}); \draw[blue!80,thick] plot[domain=0:2*pi,smooth,variable=\t] ({cos(\t r)},{sin(\t r)},{1.0}); \end{tikzpicture} \end{center} \end{document}

  • How to recreate a DuPont scheme
    by Dorian on November 22, 2025 at 1:30 pm

    I'd like to recreate a DuPont scheme as the image below. I’m not necessarily asking for the exact code used to recreate the graphic, but rather for the packages and commands that would allow me to do it myself. Is there anything more “accessible” than TikZ? Thank you in advance 😉

  • How to connect nodes in a flowchart
    by Fatma Belabed on January 31, 2025 at 11:56 am

    I wanted to draw this flowchart, but I couldn't connect the nodes correctly. this is my code: \tikzset{ arr/.style={thick,-stealth}} %%%%%%%%%%%%%%%%%%%%%%%% \usetikzlibrary{ arrows.meta, shapes, positioning, calc, decorations.markings} \tikzset{ block2/.style={ rectangle, draw, fill=white, rounded corners, text centered, text width = 14em, minimum height = 2em}, line/.style={draw, -Latex}} %%%%%%%%%%%%%%%%%%%%%%% \tikzset{ block/.style={ rectangle, draw, fill=blue!10, rounded corners, text centered, text width = 9em, minimum height = 2em}, line/.style={draw, -Latex}} \tikzset{ blockxx/.style={ rectangle, draw, fill=blue!10, text centered, text width = 9em, minimum height = 2em}, line/.style={draw, -Latex}} \tikzset{ blockx/.style={ rectangle, draw, fill=blue!10, rounded corners, text centered, text width = 6em, minimum height = 2em}, line/.style={draw, -Latex}} \tikzset{ block3/.style={ rectangle, draw, fill=blue!20, rounded corners, text centered, text width = 9em, minimum height = 2em}, line/.style={draw, -Latex}} \tikzset{ block4/.style={ rectangle, draw, fill=blue!50, rounded corners, text centered, text width = 9em, minimum height = 2em}, line/.style={draw, -Latex}} \tikzset{ block44/.style={ rectangle, draw, fill=blue!50, rounded corners, text centered, text width = 3em, minimum height = 2em}, line/.style={draw, -Latex}} \tikzset{ block444/.style={ rectangle, draw, fill=blue!50, rounded corners, text centered, text width = 8em, minimum height = 2em}, line/.style={draw, -Latex}} \begin{document} \begin{tikzpicture}[every node/.style={block}] \node [ block2, node distance=2cm] (second) {Security attacks}; \node[block3, below left=1cm and 1cm of second](case one) {Physical}; \node[block4, below = 1cm of second](case two) {Data Link}; \node[below right = 1cm and 1cm of second](case three) {Network}; \node[below right = 1cm and 5.5cm of second](case forr) {Transport}; \node[block3, below = 0.7cm of case forr](case forr1){Dos}; \node[block3, below = 0.7cm of case forr1](case forr2){Session hijacking}; \node[block3, below = 0.7cm of case forr2](case forr3){Exhaustion}; \node[below right = 1cm and 10cm of second](case five) {Application}; \node[block3, below = 0.7cm of case five](case five1){Dos}; \node[block3, below = 0.7cm of case five1](case five2){Repudiation}; \node[block3, below = 0.7cm of case five2](case five3){Deluge}; \node[block3, below = 0.7cm of case one](no info){Dos}; \node[block3, below = 0.7cm of no info](no info1){Eavesdropping}; \node[block3, below = 0.7cm of no info1](no info2){Jamming}; \node[block444, on grid,below = 1.7cm of case two](aa){Dos}; \node[block444, on grid, below = 1.5cm of aa](aa1){Collision}; \node[block444, on grid,below = 1.5cm of aa1](aa2){Unfairness}; \node[block444, on grid,below = 1.5cm of aa2](aa3){Exhaustion}; \node[block444, on grid,below = 1.5cm of aa3](aa4){Traffic monitoring}; \node[blockxx, on grid,below = 1.5cm of case three](a){Dos}; \node[blockxx, on grid,below = 1.5cm of a](a1){Hole}; \node[blockxx, on grid,below = 1.5cm of a1](a2){Selective forwarding}; \node[blockxx, on grid,below = 1.5cm of a2](a3){Sybil}; \node[blockxx, on grid,below = 1.5cm of a3](a4){Eavesdropping}; \node[blockxx, on grid,below = 1.5cm of a4](a5){Spoofing}; \node[blockxx, on grid,below = 1.5cm of a5](a6){Traffic analysis}; \draw[arr] (second.south) --++ (0,-5pt) -| (case one); % physique \draw[arr] (case one.west) --++ (0,-5pt) -- (no info.west); \draw[arr] (case one.west) --++ (0,-5pt) -- (no info1.west); \draw[arr] (case one.west) --++ (0,-5pt) -- (no info2.west); \draw[arr] (second.south) --++ (0,-5pt) -| (case two); % data \draw[arr] (case two.west) --++ (0,-5pt) |- (aa.west); \draw[arr] (case two.west) --++ (0,-5pt) |- (aa1.west); \draw[arr] (case two.west) --++ (0,-5pt) |- (aa2.west); \draw[arr] (case two.west) --++ (0,-5pt) |- (aa3.west); \draw[arr] (case two.west) --++ (0,-5pt) |- (aa4.west); \draw[arr] (second.south) --++ (0,-5pt) -| (case three); % network \draw[arr] (case three.west) --++ (0,-5pt) |- (a.west); \draw[arr] (case three.west) --++ (0,-5pt) |- (a1.west); \draw[arr] (case three.west) --++ (0,-5pt) |- (a2.west); \draw[arr] (case three.west) --++ (0,-5pt) |- (a3.west); \draw[arr] (case three.west) --++ (0,-5pt) |- (a4.west); \draw[arr] (case three.west) --++ (0,-5pt) |- (a5.west); \draw[arr] (case three.west) --++ (0,-5pt) |- (a6.west); \draw[arr] (second.south) --++ (0,-5pt) -| (case forr); % Transport \draw[arr] (case forr.west) --++ (0,-5pt) |- (case forr1.west); \draw[arr] (case forr.west) --++ (0,-5pt) |- (case forr2.west); \draw[arr] (case forr.west) --++ (0,-5pt) |- (case forr3.west); \draw[arr] (second.south) --++ (0,-5pt) -| (case five); % Application \draw[arr] (case five.west) --++ (0,-5pt) |- (case five1.west); \draw[arr] (case five.west) --++ (0,-5pt) |- (case five2.west); \draw[arr] (case five.west) --++ (0,-5pt) |- (case five3.west); \end{tikzpicture} \end{figure} \end{document} Thanks

  • Interesting weird TikZ behaviour
    by vishalpaudel on September 4, 2023 at 7:30 am

    I was trying to draw a grid of points with the weights of the points as the average of x and y: \usepackage{tikz} ... \begin{center} \begin{tikzpicture} \foreach \x in {1,2,3,4,5,6} { \foreach \y in {1,2,3,4,5,6} { \fill (\x, \y) circle ({(\x + \y)/2}); } } \end{tikzpicture} \end{center} ... The output is unexpected(Screenshot attached)! Does anyone know what is happening? I am using Lualatex on overleaf. edit 1: Solved the original problem: but need an explanation of the earlier behaviour.

  • types of systems of linear equations and intersection of planes, with tikz
    by Juan Leal on July 22, 2023 at 2:57 pm

    Is there a simple way using tikz to graph a plane from its equation (like those of the systems on the right side, e.g. 2x +3y -z = 11), and that allows me to represent the intersection of two or three of them (even four)? If possible, I additionally need it to allow me to have flat colors in each of the planes involved and not to be represented by pieces as suggested by some of the solutions I have seen. I want to represent graphically to my students all the possibilities that can be presented with a system of linear equations with three unknowns, in a way similar to the one in the image I include. I have been reading the material related to this topic for three days and I have not found a completely satisfactory solution (or maybe there is one, but I have not appreciated it properly). I know a bit about tikz, pgfplots and tikz-3dplot (and I come from the old school of pstricks).

  • Tikz in caption leads to error even with \protect [duplicate]
    by aiquita on January 27, 2022 at 4:35 pm

    According to Adding tikz figure in caption it suffices to add protect to make my program compile. Indeed, it compiles after adding the command, but TeX still throws an error message that the control sequence is undefined. What portion of the command definition of \circled leads to the problem? \documentclass[twoside,runningheads, oribibl, draft]{llncs} \usepackage{graphicx} \usepackage{tikz} \newcommand*\circled[1]{% \protect\tikz[baseline=(char.base)]{% \node[shape=circle, draw, inner sep=1.5pt, font=\small] (char) {#1}; }} \begin{document} \begin{figure}[h] Hello World \caption{Derivation of premise \circled{2}} \end{figure} \end{document}

  • How do I draw an anticlepsydra in LaTeX?
    by Cora Sanroman on August 25, 2021 at 12:48 am

    I'd like to approach the sphere's volume by Cavalieri's principle, and so I want to give the students an anticlepsydra's drawing, to guide them to the sphere's formula. Something like this: The sphere I got right, but the area of the anticlepsydra that's equal to the sphere I'd like to be in a different color, and I don't quite know how to do it. Don't even know if it's best for me to use a 3d drawing or stick with 2d. Sugestions? Anyone's done that?

  • How to plot the 3D graph of the following three inequalities in latex (e.g., tikz/pgf)?
    by learner on July 9, 2021 at 9:27 am

    How to plot the 3D graph of the following three inequalities in latex (tikz/pgf) ? z <= x+y+1, z <= 4x, z <= 5y. My attempt: \documentclass[12pt,leqno]{amsart} \usepackage{pgfplots} \usepackage{tikz} \begin{document} \begin{tikzpicture} \begin{axis} \addplot3 [ domain=-5:20, domain y = -3:10, samples = 20, samples y = 8, surf] {x+y+1}; \addplot3[domain=-5:20, domain y = -3:10, samples = 20, samples y = 8, surf, opacity=0.25]{4*x}; \addplot3[domain=-5:20, domain y = -3:10, samples = 20, samples y = 8, surf, opacity=0.25]{5*y}; \end{axis} \end{tikzpicture} \end{document} The above Latex code produces the above figure: But the above graph is not clear, the intersecting line of the three half-planes are not clear. Any help to draw clear image with clear intersection. Any help both with the 3D graph of the given 3 inequalities. Thanks Edit: The 2D projection of the above 3 inequalities becomes: and this is justified by the answer of @Juan Castaño.

  • How to put dashed lines between certain columns?
    by pixel on April 29, 2021 at 10:24 pm

    I have a table in beamer frame and I want to put dashed lines between some columns. However, I have certain constraints. First, I want to make sure that the lines are disabled after certain transition, so they should work with visible for example. Next, I want to be able to write a text at the top or bottom of the dashed line. I tried to use the arydshln package, but it doesn't seem to offer the flexibility I need. \documentclass[aspectratio=169,xcolor=dvipsnames]{beamer} \usepackage{arydshln} \begin{document} \begin{frame}{Test} \begin{figure} \def\arraystretch{1.2} %\setlength{\tabcolsep}{0.2em} \begin{tabular}{ c : c c c : c } $e$ & $e+1$ & $e+2$ & $e+3$ & $e+4$ \\ \hline $k_{e}$ & $k_{e+1}$ & $k_{e+2}$ & $k_{e+3}$ & $k_{e+4}$ \\ $\Delta_{e}$ & $\Delta_{e+1}$ & $\Delta_{e+2}$ & $\Delta_{e+3}$ & $\Delta_{e+4}$\\ $\sigma_{e}$ & $\sigma_{e+1}$ & $\sigma_{e+2}$ & $\sigma_{e+3}$ & $\sigma_{e+4}$ \\ \end{tabular} \end{figure} \end{frame} \end{document} More precisely, I want to achieve what's shown below. Any ideas how to do that using table or TikZ?

  • Drawing a circle graph with TIKZ with foreach placement and paths, yet the inbound for edges is off
    by Tenaka on December 1, 2020 at 5:01 pm

    I want to draw a circle using TIKZ and instead of manually placing the nodes and connecting the nodes I wanted to use loops as any sane person would. Now when I wrote these, the incoming edge seems to be going to some point slightly of the node instead of to its core. In the example, I included a version with the path manually written out. I am losing my sanity here 😀 Anyone got any idea as to what is happening here? Any style critique is also very welcome! \documentclass[margin=10pt]{standalone} \usepackage{tikz} \usetikzlibrary{automata} \begin{document} \begin{tikzpicture}[nodes=state] \def \number {8} \def \radius {2cm} \def \degree {360/\number} \foreach \s in {1,...,\number} { \node at ({\degree * (\s -1)}:\radius) (\s) {$u_\s$}; } \foreach \s in {1,...,\number} { \pgfmathsetmacro\result{Mod( (\s), \number)+1} \path (\s) edge[bend right = 15] (\result); } \end{tikzpicture} \begin{tikzpicture}[nodes=state] \def \number {8} \def \radius {2cm} \def \degree {360/\number} \foreach \s in {1,...,\number} { \node at ({\degree * (\s -1)}:\radius) (\s) {$u_\s$}; } \path (1) edge[bend right = 15] (2) % edge (5) (2) edge[bend right = 15] (3) % edge (6) (3) edge[bend right = 15] (4) % edge (7) (4) edge[bend right = 15] (5) % edge (8) (5) edge[bend right = 15] (6) (6) edge[bend right = 15] (7) (7) edge[bend right = 15] (8) (8) edge[bend right = 15] (1) ; \end{tikzpicture} \end{document}

  • Matrix of bar charts
    by Jitendra on April 16, 2018 at 7:09 am

    I came across a post (https://peltiertech.com/stacked-bar-chart-alternatives/). I would like to draw a chart similar to last on mentioned in the post. The image of the chart is attached. Any help would be appreciated.

  • Pie chart size from Bordaigorl
    by Laura K on April 27, 2017 at 7:10 pm

    I have been using this great pie chart code: How to draw Bar & Pie Chart The code is from Bordaigorl. I was wondering if anyone can see how it is possible to have two pie charts in the same environment with different sizes. The part of the code that is responsible for this is "scale" when you call the function pie chart: \begin{tikzpicture} [ pie chart, slice type={g}{giallo}, slice type={A}{rosso}, slice type={B}{blu}, pie values/.style={font={\small}}, scale=2 ] \pie{t=1, A in power}{66/g,34/A} \pie[xshift=2.2cm]% {t=2, B in power}{33/g,33/B} \end{tikzpicture} My question is: does anyone see how to create two "types" of pies, one with scale=2 and another with scale=2.5, for example? For the purpose of understanding, I will post an MWE based on the whole code created by Bordaigorl here. What I would like is to have the left pie chart in one scale and the pie chart on the right in another scale. Please note that I am not the one who designed this code and credit must be given to Bordaigorl: \documentclass[border=10pt,multi,tikz]{standalone} \definecolor{rosso}{RGB}{220,57,18} \definecolor{giallo}{RGB}{255,153,0} \definecolor{blu}{RGB}{102,140,217} \definecolor{verde}{RGB}{16,150,24} \definecolor{viola}{RGB}{153,0,153} \makeatletter \tikzstyle{chart}=[ legend label/.style={font={\scriptsize},anchor=west,align=left}, legend box/.style={rectangle, draw, minimum size=5pt}, axis/.style={black,semithick,->}, axis label/.style={anchor=east,font={\tiny}}, ] \tikzstyle{bar chart}=[ chart, bar width/.code={ \pgfmathparse{##1/2} \global\let\bar@w\pgfmathresult }, bar/.style={very thick, draw=white}, bar label/.style={font={\bf\small},anchor=north}, bar value/.style={font={\footnotesize}}, bar width=.75, ] \tikzstyle{pie chart}=[ chart, slice/.style={line cap=round, line join=round, very thick,draw=white}, pie title/.style={font={\bf}}, slice type/.style 2 args={ ##1/.style={fill=##2}, values of ##1/.style={} } ] \pgfdeclarelayer{background} \pgfdeclarelayer{foreground} \pgfsetlayers{background,main,foreground} \newcommand{\pie}[3][]{ \begin{scope}[#1] \pgfmathsetmacro{\curA}{90} \pgfmathsetmacro{\r}{1} \def\c{(0,0)} \node[pie title] at (90:1.3) {#2}; \foreach \v/\s in{#3}{ \pgfmathsetmacro{\deltaA}{\v/100*360} \pgfmathsetmacro{\nextA}{\curA + \deltaA} \pgfmathsetmacro{\midA}{(\curA+\nextA)/2} \path[slice,\s] \c -- +(\curA:\r) arc (\curA:\nextA:\r) -- cycle; \pgfmathsetmacro{\d}{max((\deltaA * -(.5/50) + 1) , .5)} \begin{pgfonlayer}{foreground} \path \c -- node[pos=\d,pie values,values of \s]{$\v\%$} +(\midA:\r); \end{pgfonlayer} \global\let\curA\nextA } \end{scope} } \newcommand{\legend}[2][]{ \begin{scope}[#1] \path \foreach \n/\s in {#2} { ++(0,-10pt) node[\s,legend box] {} +(5pt,0) node[legend label] {\n} } ; \end{scope} } \begin{document} \begin{tikzpicture} [ pie chart, slice type={g}{giallo}, slice type={A}{rosso}, slice type={B}{blu}, pie values/.style={font={\small}}, scale=2 ] \pie{1}{66/g,34/A} \pie[xshift=2.2cm]% {2}{33.3/g,33.3/B,33.3/A} \end{tikzpicture} \end{document} I apologize if that is an obvious question. I've tried in 2 differents ways and they were all not succesful: I've tried to remove the scale from the preamble on tikz and added scale=2 when was calling pie function: \pie[xshift=2.2cm, scale=2]{2}{33.3/g,33.3/B,33.3/A} I've also tried to create two functions in the preamble of the document, one pie1 and another pie2. The code doesn't compile Thank you!

  • Inspired beautiful box from Indesign
    by Educ on December 3, 2015 at 2:45 pm

    I found these beautiful box in Math ebooks which is created by Adobe Indesign, I tired mdframed, tcolorbox but I didn't try Tikz. So could someone create them using LaTeX please? \documentclass[a4paper]{article} \usepackage{amsmath} \usepackage{amsmath,amsfonts,amssymb} \usepackage[svgnames]{xcolor} \usepackage[most]{tcolorbox} \tcbset{ lemmastyle/.style={enhanced, colback=white, colframe=blue!50, arc=0pt, fonttitle=\bfseries, description color=Maroon, colbacktitle=white, coltitle=DarkOliveGreen, top=\tcboxedtitleheight, boxed title style={arc=0pt}, attach boxed title to top right={yshift=-\tcboxedtitleheight/3, xshift=-2mm}% }, } \newtcbtheorem{myLemma}{Type Text Here Without counter }{lemmastyle}{thm} \usepackage{pifont} \begin{document} \begin{myLemma}{}{} \end{myLemma} \end{document} Update: Thanks, but when I use the code of @Alenanno, the equation doesn't fit the box. It's wider than it. Even when I put long text, the box is still too tight. I tired to fix it but with no luck. Could you please try? And could you make it breakable? (I mean by 'breakable' that the contents can be broken between two pages if the box contains long text.) \documentclass[a4paper]{article} \usepackage{amsmath} \usepackage{amsmath,amssymb}% pour les maths \usepackage{enumitem} \usepackage[svgnames]{xcolor} \usepackage[most]{tcolorbox} \usepackage{tikz} \tcbset{ lemmastyle/.style={enhanced, colback=white, colframe=blue!20, arc=0pt, fonttitle=\bfseries, description color=Maroon, colbacktitle=white, coltitle=DarkOliveGreen, top=\tcboxedtitleheight, boxed title style={arc=0pt}, attach boxed title to top left={yshift=-\tcboxedtitleheight/2, xshift=4mm}% }, } \newtcbtheorem{myLemma}{Long text here without counter }{lemmastyle}{thm} \usetikzlibrary{calc, fit} \newcommand{\mybox}[4][8cm]{ \begin{figure}[!h] \centering \begin{tikzpicture} \node[line width=0.5mm, rounded corners, text width=#1, draw=#2] (one) {\vspace{25pt}\\ #4}; \node[text=white,anchor=north east,align=center, minimum height=20pt] (two) at (one.north east) {#3}; \path[fill=#2] (one.north west|-two.west) -- ($(two.west)+(-1.5cm,0)$) to[out=0,in=180] (two.south west) -- (two.south east) [rounded corners] -- (one.north east) -- (one.north west) [sharp corners] -- cycle; \node[text=white,anchor=north east,align=center, minimum height=25pt, text height=2ex] (three) at (one.north east) {#3 \hspace*{.5mm}}; \end{tikzpicture} \end{figure} } \usepackage{pifont} \begin{document} \mybox[6cm]{green!70!black}{Long Fancy Title}{ \begin{enumerate} \item Show that ${\displaystyle D_2f(x,y) = \frac{\partial {}}{\partial{y}} \left ( \int_0^xg_1 (t,0) \ dt + \int_0^y g_2(x,s) \ ds \right)}$ \item prove that ${ \displaystyle \left(\forall x\in\mathbb{R} \right)\left(\forall y \in \mathbb{R} \right) x\neq y\, \text{and} \, x+y \neq 2 \implies x^{2}-2x \neq y^2-2y }$ \end{enumerate} } \begin{myLemma}{}{} \begin{enumerate} \item Show that ${\displaystyle D_2f(x,y) = \frac{\partial {}}{\partial{y}} \left ( \int_0^xg_1 (t,0) \ dt + \int_0^y g_2(x,s) \ ds \right)}$ \item prove that ${ \displaystyle \left(\forall x\in\mathbb{R} \right)\left(\forall y \in \mathbb{R} \right) x\neq y\, \text{and} \, x+y \neq 2 \implies x^{2}-2x \neq y^2-2y }$ \end{enumerate} \end{myLemma} \mybox[6cm]{blue!70!black}{Very Very Long Fancy Title}{Duis id dolor et ligula eleifend imperdiet. Mauris luctus, quam vitae viverra sagittis, dolor nibh imperdiet augue, eu venenatis eros augue et nisl. Vivamus nec fermentum est.} Nullam libero augue, luctus et est vitae, fermentum aliquet libero. Maecenas dictum placerat eros, eu fermentum sem fermentum dapibus. Quisque non tellus nec magna feugiat luctus. \end{document}

  • How to draw a graph with ring in latex?
    by Scott Shao on September 8, 2015 at 1:02 am

    As the title tells, how to draw a graph with ring in latex? I have learned that I can use forest to draw a tree in latex. For example, using following code, I can have one simple binary tree.1->2, 1->3. \begin{forest} for tree={circle,draw} [1[2][3]] \end{forest} Then, Im wondering how to draw a graph with ring. For example, how can I add another edge between 1 and 2 so that there is ring between node 1 and 2. 1 -> 2, and 2->1. Also, I'm wondering how to draw a self ring. i.e., 1->1(an egde starting from node 1 and ending at node 1)

  • TikZ- Draw a cooking pot
    by Thanos on May 11, 2015 at 4:28 pm

    I am trying to reproduce the following picture in tikz I am able to draw something that looks like that but it's not the same... Any chance to draw it or make it even more fancy? My code is \documentclass[demo]{standalone} \usepackage{tikz} \usetikzlibrary{decorations.pathmorphing} \usetikzlibrary{decorations.markings} \usetikzlibrary{% calc,% fadings,% shadings% } \usetikzlibrary{arrows,shapes} \usetikzlibrary{shapes.geometric,calc} \usetikzlibrary{backgrounds,fit} \usetikzlibrary{shadows} \usetikzlibrary{snakes} \usetikzlibrary{decorations.text} \usetikzlibrary{positioning} \usepackage{graphicx} \begin{document} \begin{tikzpicture} \draw[fill=black] (0,0) circle (1cm); \draw[fill=black] (0,0.75) ellipse (1cm and 0.25cm); \draw[fill=black] (0,-1) ellipse (0.6cm and 0.1cm); \draw[fill=gray] (0,0.75) ellipse (0.8cm and 0.15cm); \end{tikzpicture} \end{document} and my output is

  • tikz-3dplot rotation around the x-axis
    by asm on March 23, 2013 at 10:27 pm

    I'm trying to create a simple spherical quadrant grid using the tikz-3dplot package. The longitudinal grid lines look fine but when I try to create the latitudinal lines I get really strange results that I don't understand. I was expecting to see a series of latitude arcs rotating around the x-axis (so they're not quite the same as latitude lines). Instead, it appears that my attempt to rotate around the x-axis is rotating around all three axes. I'm not sure what I'm doing wrong. \documentclass{article} \usepackage{tikz} \usepackage{tikz-3dplot} \begin{document} \tdplotsetmaincoords{60}{155} \usetikzlibrary{3d} \begin{tikzpicture}[scale=5,tdplot_main_coords] \tikzstyle{grid}=[thin,color=red,tdplot_rotated_coords] \draw[thick,->] (0,0,0) -- (1,0,0) node[anchor=north east]{$x$}; \draw[thick,->] (0,0,0) -- (-1,0,0); \draw[thick,->] (0,0,0) -- (0,1,0) node[anchor=north west]{$y$}; \draw[thick,->] (0,0,0) -- (0,0,1) node[anchor=south]{$z$}; \foreach \rot in {0, 30, 60, 90} { \tdplotsetrotatedcoords{\rot}{0}{0}; \tdplotdrawarc[grid]{(0,0,0)}{1}{0}{180}{}{}; } \foreach \rot in {-90, -60, -30, 0, 30, 60, 90} { \tdplotsetrotatedcoords{\rot}{90}{0}; \tdplotdrawarc[grid]{(0,0,0)}{1}{90}{180}{}{}; } \end{tikzpicture} \end{document} Edit: After more investigation it appears that attempting to rotate around the x-axis actually rotates around the z-axis, as can be clearly seen in this image. Placing the \rot in the x- or z-position has the same effect.

  • Is there a TikZ equivalent to the PSTricks \ncbar command?
    by Alan Munn on May 9, 2012 at 12:50 pm

    Although I now use TikZ, every so often I find myself looking for very useful PSTricks commands which don't seem to exist in TikZ. The pst-node package has an \ncbar command which allows one to connect two nodes with arms dropping down, typically at a 90 degree angle. Here's an example: \documentclass{article} \usepackage{pst-node} \begin{document} \rput(0,0){\rnode{A}{\psframebox{A}}} \rput(2,0){\rnode{B}{\psframebox{B}}} \ncbar[angle=90]{A}{B} \end{document} Is there a TikZ equivalent to this useful command? If not, how easy would it be to create one?