• align text in tikz node with minimum width
    by Hyperplane on February 24, 2026 at 1:01 pm

    \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node[fill=yellow!80!black,align=right, minimum width=10cm] {This is a\\ demonstration text for\\ alignments.}; \end{tikzpicture} \begin{tikzpicture} \node[fill=yellow!80!black,align=left, minimum width=10cm] {This is a\\ demonstration text for\\ alignments.}; \end{tikzpicture} \end{document} When using align=right and align=left, the text is usually flushed to the right. But when I set a minimum width for the box it appears in the center instead: This feels like a bug in tikz. In Left alignment in TikZ, people suggested setting text width or wrapping the content in a parbox. However, these require knowing the width of the text beforehand, otherwise one gets overfull/underfull box warnings, so I do not consider them real solutions. I would expect the text width to be chosen automatically.

  • how to zoom in on tikz clipped image
    by Matteo on February 24, 2026 at 10:38 am

    I have the following situation: where the first \clip in the second frame is very small and I wish to present it a bit bigger for visibility reasons. I'm unsure how to tweak the code I'm using and if it is possible by simply using tikz + clip. Thanks in advance! MWE \documentclass[aspectratio=149]{beamer} \usepackage[T1]{fontenc} \usetheme{Singapore} \usecolortheme{dolphin} \usepackage{tikz} \usepackage[export]{adjustbox} \begin{document} \begin{frame} \frametitle<2>{Inset 1} \frametitle<3>{Inset 2} \only<1-3>{ \centering\includegraphics<1>[width=.75\textwidth]{example-image-a} \begin{adjustbox}{max width=\textwidth,max height=\textheight} \begin{tikzpicture} \clip<2> (-6,4) rectangle (6,5); \clip<3> (-6,-3.25) rectangle (6,-7.5); \node<2-> at (0,0) {\includegraphics[width=\textwidth]{example-image-a}}; \end{tikzpicture} \end{adjustbox} } \end{frame} \end{document} EDIT: sketch attempt Cropped from the original, the image can be stretch vertically, primarily, and horizontally up to the size of the frame while preventing Overfull hbox warnings. Proportion should be preserved but if not possible a vertical stretch has the priority.

  • How to draw arc segments of circular quiver diagram elegant with tikz?
    by Explorer on February 23, 2026 at 9:23 am

    Claim This post is more likely asking for better approach, focused on the arc's plot. And that is similar to, but I don't find the same one: Drawing cyclic quiver Drawing a circular graph using xypic https://tex.stackexchange.com/a/759710/322482 Descrption I found that just with: \draw[<->,shortstyle,violet] (\ang:\RR cm) arc[radius=\RR cm,start angle=\ang,delta angle=\deltaang]; The arc is not exactly centered at (0,0)(the violet part), thus I learnt from here and calculate the \deltaangg with cosline rule manually. Code \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{arrows.meta} \begin{document} \def\NN{5} \def\RR{5} \def\rr{0.5} \def\deltaang{\fpeval{360/\NN}} \def\deltaangg{\fpeval{acosd((2*\RR^2-\rr^2)/(2*\RR^2))}} % cosine rule \begin{tikzpicture}[ thick,>=Stealth,shortstyle/.style={shorten >=\rr cm,shorten <=\rr cm}] \foreach \i in {1,...,\NN}{ \def\ang{\fpeval{\deltaang*(\i-1)}} \path[draw,fill=gray!75] (\ang:\RR cm) circle[radius=\rr cm]; \def\startang{\fpeval{\ang+\deltaangg}} \def\endang{\fpeval{\ang+\deltaang-\deltaangg}} %%%%%%%%%%%%%% \draw[<->,shortstyle,violet] (\ang:\RR cm) arc[radius=\RR cm,start angle=\ang,delta angle=\deltaang]; %%%%%%%%%%%%%% % https://tex.stackexchange.com/a/66265/322482 \draw[<->,magenta] ([{shift=(\startang:\RR cm)}]0,0) arc[radius=\RR cm,start angle=\startang,end angle=\endang]; \foreach[parse=true] \j in {2,...,{\NN-2}}{ \def\nextang{\fpeval{\ang+\deltaang*\j}} \draw[shortstyle,<->] (\ang:\RR cm) -- (\nextang:\RR cm); } } \end{tikzpicture} \end{document} Question The magenta arcs is what I want, but I found it too hard to calculate \def\deltaangg{\fpeval{acosd((2*\RR^2-\rr^2)/(2*\RR^2))}}. Any suggestions on the code?

  • What is the best way to draw a potato (like found in vector analysis/continuum mechanics courses)
    by Dimitrios ANAGNOSTOU on February 21, 2026 at 11:34 pm

    I apologized if this is a duplicate. What is the best way to draw such figures with tikz (or other packages)? For the time being just the potato like figure. I do not care for the vectors and the infinitesimal mass element. I do not want someone to do the work for me. Just some advice or suggestions.

  • Latex: Tikz - rectangle to inherit the width of another rectangle
    by GJW on February 21, 2026 at 1:44 pm

    I would like node B to have exactly the same width as node A, without explicitly specifying a fixed dimension, with the following constraints: The two nodes are not adjacent in the source code. I do not want to hard-code a width (e.g., minimum width=3cm). Node A will always be at least as wide as node B. I would prefer a solution that does not rely on manually computing dimensions via \path let unless necessary. Here is a minimal example illustrating what I currently have: \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \node [draw] (A) {Some text}; \path let \p1 = (A.south west), \p2 = (A.north east) in node [draw, minimum width=\x2-\x1-\pgflinewidth, minimum height=\y2-\y1-\pgflinewidth, below right] at ([yshift={\pgflinewidth}]A.south west) {more}; \end{tikzpicture} \end{document}

  • Strange intersection glitch of knots package?
    by Explorer on February 21, 2026 at 9:20 am

    This question based on the previous question: % Source - https://tex.stackexchange.com/a/759998 % Posted by Andrew Stacey % Retrieved 2026-02-21, License - CC BY-SA 4.0 \documentclass[tikz, border=1cm]{standalone} \usetikzlibrary{decorations.pathreplacing,knots} %\url{https://tex.stackexchange.com/q/759978/86} \begin{document} \begin{tikzpicture}[ basic strand/.style={ black, double=gray!10, double distance=1pt, line cap=round, thick, }, crossing strand/.style={ line width=2pt, only when rendering/.style={% draw=gray!10,% line width=1pt, double=none, } }, rounded corners=1pt, ] \begin{knot}[ consider self intersections=true, ignore endpoint intersections=false, background colour=black, every intersection/.style={ crossing strand }, only when rendering/.style={ basic strand }, clip width=1, flip crossing=1, ] \strand (7.5,7.5)--(6.5,5.5)--(7.5,3.5)--(6.5,1.5)--(4.5,0.5)--(2.5,1.5)--(0.5,0.5)--(1.5,2.5)--(0.5,4.5)--(1.5,6.5)--(3.5,7.5)--(5.5,6.5)--(7.5,5.5)--(6.5,3.5)--(7.5,1.5)--(5.5,0.5)--(3.5,1.5)--(1.5,0.5)--(0.5,2.5)--(1.5,4.5)--(0.5,6.5)--(2.5,7.5)--(4.5,6.5)--(6.5,7.5)--(5.5,5.5)--(7.5,4.5)--(6.5,2.5)--(7.5,0.5)--(5.5,1.5) --(3.5,0.5)--(1.5,1.5)--(0.5,3.5)--(1.5,5.5) --(0.5,7.5)--(2.5,6.5)--(4.5,7.5)--(6.5,6.5) --(4.5,5.5)--(5.5,3.5) % --(7.5,2.5) ; \end{knot} \end{tikzpicture} \end{document} With --(7.5,2.5) commented, it behaves good: However, if I uncommented that line, thing changed: Is that a bug or feature? Any possibility to improve this?

  • Using tikz's backgrounds library to draw something behind text
    by Werner on February 21, 2026 at 7:20 am

    Consider the following minimal example where I want to draw a rectangle behind a sequence of numbers (to highlight them): \documentclass{article} \usepackage{tikz} \usetikzlibrary{backgrounds,calc} \NewDocumentCommand{\tikzmark}{ m }{\tikz[overlay, remember picture] \node (#1) {};} \newcounter{seq} \NewDocumentCommand{\seqstart}{}{% \stepcounter{seq}% Start a new sequence \tikzmark{seq-start-\theseq}}% Set start marker \NewDocumentCommand{\seqend}{}{% \tikzmark{seq-end-\theseq}% Set end marker \tikz[remember picture, overlay] \scoped [on background layer] \fill [fill=blue!10!white] ($(seq-start-\theseq.south west) + (-0.5pt,1pt)$) rectangle ($(seq-end-\theseq.south east) + (0.5pt,1.1\normalbaselineskip)$);% } \begin{document} \[ 12, 15, 8, 11, 4, 7, 0, 3, 16, 19, 12, 15, 8, 11, 4, 7, 0, 3, \ldots \] \[ \seqstart{}12, 15, 8, 11, 4, 7, 0, 3, 16, 19\seqend{}, 12, 15, 8, 11, 4, 7, 0, 3, \ldots \] \end{document} The idea is that \seqstart would set a (counter-driven) \tikzmark representing the start of the sequence to be marked. Then \seqend would set a \tikzmark at the end and highlight it using the background layer. The counter allows for multiple such sequence marking within a larger document. However, the output shows that the rectangle highlighting a part of the sequence is not being drawn on background layer as requested. Why is that? How can I ensure the rectangle is drawn on the background layer behind document/text elements? The backgrounds library documentation (in the tikz documentation, section 45) mentions that on background layer can only be used inside a {scope} or \scoped, which is done above.

  • How to draw self-overlapped path with double line style?
    by Explorer on February 20, 2026 at 4:52 pm

    The question is similar to this solution, but not the same: \documentclass[tikz, border=1cm]{standalone} \usetikzlibrary{decorations.pathreplacing} % https://tex.stackexchange.com/a/572738/322482 \begin{document} \begin{tikzpicture}[ rounded corners=1pt, path decomposition/.style={% postaction={decoration={show path construction, lineto code={ \draw[#1] (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast); }, curveto code={ \draw[#1] (\tikzinputsegmentfirst) .. controls (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb) ..(\tikzinputsegmentlast) ; }, closepath code={ \draw[#1] (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast) {closepath};} } ,decorate}}] \draw[line cap=round, black, double=gray!10, thick, path decomposition={black, double=gray!10,thick}] (3,3) -- (1,1) -- (3,1) -- (1,3); % here below is what I want with only one path \begin{scope}[xshift=3cm] \draw[black, double=gray!10, thick, line cap=round] (3,3) -- (1,1) -- (1.5,1); \draw[black, double=gray!10, thick, line cap=round] (2.5,1) -- (3,1) -- (1,3); \draw[black, double=gray!10, thick] (1.3,1) -- (2.7,1); \end{scope} \end{tikzpicture} \end{document}

  • How to draw a half‑sphere with 5‑degree lines along the x‑axis in TikZ/PGF? [closed]
    by AruGip on February 19, 2026 at 8:40 pm

    I found this post and I'm trying to retrieve the version shown in the image below. Does anyone know how I can get that specific version? I've checked the documentation and explored the available properties, but I couldn't find anything that returns the same value shown there. Any ideas on how to achieve this?

  • Create a directed graph
    by Dimitrios ANAGNOSTOU on February 19, 2026 at 4:15 pm

    I want to create the following figure. Using the following code, I managed to get something close. But I cannot figure out how to get properly the diagonal vectors without too much trial and error. Any ideas? Thanks a lot! \documentclass[a4paper,11pt]{article} \usepackage[T1]{fontenc} \usepackage[french]{babel} \usepackage{tikz} \usetikzlibrary{positioning,arrows.meta} \begin{document} \begin{figure}[!htpb] \centering \begin{tikzpicture}[ node distance=3cm, box/.style={draw, rectangle, minimum size=1.2cm, font=\large}, arr/.style={->, >=Stealth, thick} ] % Nodes \node[box] (1) {1}; \node[box, below=of 1] (2) {2}; \node[box, right=of 1] (3) {3}; \node[box, below=of 3] (4) {4}; % Labels n_i \node[above=3mm of 1] {$n_1=3$}; \node[above=3mm of 3] {$n_3=1$}; \node[below=3mm of 2] {$n_2=2$}; \node[below=3mm of 4] {$n_4=2$}; % Horizontal 1 <-> 3 (two parallel arrows) \draw[arr] ([yshift=4pt]1.east) -- ([yshift=4pt]3.west); \draw[arr] ([yshift=-4pt]3.west) -- ([yshift=-4pt]1.east); % Vertical left \draw[arr] (1) -- (2); % Vertical right \draw[arr] (4) -- (3); % Bottom horizontal \draw[arr] (2) -- (4); % Diagonals \draw[arr] (2) -- (3); \draw[arr] ([xshift=-4pt]4.north) -- ([xshift=4pt]1.south); \draw[arr] ([xshift=-4pt]1.south) -- ([xshift=4pt]4.north); \end{tikzpicture} \end{figure} \end{document}

  • I am trying to \protected@edef a bmatrix, and then I token.get_macro that token from Lua, so I can print it to the .tex at a later time
    by Jasper on February 19, 2026 at 3:25 pm

    I am trying to \protected@edef a bmatrix, and then I token.get_macro that token from Lua, so I can print it to the .tex at a later time. The error: WARNING: mathml missing for hash E6607B372B3A7F4DE18DB36E2B449CBD ! You can't use `\spacefactor' in math mode. \@->\spacefactor \@m {} \DocumentMetadata{ lang = en ,pdfversion = 2.0 ,pdfstandard = {UA-2} ,tagging = on } \tagpdfsetup {math/mathml/luamml/load=true} \documentclass{article} \usepackage{luacode,unicode-math,tikz} \begin{document} \makeatletter \protected@edef\COUNTDOOKU{\( \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \)} \makeatother \begin{tikzpicture} \begin{luacode*} tex.sprint( ("\\node at (0,0) {%s};") :format( token.get_macro("COUNTDOOKU") ) ) \end{luacode*} \end{tikzpicture} \end{document}

  • Is it possible to implement loop in TikZ like xypic?
    by YCH817 on February 18, 2026 at 8:54 pm

    I have tried plotting loop arrows with different sizes using xypic and tikz : \documentclass{article} \usepackage[a4paper, landscape=true]{geometry} \usepackage{graphicx} % Required for inserting images \usepackage[curve,pdf,all]{xy} \usepackage[svgnames,dvipsnames]{xcolor} \usepackage{tikz} \begin{document} $\begin{xy} (0,0)*+<5pt,3pt>[F-:<3pt>:red][F*:<3pt>:pink]{\vphantom{fg}x}="x", \ar@`{"x"+(-10,+10),"x"+(+10,+10)}^{1} \ar@`{"x"+(-20,+20),"x"+(+20,+20)}^{2} \ar@`{"x"+(-30,+30),"x"+(+30,+30)}^{3} \ar@`{"x"+(-40,+40),"x"+(+40,+40)}^{4} \ar@`{"x"+(-50,+50),"x"+(+50,+50)}^{5} \ar@`{"x"+(-60,+60),"x"+(+60,+60)}^{6} \ar@`{"x"+(+10,-10),"x"+(-10,-10)}^{1} \ar@`{"x"+(+20,-20),"x"+(-20,-20)}^{2} \ar@`{"x"+(+30,-30),"x"+(-30,-30)}^{3} \ar@`{"x"+(+40,-40),"x"+(-40,-40)}^{4} \ar@`{"x"+(+50,-50),"x"+(-50,-50)}^{5} \ar@`{"x"+(+60,-60),"x"+(-60,-60)}^{6} \end{xy}$ % --- \tikz{ \node [ draw, line width=.4pt, rounded corners=5pt, inner sep=3pt ] (x) at (0,0) {$x\vphantom{fg}$}; \foreach \i in {1,2,3,...,6} { \draw[->] (x) .. controls +(-\i,+\i) and +(+\i,+\i) .. (x) ; \draw[->] (x) .. controls +(+\i,-\i) and +(-\i,-\i) .. (x) ; }} \end{document} and here is the output : xypic : tikz : I noticed that the loop curve produced by tikz is a little bit squashed (especially the smallest curve, I think it is quite ugly -_-||), compared to the one produced by xypic. Since I am starting to use LuaLaTeX as compiling engine and I cannot use xypic with pdf option in LuaLaTex, I wonder if there is a good way to make tikz produce loop curves like the one produced by xypic. Also luamplib code is welcome.

  • uneven commutative diagram
    by mappingmoe on February 18, 2026 at 11:33 am

    I want to draw the following commutative diagram in LaTeX: I have tried tikzcd, but I think I won't work, since the rows have different size. Is there a clean way to do it? EDIT: my first approach was the following: \documentclass[a4paper]{article} \usepackage{tikz-cd} \begin{document} \begin{tikzcd} P \arrow{l}{pr} \arrow{d}{\pi} & TP \arrow{d}{T \pi}\\ I \arrow{ur}{\tilde{\gamma}} \arrow{r}{\dot{\gamma}} & M \arrow{l}{pr} & TM \end{tikzcd} \end{document}

  • What packages are useful for drawing topological surfaces? [closed]
    by Sean Wakasa on February 18, 2026 at 8:37 am

    I'm writing a mathematical paper that studies the fundamental groups of surface bundles, hence I need to create images of surfaces of genus greater than 1 with loops drawn on surface. What packages can I use to make such images? See page 8 of this paper for an example of such a surface.

  • Spacing in Tikz Heatmap
    by itc on February 17, 2026 at 6:09 pm

    I am struggling with the vertical space of my tikz heatmap. Specifically, my column labels are getting into the title of my diagram. The same is happening with the legend. I have put the MWE: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{matrix, positioning, backgrounds} \begin{document} \begin{tikzpicture}[ font=\sffamily, cell/.style={ rectangle, minimum width=2.5cm, minimum height=1cm, draw=white, line width=0.5mm, align=center }, label/.style={ anchor=east, font=\bfseries\small }, header/.style={ anchor=south, rotate=45, font=\bfseries\small, anchor=south west } ] % Define Colors representing the score (Low, Medium, High) \definecolor{scoreLow}{HTML}{F2F2F2} % Weak/Low \definecolor{scoreMed}{HTML}{84B7D6} % Medium/Partial \definecolor{scoreHigh}{HTML}{004C6D} % Strong/High % Legend formatting \matrix [draw=none, anchor=north west] at (-4, 2) { \node [fill=scoreHigh, text=white, minimum width=1cm] {High/Strong}; & \node [anchor=west] {Jddhdhshdhshss}; \\ \node [fill=scoreMed, text=black, minimum width=1cm] {Zprororo}; & \node [anchor=west] {Trump}; \\ \node [fill=scoreLow, text=black, minimum width=1cm] {Hhdueueu}; & \node [anchor=west] {Ghsshshshs}; \\ }; % --- THE DATA MATRIX --- % Row 1: H % High Behavioural Realism [cite: 29], Low Auditability [cite: 81], Low Probability [cite: 78], High Actionability [cite: 40] \node[cell, fill=scoreHigh, text=white] (c11) at (0,0) {High}; \node[cell, fill=scoreLow, text=black] (c12) at (2.5,0) {Low}; \node[cell, fill=scoreLow, text=black] (c13) at (5,0) {Low}; \node[cell, fill=scoreLow, text=black] (c14) at (7.5,0) {Risk}; \node[cell, fill=scoreHigh, text=white] (c15) at (10,0) {High}; % Row 2: A % Low Realism, High Auditability [cite: 82], Med Probability (Rankings) [cite: 109] \node[cell, fill=scoreLow, text=black] (c21) at (0,-1) {Low}; \node[cell, fill=scoreHigh, text=white] (c22) at (2.5,-1) {High}; \node[cell, fill=scoreMed, text=black] (c23) at (5,-1) {Med}; \node[cell, fill=scoreMed, text=black] (c24) at (7.5,-1) {Med}; \node[cell, fill=scoreMed, text=black] (c25) at (10,-1) {Med}; % Row 3: B % Input oriented [cite: 112], Low actionability alone [cite: 113] \node[cell, fill=scoreLow, text=black] (c31) at (0,-2) {Low}; \node[cell, fill=scoreMed, text=black] (c32) at (2.5,-2) {Med}; \node[cell, fill=scoreLow, text=black] (c33) at (5,-2) {Low}; \node[cell, fill=scoreHigh, text=white] (c34) at (7.5,-2) {High}; \node[cell, fill=scoreLow, text=black] (c35) at (10,-2) {Low}; % Row 4: C % Easier to document [cite: 94], Explore plausibility not prob [cite: 93] \node[cell, fill=scoreMed, text=black] (c41) at (0,-3) {Med}; \node[cell, fill=scoreHigh, text=white] (c42) at (2.5,-3) {High}; \node[cell, fill=scoreLow, text=black] (c43) at (5,-3) {Low}; \node[cell, fill=scoreMed, text=black] (c44) at (7.5,-3) {Med}; \node[cell, fill=scoreMed, text=black] (c45) at (10,-3) {Med}; % Row 5: D % Traceability/Coherence [cite: 96], Probabilistic [cite: 95] \node[cell, fill=scoreLow, text=black] (c51) at (0,-4) {Low}; \node[cell, fill=scoreHigh, text=white] (c52) at (2.5,-4) {High}; \node[cell, fill=scoreHigh, text=white] (c53) at (5,-4) {High}; \node[cell, fill=scoreLow, text=black] (c54) at (7.5,-4) {Low}; \node[cell, fill=scoreMed, text=black] (c55) at (10,-4) {Med}; % Row 6: E % Normative/Pathways[cite: 101], High Actionability \node[cell, fill=scoreLow, text=black] (c61) at (0,-5) {Low}; \node[cell, fill=scoreMed, text=black] (c62) at (2.5,-5) {Med}; \node[cell, fill=scoreLow, text=black] (c63) at (5,-5) {Low}; \node[cell, fill=scoreHigh, text=white] (c64) at (7.5,-5) {High}; \node[cell, fill=scoreHigh, text=white] (c65) at (10,-5) {High}; % Row 7: F % Calibration/Monitoring[cite: 133], High Probability, Low Realism \node[cell, fill=scoreLow, text=black] (c71) at (0,-6) {Low}; \node[cell, fill=scoreHigh, text=white] (c72) at (2.5,-6) {High}; \node[cell, fill=scoreHigh, text=white] (c73) at (5,-6) {High}; \node[cell, fill=scoreLow, text=black] (c74) at (7.5,-6) {Low}; \node[cell, fill=scoreMed, text=black] (c75) at (10,-6) {Med}; % Row 8: G % Adversarial[cite: 122], Low Auditability (often anecdotal) \node[cell, fill=scoreHigh, text=white] (c81) at (0,-7) {High}; \node[cell, fill=scoreLow, text=black] (c82) at (2.5,-7) {Low}; \node[cell, fill=scoreLow, text=black] (c83) at (5,-7) {Low}; \node[cell, fill=scoreLow, text=black] (c84) at (7.5,-7) {Low}; \node[cell, fill=scoreMed, text=black] (c85) at (10,-7) {Med}; % --- LABELS --- % Y-Axis Labels (Methods) \node[label] at (-1.5, 0) {H}; \node[label] at (-1.5, -1) {A}; \node[label] at (-1.5, -2) {B}; \node[label] at (-1.5, -3) {C}; \node[label] at (-1.5, -4) {D}; \node[label] at (-1.5, -5) {E}; \node[label] at (-1.5, -6) {F}; \node[label] at (-1.5, -7) {G}; % X-Axis Labels (Attributes) \node[header] at (0, 0.6) {Fuuueueueu djejejejjejejejejej}; \node[header] at (2.5, 0.6) {Ldhdhdhdd hdhdjddjdjdjdjeieeieiidjd}; \node[header] at (5, 0.6) {LLwhwuquahsajqjqjqjqjqqjssjsj}; \node[header] at (7.5, 0.6) {Kahhwuwuwuddeeicdjsjwjw}; \node[header] at (10, 0.6) {KKsiwiwiwiwyduweueeuee}; % Title \node[anchor=center, font=\bfseries\Large] at (3.5, 3.5) {Xfhfhhe jeeieiei nddjewoo djwiwoxdk msaaakkkwifjfjf}; \node[anchor=center, font=\small, text width=12cm, align=center] at (3.5, 2.8) {Xomtive fhfru dieieo difiwwi dkdfjdkwo ksksskskw.\\ \textit{Fsw7w8 ddijej doofoe cdirirfv iiroflvw dkoeowoxk dfeke.}}; \end{tikzpicture} \end{document} I have attached the screenshot as well:

  • tikz draw of solid effect of stack of unit cube legos: for mathlinks
    by Epa on February 4, 2026 at 8:06 am

    How to make the solid effect view better, as shown in the photo attached? \documentclass[]{standalone} \usepackage{amsmath, amssymb, latexsym, amscd, amsthm} \usepackage{tikz} \newcommand{\drawboxa}[4]{ \pgfmathsetmacro \angle {30} \pgfmathsetmacro \xd {{2/3*cos(\angle)}} \pgfmathsetmacro \yd {{2/3*sin(\angle)}} \pgfmathsetmacro \x {{#1-1+(#2-1)*(\xd)}} \pgfmathsetmacro \y {{#3-1+(#2-1)*(\yd)}} \draw[fill=#4] (\x,\y) -- (\x+1,\y) -- (\x+1,\y+1) -- (\x,\y+1) -- cycle; \draw[fill=#4] (\x,\y+1) -- (\x+\xd,\y+1+\yd)coordinate[pos=.5](M) -- (\x+1+\xd,\y+1+\yd) -- (\x+1,\y+1) -- cycle; \draw[fill=#4] (\x+1,\y+1) -- (\x+1+\xd,\y+1+\yd) -- (\x+1+\xd,\y+\yd)coordinate[pos=.5](M2) -- (\x+1,\y)-- (\x+1,\y+1)coordinate[pos=.5](M3); \path(M2)--(M3)coordinate[pos=.5](M4); \draw[fill=#4] (M)++(.5,0)coordinate(T1)++(.15,0)arc(0:-180:.15cm and .06cm)--++(0,.1)arc(-180:0:.15cm and .06cm)coordinate(T2)--++(0,-.1) (T2)arc(0:180:.15cm and .06cm); \draw[fill=black,opacity=.1](M4)circle(.12cm and .15cm) (\x,\y)++(.5,.5)circle(.15); \draw(M4)circle(.12cm and .15cm) (\x,\y)++(.5,.5)circle(.15); } \newcommand{\drawboxb}[3]{ \pgfmathsetmacro \angle {30} \pgfmathsetmacro \xd {{2/3*cos(\angle)}} \pgfmathsetmacro \yd {{2/3*sin(\angle)}} \pgfmathsetmacro \x {{#1-1+(#2-1)*(\xd)}} \pgfmathsetmacro \y {{#3-1+(#2-1)*(\yd)}} \draw[fill=white] (\x,\y) -- (\x+1,\y) -- (\x+1,\y+1) -- (\x,\y+1) -- cycle; \draw[fill=white] (\x,\y+1) -- (\x+\xd,\y+1+\yd)coordinate[pos=.5](M) -- (\x+1+\xd,\y+1+\yd) -- (\x+1,\y+1) -- cycle; \draw[fill=white] (\x+1,\y+1) -- (\x+1+\xd,\y+1+\yd) -- (\x+1+\xd,\y+\yd)coordinate[pos=.5](M2) -- (\x+1,\y)-- (\x+1,\y+1)coordinate[pos=.5](M3); \path(M2)--(M3)coordinate[pos=.5](M4); \draw[fill=white] (M)++(.55,0)coordinate(T1)++(.15,0)arc(0:-180:.2cm and .07cm)--++(0,.1)arc(-180:0:.2cm and .07cm)coordinate(T2)--++(0,-.1) (T2)arc(0:180:.2cm and .07cm) (T2)++(-.2,0)circle(.16cm and .04cm); \draw(M4)circle(.15cm and .2cm)circle(.11cm and .16cm) (\x,\y)++(.5,.5)circle(.2)circle(.15); } \usepackage{tikzbricks} %\printanswers \newcommand{\drawboxc}[4]{ \pgfmathsetmacro \angle {30} \pgfmathsetmacro \xd {{2/3*cos(\angle)}} \pgfmathsetmacro \yd {{2/3*sin(\angle)}} \pgfmathsetmacro \x {{#1-1+(#2-1)*(\xd)}} \pgfmathsetmacro \y {{#3-1+(#2-1)*(\yd)}} \draw[fill=#4] (\x,\y) -- (\x+1,\y) -- (\x+1,\y+1) -- (\x,\y+1) -- cycle; \draw[fill=#4] (\x,\y+1) -- (\x+\xd,\y+1+\yd)coordinate[pos=.5](M) -- (\x+1+\xd,\y+1+\yd) -- (\x+1,\y+1) -- cycle; \draw[fill=#4] (\x+1,\y+1) -- (\x+1+\xd,\y+1+\yd) -- (\x+1+\xd,\y+\yd)coordinate[pos=.5](M2) -- (\x+1,\y)-- (\x+1,\y+1)coordinate[pos=.5](M3); \path(M2)--(M3)coordinate[pos=.5](M4)coordinate[pos=.4](M5); \draw[fill=#4](M4)circle(.12cm and .15cm)++(0,.15)coordinate(Y1)++(0,-.15)coordinate(Y2); \draw[fill=#4](M5)++(0,-.025)circle(.12cm and .15cm)++(0,.15)coordinate(Y3)++(0,-.3)coordinate(Y4) (Y3)--(Y1)arc(90:270:.12cm and .15cm)--(Y4)arc(270:90:.12cm and .15cm); \draw[fill=black,opacity=.1](\x,\y)++(.5,.5)circle(.15) (M)++(.5,0)coordinate(T1)circle(.15cm and .06cm); \draw(\x,\y)++(.5,.5)circle(.15) (T1)circle(.15cm and .06cm); } \begin{document} \begin{tikzpicture} \def\x{3} %so luong block \foreach\h in{1,...,\x}{ \drawboxa{1}{1}{\h}{blue!25} } \def\d{.3} \draw(1,-\d) node[scale=1.3]{3}; \draw(.8,\x+1.2*\d) node[scale=1.2, above]{three}; \begin{scope}[xshift=100] \def\x{2} %so luong block \foreach\h in{1,...,\x}{ \drawboxa{1}{1}{\h}{blue!25} } \draw(1,-\d) node[scale=1.3]{2}; \draw(.8,\x+1.2*\d) node[scale=1.2, above]{two}; \end{scope} \begin{scope}[xshift=200] \def\x{5} %so luong block \foreach\h in{1,...,\x}{ \drawboxa{1}{1}{\h}{blue!25} } \draw(1,-\d) node[scale=1.3]{5}; \draw(.8,\x+1.2*\d) node[scale=1.2, above]{five}; \end{scope} \end{tikzpicture} \vspace{1cm} \begin{tikzpicture} \def\x{5} %so luong block %drawbox{x}{z}{y} %x la toa do x %z la toa do lop tinh theo goc xien %y la toa do y \drawboxb{1}{0}{0} \end{tikzpicture} \begin{tikzpicture} \def\x{5} % so luong block xanh \def\v{2} % so luong block vang \def\b{1} % so luong block xanh duong \pgfmathtruncatemacro{\xx}{\x+1} \pgfmathtruncatemacro{\vv}{\x+\v} \pgfmathtruncatemacro{\vvv}{\vv+1} \pgfmathtruncatemacro{\bb}{\vv+\b} \ifnum\x>0 \foreach \h in {1,...,\x}{ \drawboxc{\h}{1}{1}{brown!35} } \fi \ifnum\v>0 \foreach \h in {\xx,...,\vv}{ \drawboxc{\h}{1}{1}{yellow!55} } \fi \ifnum\b>0 \foreach \h in {\vvv,...,\bb}{ \drawboxc{\h}{1}{1}{blue!25} } \fi \end{tikzpicture} \end{document} The code was from user 11232 How to draw stacked cubes of different sizes and colors?

  • Simplifying an Asymptote figure for spherical coordinates
    by Sebastiano on January 26, 2026 at 12:58 pm

    I refer to the second code by the user Chris Chudzicki: % Source - https://tex.stackexchange.com/a/160528 % Posted by Chris Chudzicki, modified by community. See post 'Timeline' for change history % Retrieved 2026-01-26, License - CC BY-SA 3.0 \documentclass{article} \usepackage{asymptote} \begin{document} \begin{asy}[width=\textwidth] settings.render=6; settings.prc=false; import three; import graph3; import grid3; currentprojection=obliqueX; //Draw Axes pen thickblack = black+0.75; real axislength = 1.0; draw(L=Label("$x$", position=Relative(1.1), align=SW), O--axislength*X,thickblack, Arrow3); draw(L=Label("$y$", position=Relative(1.1), align=E), O--axislength*Y,thickblack, Arrow3); draw(L=Label("$z$", position=Relative(1.1), align=N), O--axislength*Z,thickblack, Arrow3); //Set parameters of start corner of polar volume element real r = 1; real q=0.25pi; //theta real f=0.3pi; //phi real dq=0.15; //dtheta real df=0.15; //dphi real dr=0.15; triple A = r*expi(q,f); triple Ar = (r+dr)*expi(q,f); triple Aq = r*expi(q+dq,f); triple Arq = (r+dr)*expi(q+dq,f); triple Af = r*expi(q,f+df); triple Arf = (r+dr)*expi(q,f+df); triple Aqf = r*expi(q+dq,f+df); triple Arqf = (r+dr)*expi(q+dq,f+df); pen thingray = gray+0.33; draw(A--Ar); draw(Aq--Arq); draw(Af--Arf); draw(Aqf--Arqf); draw( arc(O,A,Aq) ,thickblack ); draw( arc(O,Af,Aqf),thickblack ); draw( arc(O,Ar,Arq) ); draw( arc(O,Arf,Arqf) ); draw( arc(O,Ar,Arq) ); draw( arc(O,A,Af),thickblack ); draw( arc(O,Aq,Aqf),thickblack ); draw( arc(O,Ar,Arf) ); draw( arc(O,Arq,Arqf) ); pen thinblack = black+0.25; //phi arcs draw(O--expi(pi/2,f),thinblack); draw("$\varphi$", arc(O,0.5*X,0.5*expi(pi/2,f)),thinblack,Arrow3); draw(O--expi(pi/2,f+df),thinblack); draw( "$d\varphi$", arc(O,expi(pi/2,f),expi(pi/2,f+df) ),thinblack ); draw( A.z*Z -- A,thinblack); draw(L=Label("$r\sin{\theta}$",position=Relative(0.5),align=N), A.z*Z -- Af,thinblack); //cotheta arcs draw( arc(O,Aq,expi(pi/2,f)),thinblack ); draw( arc(O,Aqf,expi(pi/2,f+df) ),thinblack); //theta arcs draw(O--A,thinblack); draw(O--Aq,thinblack); draw("$\theta$", arc(O,0.25*length(A)*Z,0.25*A),thinblack,Arrow3); draw(L=Label("$d\theta$",position=Relative(0.5),align=NE) ,arc(O,0.66*A,0.66*Aq),thinblack ); // inner surface triple rin(pair t) { return r*expi(t.x,t.y);} surface inner=surface(rin,(q,f),(q+dq,f+df),16,16); draw(inner,emissive(gray+opacity(0.33))); //part of a nearly transparent sphere to help see perspective surface sphere=surface(rin,(0,0),(pi/2,pi/2),16,16); draw(sphere,emissive(gray+opacity(0.125))); // dr and rdtheta labels triple V= Af + 0.5*(Arf-Af); draw(L=Label("$dr$",position=Relative(1.1)), V--(1.5*V.x,1.5*V.y,V.z),dotted); triple U=expi(q+0.5*dq,f); draw(L=Label("$rd\theta$",position=Relative(1.1)), r*U ---r*(1.66*U.x,1.66*U.y,U.z),dotted ); \end{asy} \end{document} The code uses asymptote package to represent a volume element in spherical coordinates. Asymptote appears to be correctly installed in my MiKTeX distribution; however, the document does not compile and produces the following error: Package asymptote Warning: file `spy-1.pdf' not found on input line 15. (spy.aux)) No pages of output. Transcript written on spy.log. Sorry, but "MiKTeX Compiler Driver" did not succeed. I do not use Asymptote very often, so I am not sure about the cause of the problem. It is possible that the solution is related to what is discussed in the following TeX.StackExchange threads: 'filename-1.pdf' not found Asymptote Asymptote Code Generates .asy Files, But Asymptote Execution Fails In particular, I have not yet tried the solution proposed by the user user279206, and I do not know whether there is an alternative approach that would allow me to compile the document correctly with my MiKTeX distribution. In a previous question, I also asked whether it is possible to obtain the same arrow tip styles provided by Asymptote using TikZ: Arrows with spherical (conical) tips Since I do not understand Asymptote code, I kindly ask whether it would be possible to modify the original code by removing everything that is not strictly necessary, in order to obtain only the figure related to spherical coordinates, without the volume element and without additional unnecessary details to obtain this with the portion of a sphere. In TikZ there is a result: https://tikz.net/spherical_1/ This is my goal:

  • How to draw an arrow?
    by Marcus on October 18, 2025 at 7:54 pm

    How can I draw the following arrow? Here is the code for the boxes: \begin{tikzpicture} \def\w{2cm} \node[draw, rectangle, minimum width=\w, minimum height=1cm, anchor=west] (R1) at (0,0) {A}; \foreach [count=\i from 0] \letter in {A,B,C,D,E} { \node[draw, rectangle, minimum width=\w, minimum height=1cm, anchor=west] (R\i) at (\i*\w, 0) {\letter}; } \end{tikzpicture}

  • Custom Sidebar Table of Contents in Beamer
    by wrb98 on September 17, 2024 at 2:15 pm

    I'm working with a blank Beamer presentation template and want to recreate a sidebar similar to one shown in the image below. Unlike typical Beamer sidebars that extend to the page's edge, this one is part of a custom frame. I'd like the sidebar to display boxed sections with sharp drop shadows. The current section should be highlighted by a red shadow, while the current subsection should be bolded and appear on a white horizontal strip. Subsections from other sections should remain hidden until the presentation reaches that specific section, at which point they should appear in a dropdown list in the sidebar (e.g. in the image, we're on SO so subsections of SO are shown in the sidebar, but subsections of Section Two and Section Three are not). Note: By 'subsection' I really mean slide titles. How can I implement this effect in LaTeX? Any help would be appreciated. \documentclass[11pt]{beamer} \usepackage{tikz} \usepackage{microtype} \usepackage{xcolor} \usepackage{soul} \usetikzlibrary{calc} \usepackage{ lmodern, babel, amsmath, eurosym } \definecolor{darkpastelgreen}{rgb}{0.01, 0.75, 0.24} \usepackage[default]{sourcesanspro} \usepackage[T1]{fontenc} \setbeamertemplate{navigation symbols}{} \setbeamertemplate{background}{% \begin{tikzpicture}[overlay,remember picture] \fill[sharp corners,fill=darkpastelgreen] ($ (current page.north west) + (0.4cm,-0.4cm) $) rectangle ($ (current page.south east) + (-0.4cm,0.4cm) $); \end{tikzpicture}% \begin{tikzpicture}[overlay,remember picture] \fill[sharp corners,color=white] ($ (current page.north west) + (0.5cm,-0.5cm) $) rectangle ($ (current page.south east) + (-2cm,0.5cm) $); \end{tikzpicture}% } \setbeamersize{text margin left=0.8cm, text margin right=0.85cm} % Reduce side margins \setbeamertemplate{frametitle}{\color{black}\bfseries\insertframetitle \nointerlineskip \bigskip } \addtobeamertemplate{frametitle}{\vspace*{0cm}}{\vspace*{-0.4cm}} \addtolength{\headsep}{0.6cm} \begin{document} \begin{frame}[t]{} \frametitle{A Subsection} Slide content goes here... \end{frame} \end{document}

  • How to draw tangent lines of equal length at three equidistant points on a curved path?
    by myhsia on February 7, 2024 at 2:11 pm

    like the bend triangle below And the MWE is all I can draw. \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture} \draw (0,0) -- (4.5,0) -- (6,2) -- (1.5,2) -- cycle; \draw [xshift=3cm,yshift=1cm] (0,0) ellipse (1.2 and .6); \draw [xshift=3cm,yshift=1cm,->,teal] (0,.6) -- (.6,.6); \draw [xshift=3cm,yshift=1cm,->,teal] (1.2,0) -- (1.9,0); \draw [xshift=3cm,yshift=1cm,->,teal] (0,-.6) -- (.6,-.6); \draw [xshift=3cm,yshift=1cm,->,teal] ({-1.2*cos(30)},{-.6*sin(30)}) --++ (.6,0) node [above] {$v^a$}; \draw [xshift=3cm,yshift=1cm,->,teal] ({-1.2*cos(30)},{.6*sin(30)}) --++ (.6,0); \shade [xshift=3cm,yshift=1cm,ball color=teal] (-1.2,0) circle (.06); \end{tikzpicture} \end{document} Current result:

  • How can I draw a graph of adjacency matrix in Tikz? [closed]
    by MAHSA on October 6, 2023 at 12:31 am

    I want to draw this picture, but I can't How can help me?

  • How can I create a lightbox/microfilm effect?
    by crmdgn on October 25, 2020 at 12:15 am

    I'm putting together a beamer presentation, and in a moment of madness I had the idea to give it a sort of lightbox/microfilm/transparency effect, sort of like this or this or this. I tend to keep my slides very simple, so this is new territory for me. The only thing I can think to do is some sort of tikz gradient, but that doesn't really get me what I want: \documentclass{standalone} \usepackage{tikz} \usepackage{tcolorbox} \begin{document} \begin{tikzpicture} \fill [black!20] (-0.5,-0.5) rectangle (1.5,1.5); \path [pattern color=black!30] (-0.5,-0.5) rectangle (1.5,1.5); \tcbvignette{fade in=black} \end{tikzpicture} \end{document} That gives you more of a picture frame effect with mitered corners, as here: Is there another approach I can be taking? Is this even within the limits of tikz?

  • Seven segment display with TikZ
    by current_user on January 6, 2019 at 5:36 pm

    Consider the following MWE: \documentclass[border=5pt,tikz]{standalone} \usepackage{ifthen} \newcommand{\binary}[3]{ \pgfmathsetmacro\number{int(#1*2^0+#2*2^1+#3*2^2)} } \newcommand{\sieben}[1]{ \draw[gray,opacity=.3,line width=3pt] (0,0) --+ (0,.5); \draw[gray,opacity=.3,line width=3pt] (0,.6) --+ (0,.5); \draw[xshift=.7cm,gray,opacity=.3,line width=3pt] (0,0) --+ (0,.5); \draw[xshift=.7cm,gray,opacity=.3,line width=3pt] (0,.6) --+ (0,.5); \draw[gray,opacity=.3,line width=3pt] (.1,1.18) --+ (.5,0); \draw[gray,opacity=.3,line width=3pt] (.1,-.05) --+ (.5,0); \draw[gray,opacity=.3,line width=3pt] (.1,.55) --+ (.5,0); \ifthenelse{\equal{#1}{0}}{ \draw[red,line width=3pt] (0,0) --+ (0,.5); \draw[red,line width=3pt] (0,.6) --+ (0,.5); \draw[xshift=.7cm,red,line width=3pt] (0,0) --+ (0,.5); \draw[xshift=.7cm,red,line width=3pt] (0,.6) --+ (0,.5); \draw[red,line width=3pt] (.1,1.18) --+ (.5,0); \draw[red,line width=3pt] (.1,-.05) --+ (.5,0); }{} \ifthenelse{\equal{#1}{1}}{ \draw[xshift=.7cm,red,line width=3pt] (0,0) --+ (0,.5); \draw[xshift=.7cm,red,line width=3pt] (0,.6) --+ (0,.5); }{} \ifthenelse{\equal{#1}{2}}{ \draw[red,line width=3pt] (.1,1.18) --+ (.5,0);; \draw[xshift=.7cm,red,line width=3pt] (0,.6) --+ (0,.5); \draw[red,line width=3pt] (.1,.55) --+ (.5,0); \draw[red,line width=3pt] (0,0) --+ (0,.5); \draw[red,line width=3pt] (.1,-.05) --+ (.5,0); }{} \ifthenelse{\equal{#1}{3}}{ \draw[xshift=.7cm,red,line width=3pt] (0,0) --+ (0,.5); \draw[xshift=.7cm,red,line width=3pt] (0,.6) --+ (0,.5); \draw[red,line width=3pt] (.1,1.18) --+ (.5,0); \draw[red,line width=3pt] (.1,-.05) --+ (.5,0); \draw[red,line width=3pt] (.1,.55) --+ (.5,0); }{} \ifthenelse{\equal{#1}{4}}{ \draw[red,line width=3pt] (0,.6) --+ (0,.5); \draw[xshift=.7cm,red,line width=3pt] (0,0) --+ (0,.5); \draw[xshift=.7cm,red,line width=3pt] (0,.6) --+ (0,.5); \draw[red,line width=3pt] (.1,.55) --+ (.5,0); }{} \ifthenelse{\equal{#1}{5}}{ \draw[red,line width=3pt] (0,.6) --+ (0,.5); \draw[xshift=.7cm,red,line width=3pt] (0,0) --+ (0,.5); \draw[red,line width=3pt] (.1,1.18) --+ (.5,0); \draw[red,line width=3pt] (.1,.55) --+ (.5,0); \draw[red,line width=3pt] (.1,-.05) --+ (.5,0); }{} \ifthenelse{\equal{#1}{6}}{ \draw[red,line width=3pt] (0,0) --+ (0,.5); \draw[red,line width=3pt] (0,.6) --+ (0,.5); \draw[xshift=.7cm,red,line width=3pt] (0,0) --+ (0,.5); \draw[red,line width=3pt] (.1,1.18) --+ (.5,0); \draw[red,line width=3pt] (.1,-.05) --+ (.5,0); \draw[red,line width=3pt] (.1,.55) --+ (.5,0); }{} \ifthenelse{\equal{#1}{7}}{ \draw[xshift=.7cm,red,line width=3pt] (0,0) --+ (0,.5); \draw[xshift=.7cm,red,line width=3pt] (0,.6) --+ (0,.5); \draw[red,line width=3pt] (.1,1.18) --+ (.5,0); }{} \ifthenelse{\equal{#1}{8}}{ \draw[red,line width=3pt] (0,0) --+ (0,.5); \draw[red,line width=3pt] (0,.6) --+ (0,.5); \draw[xshift=.7cm,red,line width=3pt] (0,0) --+ (0,.5); \draw[xshift=.7cm,red,line width=3pt] (0,.6) --+ (0,.5); \draw[red,line width=3pt] (.1,1.18) --+ (.5,0); \draw[red,line width=3pt] (.1,-.05) --+ (.5,0); \draw[red,line width=3pt] (.1,.55) --+ (.5,0); }{} \ifthenelse{\equal{#1}{9}}{ \draw[red,line width=3pt] (0,.6) --+ (0,.5); \draw[xshift=.7cm,red,line width=3pt] (0,0) --+ (0,.5); \draw[xshift=.7cm,red,line width=3pt] (0,.6) --+ (0,.5); \draw[red,line width=3pt] (.1,1.18) --+ (.5,0); \draw[red,line width=3pt] (.1,-.05) --+ (.5,0); \draw[red,line width=3pt] (.1,.55) --+ (.5,0); }{} \ifthenelse{\equal{#1}{a}}{ \draw[red,line width=3pt] (0,0) --+ (0,.5); \draw[red,line width=3pt] (0,.6) --+ (0,.5); \draw[xshift=.7cm,red,line width=3pt] (0,0) --+ (0,.5); \draw[xshift=.7cm,red,line width=3pt] (0,.6) --+ (0,.5); \draw[red,line width=3pt] (.1,1.18) --+ (.5,0); \draw[red,line width=3pt] (.1,.55) --+ (.5,0); }{} % \ifnum#1>9 % \draw[red,line width=3pt] (0,0) --+ (0,.5); % \draw[red,line width=3pt] (0,.6) --+ (0,.5); % \draw[red,line width=3pt] (.1,1.18) --+ (.5,0); % \draw[red,line width=3pt] (.1,-.05) --+ (.5,0); % \draw[red,line width=3pt] (.1,.55) --+ (.5,0); % \fi } \begin{document} \begin{tikzpicture}[xslant=0] \sieben{a} \begin{scope}[xshift=1.5cm] \binary{1}{1}{1} % seven in dual system \sieben{\number} \end{scope} \end{tikzpicture} \end{document} Here is the output: My problem is: When I uncomment the commented part in the definition of the command (\ifnum#1>9 …) and I type as an argument the letter "a", I get an error. But when I comment this part, I don't. My question is: How can I fix this error?

  • Tikzpicture /pfgplots in list of figures:
    by Jules Lecoustre on April 21, 2018 at 9:46 am

    I'm a beginner with LaTeX and i have insert graph, with a csv file and pfgplots But how can i have the title of the graph in the list of figures. Thank you \begin{center} \begin{tikzpicture} \begin{axis}[% title={$U=E-R\cdot I$ représentation graphique}, no markers, xmin=0, xmax=10, ymin=12, ymax=14, ] \draw[<->,thin] (axis cs:9, 12.5625) -- (axis cs:9, 13); \draw[<->,thin] (axis cs:0, 13.125) -- (axis cs:9, 13.125); \node at (axis cs:9.5,12.784){$\Delta U$}; \node [above] at (axis cs:4.5,13.125){$\Delta I$}; \draw [-,semithick,red] (axis cs:0, 13) -- (axis cs:10, 13); \draw [<-,semithick] (axis cs: 4,12.8) -- (axis cs:4,12.75); \draw [->,semithick] (axis cs: 4,12.75) -- (axis cs:5,12.75); \node [below] at (axis cs:4.5,12.75){$\dfrac{dU(I)}{dI}=-R$}; \addplot table [x=I, y=U, col sep=comma] {test.csv}; \end{axis} \end{tikzpicture} \end{center}

  • beamer package - tikz externalize and animations
    by Wanderer on December 7, 2016 at 5:48 pm

    I'm having a somewhat larger project, so I have split it up into multiple files and externalized the tikz figures to reduce compilation time. The basic setup is as follows: Let's say I have a folder Main on the lowest level, that contains a folder Sub and a file Main.tex, which has the following content: \documentclass{beamer} \usepackage{tikz} \usetikzlibrary{external, matrix} \tikzexternalize{Main} % taken from: http://tex.stackexchange.com/questions/136143/tikz-animated-figure-in-beamer \tikzset{invisible/.style={opacity=0}, visible on/.style={alt={#1{}{invisible}}}, alt/.code args={<#1>#2#3}{\alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}},} \begin{document} \tikzset{external/export=false} \include{Sub/Sub} \end{document} In the folder Sub, I have another folder Tikzand a file Sub.tex, which has the following content: \tikzsetexternalprefix{Sub/Tikz/img_} \begin{frame}{Test} \begin{figure} \tikzset{external/export=true} \tikzsetnextfilename{Test} \input{Sub/Tikz/Test.tikz} \end{figure} \begin{itemize} \item A \item B \end{itemize} \end{frame} In the folder Tikz I have a file Test.tikz, which has the following content: % taken from: http://tex.stackexchange.com/questions/136143/tikz-animated-figure-in-beamer \begin{tikzpicture} \matrix (magic) [matrix of nodes, ampersand replacement=\&, column sep=7mm, row sep=5mm]{ \node (se) [draw,shape=rectangle,visible on=<5->] {Existence Forte}; \& \node (yw) [draw,shape=circle,visible on=<1->] {Yamada-watanab}; \& \node (ul) [draw,shape=rectangle,visible on=<9->] {Unicité en Loi}; \\ \node (d1) [draw,shape=circle,visible on=<6->] {Définition}; \& \& \node (d2) [draw, shape=circle,visible on=<8->] {Définition}; \\ \node (we) [draw, shape=rectangle,visible on=<2->] {Existence Faible}; \& \node (ec) [draw, shape=circle,visible on=<10->] {Engelbert-Cherny}; \& \node (pu) [draw, shape=rectangle,visible on=<3->] {Unicité Trajectorielle}; \\ }; \draw[->, thick,visible on=<6->] (se) -- (d1); \draw[->, thick,visible on=<7->] -- (we); \draw[->, thick,visible on=<4->] (we) -- (yw); \draw[->, thick,visible on=<5->] (yw) -- (se); \draw[->, thick,visible on=<11->] (se) -- (ec); \draw[->, thick,visible on=<11->] (ul) -- (ec); \draw[->, thick,visible on=<12->] (ec) -- (pu); \draw[->, thick,visible on=<4->] (pu) -- (yw); \draw[->, thick,visible on=<8->] (pu) -- (d2); \draw[->, thick,visible on=<9->] (d2) -- (ul); \end{tikzpicture} What I now want to achieve is, that every page from the file img_Test.pdf (generated by compiling the code) is shown on its own frame in the presentation with the items A and B below, so it looks like an animation if one is clicking down the slides. But what I currently get is just a one-paged pdf showing just the first page of the figure and no items. If I just set tikzset{external/export=true} to false, everything works just fine, so it is just the externalization that causes this problem. I'm using the TeX Live distribution from the official Ubuntu repositories, do the editing with TeXstudio and compile with PdfLaTeX using the command pdflatex -synctex=1 -interaction=nonstopmode --shell-escape %.tex. The --shell-escape command is non-default, but I need it to get my tikz pictures compiled.

  • Adding vertical hierarchy lines to a category column of a table
    by badroit on August 8, 2014 at 8:15 pm

    I often need to represent hierarchies within tables but I've yet to find an elegant way to do this. Oftentimes I do a variation on the following theme, with nested whitespace in the category column: \documentclass{article} \usepackage{booktabs} \newcommand{\lvl}{~~~} \begin{document} \begin{tabular}{lr} \toprule \textbf{Category} & \textbf{\%}\\ \midrule Animal & 100 \\ \lvl Human & 50 \\ \lvl\lvl Man & 20 \\ \lvl\lvl Woman & 30 \\ \lvl Fox & 30 \\ \lvl\lvl Vixen & 16 \\ \lvl\lvl Dog & 14 \\ \lvl Chicken & 20 \\ \lvl\lvl Cock & 8 \\ \lvl\lvl Hen & 12 \\ \bottomrule \end{tabular} \end{document} I might mix that up with midrules between categories and different fonts for different levels and so on. But the result can sometimes be very "busy", especially if there's a bunch of levels. Instead, I was playing around with the idea of adding lines to more elegantly represent the hierarchy, sketched as follows in red (a similar effect in the same spirit would also suffice): But I'm not sure how to realise this in LaTeX in an elegant way. I'm guessing I could somehow decorate a table with TikZ but I'd only know how to specify manual points (e.g., I'm not sure how to anchor rows in a table). Thus I'm looking for any suggestions of elegant solutions to achieve the above effect. (An ideal answer would avoid explicit coordinates/distances and would be "highly reusable".)

  • How to insert a linebreak in a TikZ matrix node?
    by Tim N on May 6, 2013 at 6:34 am

    How can I get a linebreak inside a matrix node? The following gives the error: Package tikz Error: Giving up on this path. Did you forget a semicolon?. unless I remove the linebreak. \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{chains} \usetikzlibrary{matrix} \begin{document} \begin{tikzpicture} \matrix (m) [ matrix of nodes ] { {some text} & {this node \\ does not work} \\ {other text} & {more text} \\ }; \end{tikzpicture} \end{document}

  • Overlay diagrams in TikZ
    by MYaseen208 on December 6, 2012 at 3:28 pm

    I want to join the vertices labeled as (1), b, abc, and ac but could not succeed. I'd highly appreciate if you point me out what I'm doing wrong and what is the solution. Thanks \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture}[scale = 4, fill opacity = 1.0, thick, line cap = round, line join = round] %% Define coordinate labels. % t(op) and b(ottom) layers \path \foreach \layer/\direction in {b/{0, 0, 0}, t/{0, 1, 0}} { (\direction) \foreach \point/\label in {{0, 0, 0}/ll, {1, 0, 0}/lr, {1, 0, -1}/ur, {0, 0, -1}/ul} { +(\point) coordinate (\layer\label) } ($(\layer ll)!0.5!(\layer ur)$) coordinate (\layer md) }; % Put text next to the labels as requested. % Funilly enough we need to set fill opacity to 1. \draw \foreach \text/\label/\anchor in {% $\left(1\right)$/bll/east, $b$/bul/east, $c$/tll/east, $bc$/tul/east, $a$/blr/west, $ab$/bur/west, $ac$/tlr/west, $abc$/tur/west} { (\label) node[anchor=\anchor, fill opacity = 1] {\text} }; % Draw cube. \fill (0, 0, -1) circle (0.5pt); \foreach \direction in {(0, 0, 1), (0, 1, 0), (1, 0, 0)} { \draw[dashed, black] (bul) -- + \direction; } \fill[red!60, opacity=0.5] (tll) -- (tul) -- (bur) -- (blr); \fill[blue!60, opacity=0.5] (bll) -- (bul) -- (tur) -- (tlr); \draw (bll) -- (blr) -- (tlr) -- (tll) -- cycle; \draw (blr) -- (bur) -- (tur) -- (tlr) -- cycle; \draw (tll) -- (tlr) -- (tur) -- (tul) -- cycle; \foreach \point in {bll, blr, bur, tll, tlr, tul, tur} { \fill[fill opacity=1] (\point) circle (0.75pt); } \node[below] at (1.0, -0.2, 0.0) {$AC$}; \end{tikzpicture} \end{document}

  • Create a math matrix in TikZ partition lines
    by aagaard on August 26, 2011 at 3:51 pm

    I want to draw a math matrix in TikZ, where I can draw helping partition lines. So far I found it pretty simple to just draw a matrix with brackets. \begin{tikzpicture} \matrix [matrix of math nodes,left delimiter={[},right delimiter={]}] { 1 & 2 & 1 & 0 & 0 & 10 \\ 3 & 2 & 0 & 1 & 0 & 20 \\ -2 & -10 & 0 & 0 & 1 & 0 \\ }; \end{tikzpicture} However, I would like to partition the matrix with a vertical line between columns 5 and 6, and a horizontal line between rows 2 and 3. Furthermore it could nice to have "identification variables" outside the brackets (top).

  • How can I do this diagram with tikz?
    by Peter E on July 11, 2011 at 8:05 pm

    How can I do this diagram with tikz?