• pgf-PeriodicTable: usage of 'cell width' / 'cell height' ruins the layout
    by cis on April 25, 2026 at 8:55 am

    I want a full-page periodic table - in height and width! (Because I want to add external graphics as an overlay to the cells. That means a simple/artificial enlargement using scalebox or something similar is not useful.) As a test, I tried: cell width=40pt, cell height=50pt, but it ruins the layout (icons and text overlap or shift). What do I have to do? \documentclass[]{article} \usepackage[ showframe=true, a4paper, landscape, margin=10mm, ]{geometry} \usepackage{pgf-PeriodicTable} \begin{document} \noindent\pgfPT[ cell width=40pt,% example from manual, p. 22 cell height=50pt,% example from manual, p. 22 name font=\normalfont, show title=false, show legend=false, ] \end{document}

  • 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}

  • Tikz pie chart with units
    by Thomas on April 24, 2026 at 1:07 pm

    I have a pie chart representing a distribution of hours, and I'm using the option sum=auto to display the chat by these values. But I'd like to add the unit of the values inside the plot. If I type 12~h/Maths it raises error because LaTeX tries to compute the percentages. How could I achieve it ? \documentclass{article} \usepackage{pgf-pie} \begin{document} \begin{tikzpicture} \pie[sum = auto]{ 12/Maths, 9/Physique-Chimie, 2/Informatique, 2/TIPE, 2/Français } \end{tikzpicture} \end{document}

  • pgf-PeriodicTable: produce a gap at La and Ac
    by cis on April 24, 2026 at 1:36 am

    How could I create a gap here (as seen sometimes)? \documentclass[landscape]{article} \usepackage[margin=11mm]{geometry} \usepackage{pgf-PeriodicTable} \tikzset{every picture/.append style={remember picture}} \begin{document} \pgfPT[ show title=false, show legend=false, IUPAC=false,% puts La and Ac above ] % Test \begin{tikzpicture}[remember picture, overlay] \node[fill, inner sep=0pt, minimum size=2mm, cyan, text=red] at (3.center) {UL}; \end{tikzpicture} \end{document}

  • LaTeX economics draft for test [closed]
    by Evaggelia Lanaridy on April 23, 2026 at 3:07 pm

    \begin{tikzpicture} % Άξονες \draw[->, thick] (0,0) -- (5,0) node[right] {Q (Ποσότητα)}; \draw[->, thick] (0,0) -- (0,5) node[above] {P (Τιμή)}; % Αρχική Καμπύλη Ζήτησης D1 \draw[thick, blue] (0.5,4) -- (4,0.5) node[right] {$D$}; % Νέα Καμπύλη Ζήτησης D2 (Μετατόπιση δεξιά) \draw[thick, red] (1.5,4.5) -- (5,1) node[right] {$D_1$}; % Σταθερή Τιμή P1 \draw[dashed] (0,2.5) node[left] {$P_1$} -- (3.75,2.5); % Σημεία και Ποσότητες \draw[dashed] (2,2.5) -- (2,0) node[below] {$Q_1$}; \draw[dashed] (3.75,2.5) -- (3.75,0) node[below] {$Q_2$}; % Βέλος μετατόπισης \draw[->, bend left, thick] (2.2,3) -- (3.3,3.4) node[midway, above] {$\Delta\epsilon\xi\iota\alpha$}; \end{tikzpicture}

  • Aligning TikZ grids between tcolorbox overlays and page background
    by Christopher Madec on April 21, 2026 at 9:13 pm

    I am working on a layout where I draw a grid in two different contexts: Inside tcolorbox environments (using an overlay) In the page margin using \AddToShipoutPicture Here is a minimal example: \documentclass[11pt,a4paper,svgnames]{book} \RequirePackage[top=2cm, bottom=2cm, left=3.9cm, right=1cm]{geometry} \usepackage[most]{tcolorbox} \newcommand{\myoverlay}{ \begin{tcbclipinterior}%[remember picture,overlay] \draw[%shift=(current page.north west), step=0.524cm,white!70!gray,very thin] (interior.north west) grid (interior.south east); \end{tcbclipinterior} } \newtcolorbox{Box4}[1][ bicolor, colback=white!05,grow to left by=2.5cm,colbacklower=black, boxrule=0.5pt,overlay=\myoverlay]{#1} \newtcolorbox{Box4bis}[1][ bicolor,colback=white,colbacklower=black, grow to left by=0cm,grow to right by=0cm, boxrule=0pt, overlay=\myoverlay] {#1} \usepackage{lipsum} \usepackage[]{eso-pic} \begin{document} \AddToShipoutPicture{% \begin{tikzpicture} \draw[shift=(current page.north west),step=5.24mm, lightgray, very thin, opacity=0.5] ([xshift=0cm,yshift=0cm]current page.south west) grid ([xshift=3.7cm,yshift=0cm]current page.north west); \draw[black, very thick, opacity=0.3] ([xshift=3.7cm]current page.south west) -- ([xshift=3.7cm]current page.north west); \end{tikzpicture}% } \begin{Box4bis} \lipsum[1] \end{Box4bis} \begin{Box4} \lipsum[2] \end{Box4} \lipsum[3] \begin{Box4} \lipsum[4] \end{Box4} \begin{Box4bis} \lipsum[5] \end{Box4bis} \end{document} The code gives this: Goal I would like the grids drawn: inside the tcolorbox environments in the page margin (via shipout) to be perfectly aligned, so that the grid appears continuous across the whole page. What I have tried Using current page coordinates inside the tcolorbox overlay Adding remember picture, overlay and current page.north page and retrieve absolute positions (see tikz: How can I find the value of `current page.north west`?) Trying to manually shift grids to match visually (impossible) However, I could not find a reliable way to make both grids share the same reference system.

  • Plot a domain in 3D with TikZ for a triple integral
    by Sebastiano on April 20, 2026 at 9:59 pm

    I have to solve this triple integral ∭ x y|z|³/(1+ (x²+y²)⁴)  dx  dy dz, with a domain T={(x, y, z) ∈ ℝ³: x ≤ 0, y ≥ 0, z² ≤ x²+y² ≤ 1}. Plotting with DESMOS 3D I see this: Actually I am not able to visualise this domain in my mind. It should be a cylinder enclosed by a double-sloped cone, but I can’t quite get the x ≤ 0, y ≥ 0 parameters right. I’ve created something but I would like my drawing (or a new one) to be intuitive with TikZ3D so that I can correctly draw this integral. My MWE: \documentclass[12pt]{article} \usepackage{tikz} \usepackage{tikz-3dplot} \tdplotsetmaincoords{60}{130} \begin{document} \begin{tikzpicture}[tdplot_main_coords, scale=3] % assi \draw[->] (0,0,0) -- (1.3,0,0) node[right]{$x$}; \draw[->] (0,0,0) -- (0,1.3,0) node[left]{$y$}; \draw[->] (0,0,0) -- (0,0,1.3) node[above]{$z$}; \foreach \t in {0,1,...,359}{ \pgfmathsetmacro{\ct}{cos(\t)} \pgfmathsetmacro{\st}{sin(\t)} \draw[blue!60, opacity=0.75] (0,0,0) -- plot[domain=0:1, samples=40] ({\x*\ct},{\x*\st},{\x}); \draw[red!60, opacity=0.75] (0,0,0) -- plot[domain=0:1, samples=40] ({\x*\ct},{\x*\st},{-\x}); } \draw[thick] plot[domain=0:360, samples=200] ({cos(\x)},{sin(\x)},1); \draw[thick] plot[domain=0:360, samples=200] ({cos(\x)},{sin(\x)},-1); \end{tikzpicture} \end{document}

  • Using `annotate-equations` library to annotate matrix row and column labels
    by Tianjian Qin on April 20, 2026 at 7:20 pm

    The annotate-equations library looks nice. I wanted to use the library to annotate matrix row and column labels, but it didn't work out. Below is a minimal standalone example where the first tikzpicture is simply the matrix with row and column labels. The second tikzpicture is my attempt to add annotations: \documentclass[tikz,border=6pt]{standalone} \usepackage{amsmath} \usepackage{tikz} \usepackage{annotate-equations} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \node[ anchor=center, inner sep=0pt, outer sep=0pt ] (nodematrix) at (0,0) {% {\scriptsize \renewcommand{\arraystretch}{0.88}% $\left[ \begin{array}{@{}c|ccc@{}} & \mathbf{X} & \mathbf{Y} & \mathbf{Z} \\ \mathbf{A} & 1 & 0 & 0 \\ \mathbf{B} & 0 & 1 & 0 \\ \mathbf{C} & 0 & 1 & 0 \\ \mathbf{D} & 0 & 1 & 1 \\ \mathbf{E} & 1 & 0 & 0 \\ \mathbf{F} & 0 & 0 & 1 \end{array} \right]$}% }; \end{tikzpicture} \begin{tikzpicture}[remember picture] \node[ anchor=center, inner sep=0pt, outer sep=0pt ] (nodematrix) at (0,0) {% {\scriptsize \renewcommand{\arraystretch}{0.88}% $\left[ \begin{array}{@{}c|ccc@{}} & \tikzmarknode{md-colX}{\mathbf{X}} & \tikzmarknode{md-colY}{\mathbf{Y}} & \tikzmarknode{md-colZ}{\mathbf{Z}} \\ \tikzmarknode{md-rowA}{\mathbf{A}} & 1 & 0 & 0 \\ \tikzmarknode{md-rowB}{\mathbf{B}} & 0 & 1 & 0 \\ \tikzmarknode{md-rowC}{\mathbf{C}} & 0 & 1 & 0 \\ \tikzmarknode{md-rowD}{\mathbf{D}} & 0 & 1 & 1 \\ \tikzmarknode{md-rowE}{\mathbf{E}} & 1 & 0 & 0 \\ \tikzmarknode{md-rowF}{\mathbf{F}} & 0 & 0 & 1 \end{array} \right]$}% }; \end{tikzpicture} \annotate[ xshift=-2.8em, yshift=-4.5ex ]{below}{md-rowF}{data nodes $V$} \annotate[ xshift=1.2em, yshift=1.0em ]{above}{md-colX,md-colY,md-colZ}{metadata nodes $U$} \end{document} Here is the compile pdf output: The original matrix: The annotated matrix (where I see two additional empty patches, and no annotation showed up): I cannot figure out what happened here.

  • add a grid background only inside a tabular column
    by Christopher Madec on April 19, 2026 at 5:19 pm

    I am trying to create a worksheet layout in LaTeX where one column of a table contains a writing area with a grid (like squared paper), while the other column contains several questions (Here is an example with just one question). \documentclass{article} \usepackage{array} \usepackage{xcolor} \usepackage{geometry} % \usepackage{arydshln} \usepackage{lipsum} \geometry{a4paper, left=0.35in, right=-0.1in, top=0.6in, bottom=0.4in} \definecolor{burgundy}{HTML}{8B2252} \usepackage{scrlayer-scrpage} \usepackage{tikz} \newcommand*\Circled[1]{\tikz[baseline=(char.base)]{\textcolor{burgundy}{\node[shape=circle,draw,inner sep=2pt] (char) {#1};}}} \usepackage{tikzducks} \usetikzlibrary{calc} \newcommand{\pageframe}{% \begin{tikzpicture}[remember picture, overlay] \fill [burgundy!80!white] (current page.north west) rectangle (current page.south east); \fill [white, rounded corners=1cm] ($(current page.north west)+(0.5cm,-1cm)$) rectangle ($(current page.south east)+(-0.5cm,1cm)$); \node [align=center] at ($(current page.north)+(0,-0.6cm)$) {$\color{white}\mathrm{Chapitre \ 2 - Diffusion \ thermique}$}; \node [align=center] at ($(current page.south)+(0,1.9cm)$) {\centering\begin{tikzpicture}[scale=0.5] \shuffleducks \duck[\randomhead,\randomaccessories, /tikz/nodes={scale/.evaluated={\value{page}>99?0.4:0.6},font=\bfseries}, signpost=\scalebox{1.6}{ \parbox{6cm}{\hspace{-0.4em}\color{black} \centering\thepage}}, signback =white] \end{tikzpicture}}; %%% Background grid \draw[step=5mm, gray!30, very thin] ($(current page.north west)+(7cm,-1.5cm)$) grid ($(current page.south east)+(-1cm,5cm)$); \end{tikzpicture} } \cehead[\pageframe]{\pageframe} \cohead[\pageframe]{\pageframe} \pagestyle{scrheadings} % Another try \usepackage{makecell} \newcommand{\gridcell}[1][4cm]{% \begin{tikzpicture} \draw[step=5mm, gray!40, very thin] (0,-0.2) grid (\linewidth, #1); \end{tikzpicture}% } \begin{document} \renewcommand{\arraystretch}{6} \begin{tabular}{>{\centering\raggedright}m{0.25\textwidth}||>{\centering\arraybackslash}m{0.60\textwidth}} \Circled{1} \'Enoncer le théorème de Green-Ostrograski & \\ \hline \end{tabular} \end{document} Goal I would like the second column of the table to contain a grid background (like graph paper) so that students can write their answers. I want to find the best way to create a grid (squared background) that is confined to a specific table column, and that does not overflow outside the table. What I tried so far Using a page-wide background grid, but it overflows outside the table and does not align with the table structure \draw[step=5mm, gray!30, very thin] ($(current page.north west)+(7cm,-1.5cm)$) grid ($(current page.south east)+(-1cm,5cm)$); \end{tikzpicture} The code looks like this: Drawing a grid with TikZ inside a cell → does not scale correctly with row height \newcommand{\gridcell}[1][4cm]{% \begin{tikzpicture} \draw[step=5mm, gray!40, very thin] (0,-0.2) grid (\linewidth, #1); \end{tikzpicture}% }

  • TikZ nodes within a scope are not projected
    by Tianjian Qin on April 19, 2026 at 4:55 pm

    I'm trying to draw a 3D panel, within each panel there are dashed panel frame, some circles, lines connecting the circles, text, and maybe other objects. I tried to draw all these within a scope, then apply a projection so that all of these drawings can be 3D-rotated, but this trick only works on the panel frame, not properly on the other objects, see the screenshot: And here is the standalone tex code: \documentclass[tikz,border=6pt]{standalone} \usepackage{xcolor} \usetikzlibrary{arrows.meta,calc} % Example colors \definecolor{Accent}{RGB}{60,90,150} \definecolor{PersistCol}{RGB}{70,130,90} \definecolor{ReactCol}{RGB}{180,110,60} \definecolor{NewCol}{RGB}{180,70,80} \begin{document} \begin{tikzpicture}[ font=\small, >=Latex, side layer projection/.style={x={(0.46cm,0.25cm)}, y={(0cm,0.75cm)}}, frame/.style={ draw=black!78, dashed, line width=.72pt, dash pattern=on 5pt off 4pt, line cap=round }, v/.style={ circle, draw=gray!55, fill=gray!22, minimum size=4pt, inner sep=0pt }, pe/.style={draw=PersistCol, line width=1.0pt}, re/.style={draw=ReactCol, line width=1.0pt}, ne/.style={draw=NewCol, line width=1.0pt} ] \def\P{1.10} \newcommand{\PlaneFrame}{% \draw[frame] (-\P,-\P)--(\P,-\P)--(\P,\P)--(-\P,\P)--cycle; } \newcommand{\PlaneLabel}[1]{% \path (-.86,-\P)--(.86,-\P) node[midway, below=2pt, sloped, transform shape, font=\scriptsize] {#1}; } \newcommand{\PoolNodes}{% \node[v] (a) at (-.75,.55) {}; \node[v] (b) at (-.10,.88) {}; \node[v] (c) at (.68,.42) {}; \node[v] (d) at (-.70,-.55) {}; \node[v] (e) at (.65,-.55) {}; } % One projected layer only \begin{scope}[side layer projection] \PlaneFrame \PlaneLabel{selected \(E_t^\star\)} \PoolNodes \draw[pe] (a)--(b); \draw[re] (d)--(e); \draw[ne] (c)--(e); \end{scope} \end{tikzpicture} \end{document} What I did wrong here? UPDATE: Just tried to add \usetikzlibrary{3d} and use something like \begin{scope}[canvas is zy plane at x=0, every node/.style={transform shape}]. This only solve the issue in text and circles, not the edges (straight lines):

  • Arrow tips look wrong at the end of a plot
    by Muhannad Al Ayoubi on April 19, 2026 at 4:31 pm

    I have a weird problem with arrow heads at the end of plots, where they look wrong, as you can see in the picture (look below left; the line seems to exceed the arrow tip). Removing colour or changing thickness did not solve the problem. Interestingly, making the arrow longer does fix the issue, but is not a plausible fix. Also increasing the scale seems to hide the issue, but I would not like to do that, as diagrams would get too big. This issue does not appear with the longer parabola or the blue line which I drew normally. Here is an MWE. \documentclass[10pt]{book} \usepackage{tikz} \usetikzlibrary{arrows.meta} % Tikz libraries \tikzset{>={Stealth}} \begin{document} \begin{tikzpicture}[scale=0.4] \draw[->, thick, red, domain=-1:3.5, variable=\t, smooth, samples=75] plot ({\t,2-0.5*\t*\t}); \draw[<-, thick, red, domain=-2:-0.5, variable=\t, smooth, samples=75] plot (2*\t,\t-1); \draw[draw=red, fill=white] (-1,-1.5) circle (4pt); \draw[thick, blue,<->] (0,-3) -- (1,-2); \draw[red, fill] (-1,1.5) circle (4pt); \end{tikzpicture} \end{document} Any idea what is going wrong? And how to fix it? Zoomed in picture on the issue:

  • How to construct the "double dotted"-framed box?
    by Explorer on April 18, 2026 at 3:04 am

    What I tried to replicate is something as below: Noted that the double-dotted is aligned as the red line denoted, and the "rotated box" is NOT what I want(just because the image I get rotated itself), I just want something the same as \dashbox or \doublebox, the normal horizonal box. The post here, I think, just want to focus the dots alignment. Now I have the following code: \documentclass{article} \usepackage[most]{tcolorbox} \usepackage{tikz} \usepackage{lipsum} \usepackage{dashbox} \usepackage{fancybox} % https://tex.stackexchange.com/a/101263/322482 \makeatletter \tikzset{ dot diameter/.store in=\dot@diameter, dot diameter=3pt, dot spacing/.store in=\dot@spacing, dot spacing=10pt, dots/.style={ line width=\dot@diameter, line cap=round, dash pattern=on 0pt off \dot@spacing }, } \tcbset{ doubledotted/.style={ empty, sharp corners, frame engine=path, frame empty, frame code={ \draw[dots](frame.south west) rectangle (frame.north east); \draw[dots]([xshift=-\dot@spacing,yshift=-\dot@spacing]frame.south west) rectangle ([xshift=\dot@spacing,yshift=\dot@spacing]frame.north east); }, } } \makeatother \begin{document} AAA \qquad\tcbox[doubledotted,nobeforeafter,box align=center]{This is a tcolorbox.}\qquad BBB \vspace{1cm} \begin{tcolorbox}[doubledotted] \lipsum[2] \end{tcolorbox} \bigskip \fbox{This is a framebox.} \dashbox{This is a dashed framebox.} \doublebox{This is a doublebox.} \end{document} which gives: The disturbing point is that the dotted in a \path is hard to control the alignment precisely. I have to cliam that, I think that would be two different approach to achieved this: One with tcolorbox and tikz Another with some "plain" approaches for example dashedbox and fancybox: fancybox.sty: % fancybox.sty % Line 143 \def\doublebox{\VerbBox\@doublebox} \def\@doublebox#1{% \begingroup \setbox\@fancybox\hbox{{#1}}% \fboxrule=.75\fboxrule \setbox\@fancybox\hbox{\fbox{\box\@fancybox}}% \fboxrule=2\fboxrule \fboxsep=\fboxrule \advance\fboxsep .5pt \fbox{\box\@fancybox}% \endgroup} dashbox.sty: %% %% This is file `dashbox.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% dashbox.dtx (with options: `package') %% Dashed and layered boxes. %% %% File `dashbox.dtx'. %% Copyright (C) 1997-2001 Reuben Thomas (rrt@sc3d.org) %% This file is distributed under the LaTeX Project Public License, %% and comes with no warranty. %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{dashbox} [2001/12/11 v1.14 Dashed and layered boxes] \RequirePackage{calc} \RequirePackage{ifthen} \newlength{\dashlength} \setlength{\dashlength}{6pt} \newlength{\dashdash} \setlength{\dashdash}{3pt} \newlength{\layersize} \setlength{\layersize}{\dashdash} \newcommand{\hd@shrule}[1]{% \hbox to #1% {\vrule height \fboxrule width \dashdash% \cleaders\hbox to \dashlength% {\hfill\rule{\dashdash}{\fboxrule}\hfill}\hfill% \ifthenelse{\lengthtest{#1 > 2\dashdash}}% {\vrule height \fboxrule width \dashdash}{}% }} \newcommand{\vd@shrule}[1]{% \vbox to #1% {\hrule height \dashdash width \fboxrule% \cleaders\vbox to \dashlength% {\vfill\rule{\fboxrule}{\dashdash}\vfill}\vfill% \ifthenelse{\lengthtest{#1 > 2\dashdash}}% {\hrule height \dashdash width \fboxrule}{}% }} \newsavebox{\d@shedsavebox} \newlength{\d@shedboxwidth} \newlength{\d@shedboxtotalheight} \newcommand{\m@kedashbox}{% \setlength{\d@shedboxtotalheight}% {\dp\d@shedsavebox+\ht\d@shedsavebox+\fboxsep*2+\fboxrule*2}% \raisebox{-\fboxrule-\fboxsep-\dp\d@shedsavebox}{% \parbox[b]{\d@shedboxwidth}{% \offinterlineskip% \parskip=0pt% \hd@shrule{\d@shedboxwidth}% \kern-\fboxrule% \par% \parbox{\fboxrule}{\vd@shrule{\d@shedboxtotalheight}}% \kern\fboxsep% \parbox{\wd\d@shedsavebox}% {\vspace{\fboxsep}\usebox{\d@shedsavebox}\vspace{\fboxsep}}% \kern\fboxsep% \parbox{\fboxrule}{\vd@shrule{\d@shedboxtotalheight}}% \par% \kern-\fboxrule% \hd@shrule{\d@shedboxwidth}}% }} \newcommand{\dbox}[1]{% \sbox{\d@shedsavebox}{#1}% \setlength{\d@shedboxwidth}{\wd\d@shedsavebox+\fboxsep*2+\fboxrule*2}% \m@kedashbox} \def\dashbox{\@ifnextchar[\@dashbox\dbox} \def\@dashbox[#1]{\@ifnextchar[{\@idashbox[#1]}{\@idashbox[#1][c]}} \long\def\@idashbox[#1][#2]#3% {\setlength{\d@shedboxwidth}{#1}% \savebox{\d@shedsavebox}[#1-\fboxsep*2-\fboxrule*2][#2]{#3}% \m@kedashbox} \newsavebox{\l@yersavebox} \newlength{\l@yerwidth} \newlength{\l@yerboxwidth} \newlength{\l@yertotalheight} \newlength{\l@yerlineheight} \newlength{\l@yervoffset} \newcommand{\m@kelayer}[1]{% \setlength{\l@yertotalheight}% {\dp\l@yersavebox+\ht\l@yersavebox+\layersize-#1\layersize}% \setlength{\l@yerlineheight}% {\ht\l@yersavebox-#1\layersize-\fboxrule}% \setlength{\l@yervoffset}% {-\layersize-\dp\l@yersavebox}% \setlength{\l@yerboxwidth}% {\wd\l@yersavebox+\layersize-#1\layersize}% \parbox{\l@yerwidth}{% \offinterlineskip% \parskip=0pt% \usebox{\l@yersavebox}% \rule[\l@yerlineheight]{\layersize}{\fboxrule}% \kern-\fboxrule% \rule[\l@yervoffset]{\fboxrule}{\l@yertotalheight}% \kern-\wd\l@yersavebox\kern-\layersize\kern#1\layersize \rule[\l@yervoffset]{\fboxrule}{\layersize}% \kern-\fboxrule \rule[\l@yervoffset]{\l@yerboxwidth}{\fboxrule}% }} \newcommand{\l@yer}[2]{% \sbox{\l@yersavebox}{#2}% \setlength{\l@yerwidth}{\wd\l@yersavebox+\layersize}% \m@kelayer{#1}} \newcommand{\m@kedashlayer}[1]{% \setlength{\l@yertotalheight}% {\dp\l@yersavebox+\ht\l@yersavebox+\layersize-#1\layersize}% \setlength{\l@yerlineheight}{\ht\l@yersavebox-#1\layersize-\fboxrule}% \setlength{\l@yervoffset}{-\layersize-\dp\l@yersavebox}% \setlength{\l@yerboxwidth}% {\wd\l@yersavebox+\layersize-#1\layersize}% \parbox{\l@yerwidth}{% \offinterlineskip% \parskip=0pt% \usebox{\l@yersavebox}% \raisebox{\l@yerlineheight}{\hd@shrule{\layersize}}% \kern-\fboxrule% \raisebox{\l@yervoffset}% {\parbox[b]{\fboxrule}{\vd@shrule{\l@yertotalheight}}}% \kern-\wd\l@yersavebox\kern-\layersize\kern#1\layersize \raisebox{\l@yervoffset}% {\parbox[b]{\fboxrule}{\vd@shrule{\layersize}}}% \kern-\fboxrule \raisebox{\l@yervoffset}% {\hd@shrule{\l@yerboxwidth}}% }} \newcommand{\dl@yer}[2] {\sbox{\l@yersavebox}{#2}% \setlength{\l@yerwidth}{\wd\l@yersavebox+\layersize}% \m@kedashlayer{#1}} \newcounter{l@yercount} \newcommand{\l@yers}[3] {\setcounter{l@yercount}{1}% \sbox{\l@yersavebox}{#2}% \whiledo{\not\(\value{l@yercount} > #1\)}% {\sbox{\l@yersavebox}% {#3{\value{l@yercount}}{\usebox{\l@yersavebox}}}% \stepcounter{l@yercount}}% \usebox{\l@yersavebox}% } \newcommand{\lbox}[2][2]{% \l@yers{#1}{#2}{\l@yer}} \newcommand{\dlbox}[2][2]{% \l@yers{#1}{#2}{\dl@yer}} \endinput %% %% End of file `dashbox.sty'. I was not sure which one is more elegant/easy, any solution are all welcome!

  • Bug with tikz backgrounds-library
    by DraUX on April 17, 2026 at 9:22 am

    I recently noticed a bug, where the TikZ backgrounds library ignores any other options applied within the same scope definition. As you can see in the MWE below, I have a scope on the background layer with the additional options blue and ultra thick, which are ignored. \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{backgrounds} \begin{document} \begin{tikzpicture} \draw[red, ultra thick] (0,0) -- (2,0); \begin{scope}[on background layer,blue,ultra thick] \draw (1,-1) -- (1,1); \end{scope} \end{tikzpicture} \end{document} Using nested scopes or defining the options directly in the path definition gives the desired result. \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{backgrounds} \begin{document} \begin{tikzpicture} \draw[red, ultra thick] (0,0) -- (2,0); \begin{scope}[on background layer] \begin{scope}[blue,ultra thick] \draw (1,-1) -- (1,1); \end{scope} \end{scope} \end{tikzpicture} \end{document} Is this a bug? It isn't mentioned in the manual. I couldn't find a git repo to report an issue, so I hope this is the right place to ask.

  • How to create a TikZ node whose top matches one node’s north and bottom matches another node’s south?
    by Lecthor on April 16, 2026 at 3:18 pm

    I have two rectangular TikZ nodes placed one below the other: B1 is above B2. I would like to create a third rectangular node B3, shifted to the right in the x-direction, such that: the top of B3 is aligned with B1.north the bottom of B3 is aligned with B2.south I am not sure what is the best TikZ way to do this cleanly. Here is a minimal example of the situation: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \tikzstyle{block} = [draw, fill=white, rectangle, inner xsep=0pt, align=center, font=\small]% \begin{tikzpicture} \node [block, text width=3em] (B1) {Block 1}; \node [block, anchor=north, text width=3em] (B2) at ([yshift=-5em]B1.south) {Block 2}; \node [block, anchor=west] (B3) at ([xshift=5em]$(B1.east)!0.5!(B2.east)$) {Block 3}; \end{tikzpicture} \end{document} I tried using minimum height with coordinate differences, but I could not make it work properly. What is the recommended approach?

  • Bezier curves with controls?
    by Raffaele Santoro on April 16, 2026 at 8:45 am

    How to make rounded corner and curve (..controls?) for this path (or similar)? \documentclass[margin={1.5cm 1,5cm 1.5cm 1.5cm}]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \fill[cyan] (0,0)--(2,0)--(5,2)--(7,3)--(6,4)--(4,7)--(2,7)--(.5,5)--(0,2)--cycle; \end{tikzpicture} \end{document}

  • How to extend the `dim` feature in `tkz-euclide` to label the dimension with arrow in diverse direction?
    by Explorer on April 15, 2026 at 10:45 am

    Muzimuzhi has extended the dim feature in tkz-euclide here: However, not all the segments are long enough to label distance "inside", in some case, I need the following "invert"-dim feature: \documentclass[border=5pt]{standalone} \usepackage{tkz-euclide} \usepackage{fourier} \begin{document} \begin{tikzpicture} \tkzDefPoints{0/0/O,3/0/A,1/1/A2,.5/2/C2} \tkzDefRectangle(A2,C2)\tkzGetPoints{B2}{D2} \tkzDrawPolygon[thick,black,fill=yellow!50](A2,B2,C2,D2) \tkzLabelSegment[below](A2,B2){$t$} \draw[thick](A2) --+(0,-.5cm) ++(0,-.25cm) coordinate(tmpA) (B2) --+(0,-.5cm) ++(0,-.25cm) coordinate(tmpB); \draw[thick,latex-] (tmpB) -- +(-.4cm,0); \draw[thick,latex-] (tmpA) -- +(.4cm,0); %%%%%%%%%%%%%% \tkzDrawSegment[thick,dim style/.append style={red,dash pattern={on 2pt off 2pt}},dim={$a$,-.5cm,inner xsep=3pt}](O,A) %%%%%%%%%%%%%% \end{tikzpicture} \end{document} I have not quite familiar with pgf macros, I wonder whether that is possible to learn from muzimuzhi's code to support the "invert"-dim feature, to label these kind of segments distance from the two-side inwards more elegantly?

  • alaligne not working on tikzpicture environment
    by ABV on April 15, 2026 at 3:39 am

    /alaligne (new line space for system score) not working on tikzpicture environment. The basic code is as follow: \documentclass[% border={35pt 100pt 150pt 5pt},% left bottom right top varwidth]{standalone} % ========== PAQUETES ========== \usepackage{tikz} \usetikzlibrary{arrows.meta,calc} %LIBRERIA PARA LAS FORMAS \usetikzlibrary{quotes} \usetikzlibrary{shapes} \usetikzlibrary{fit,positioning} \usetikzlibrary{arrows.meta} \usetikzlibrary{decorations} \usepackage{amsmath}% \usepackage{musicography}% \usepackage{musixtex}% \input musixlyr% \usepackage{xcolor}% \xdefinecolor{red-undar}{RGB}{179,35,79} \begin{document}% \begin{tikzpicture} \node[anchor=north west, inner sep=0pt] (score) at (0,0) {% \begin{music}% \resetlyrics% \font\A=phvb8t at 10pt% \font\B=phvb8t at 8pt% \setsongraise1{-1.5mm}% \staffbotmarg3\Interligne% \setclef1\treble% \nobarnumbers% \nostartrule% %\startextract% \startpiece%\addspace\afterruleskip% % AQUI EMPIEZOOO \Notes\zw{h}\hu{j}\qsk\hu{l}\en\bar% \Notes\zw{f}\hu{k}\qsk\hu{j}\en\bar% \Notes\zw{g}\hu{i}\sk\en\setdoublebar\bar% \Notes\zw{h}\hu{m}\qsk\hu{l}\en\bar% \Notes\zw{f}\hu{k}\qsk\hu{j}\en\bar\setdoublebar% \Notes\zw{g}\hu{i}\sk\en\alaligne%%\setdoublebar\bar% \Notes\zw{b}\hu{g}\qsk\hu{f}\en\bar% \Notes\zw{c}\hu{e}\qsk\hu{g}\en\setdoublebar\bar% \Notes\zw{g}\hu{i}\qsk\hu{k}\en\bar% \Notes\zw{c}\hu{l}\qsk\hu{n}\en\setdoublebar% \endpiece% %\endextract% \end{music}% }; % CURVA 1 % \draw[line width=0.9pt, color=red-undar] % ($(score.north west)+(-1.1cm,-0.7cm)$) % punto INICIO (nota arriba) % .. controls % ($(score.north west)+(-1.7cm,-1.2cm)$) % punto control 1 (curva izquierda) % and % ($(score.north west)+(-1.9cm,-1.0cm)$) % punto control 2 (curva izquierda) % .. % ($(score.north west)+(-2.0cm,-1.1cm)$); % punto FIN (nota abajo) % % % CURVA 2 % \draw[line width=0.9pt, color=red-undar] % ($(score.north west)+(0.6cm,-0.9cm)$) % punto INICIO (nota arriba) % .. controls % ($(score.north west)+(0.5cm,-1.1cm)$) % punto control 1 (curva izquierda) % and % ($(score.north west)+(0.2cm,-1.2cm)$) % punto control 2 (curva izquierda) % .. % ($(score.north west)+(-0.1cm,-1.2cm)$); % punto FIN (nota abajo) % % % CURVA 3 % \draw[line width=0.9pt, color=red-undar] % ($(score.north west)+(4.1cm,-0.7cm)$) % punto INICIO (nota arriba) % .. controls % ($(score.north west)+(3.8cm,-1.0cm)$) % punto control 1 (curva izquierda) % and % ($(score.north west)+(3.6cm,-1.0cm)$) % punto control 2 (curva izquierda) % .. % ($(score.north west)+(3.2cm,-1.1cm)$); % punto FIN (nota abajo) % % % CURVA 4 % \draw[line width=0.9pt, color=red-undar] % ($(score.north west)+(5.8cm,-0.9cm)$) % punto INICIO (nota arriba) % .. controls % ($(score.north west)+(5.6cm,-1.1cm)$) % punto control 1 (curva izquierda) % and % ($(score.north west)+(5.4cm,-1.2cm)$) % punto control 2 (curva izquierda) % .. % ($(score.north west)+(5.1cm,-1.2cm)$); % punto FIN (nota abajo) % % % CURVA 5 % \draw[line width=0.9pt, color=red-undar] % ($(score.north west)+(9.2cm,-1.3cm)$) % punto INICIO (nota arriba) % .. controls % ($(score.north west)+(9.1cm,-1.5cm)$) % punto control 1 (curva izquierda) % and % ($(score.north west)+(8.7cm,-1.6cm)$) % punto control 2 (curva izquierda) % .. % ($(score.north west)+(8.4cm,-1.6cm)$); % punto FIN (nota abajo) % % % CURVA 6 % \draw[line width=0.9pt, color=red-undar] % ($(score.north west)+(11.0cm,-1.2cm)$) % punto INICIO (nota arriba) % .. controls % ($(score.north west)+(10.8cm,-1.4cm)$) % punto control 1 (curva izquierda) % and % ($(score.north west)+(10.5cm,-1.5cm)$) % punto control 2 (curva izquierda) % .. % ($(score.north west)+(10.2cm,-1.5cm)$); % punto FIN (nota abajo) % % % CURVA 7 % \draw[line width=0.9pt, color=red-undar] % ($(score.north west)+(12.9cm,-0.8cm)$) % punto INICIO (nota arriba) % .. controls % ($(score.north west)+(12.8cm,-1.0cm)$) % punto control 1 (curva izquierda) % and % ($(score.north west)+(12.4cm,-1.2cm)$) % punto control 2 (curva izquierda) % .. % ($(score.north west)+(12.0cm,-1.2cm)$); % punto FIN (nota abajo) % % % CURVA 8 % \draw[line width=0.9pt, color=red-undar] % ($(score.north west)+(14.6cm,-0.6cm)$) % punto INICIO (nota arriba) % .. controls % ($(score.north west)+(14.5cm,-1.1cm)$) % punto control 1 (curva izquierda) % and % ($(score.north west)+(14.2cm,-1.4cm)$) % punto control 2 (curva izquierda) % .. % ($(score.north west)+(13.9cm,-1.5cm)$); % punto FIN (nota abajo) % % \node[anchor=south west] at ($(score.north west)+(1.6cm, -0.6cm)$) % {\small\textbf{Etc.}}; % % \node[anchor=south west] at ($(score.north west)+(6.9cm, -0.6cm)$) % {\small\textbf{Etc.}}; % % \node[anchor=south west] at ($(score.north west)+(0.0cm, -0.2cm)$) % {\small\textbf{a)}}; % % \node[anchor=south west] at ($(score.north west)+(5.1cm, -0.2cm)$) % {\small\textbf{b)}}; % \\ % \node[anchor=south west] at ($(score.north west)+(9.5cm, -0.2cm)$) % {\small\textbf{c)}}; % \node[anchor=south west] at ($(score.north west)+(13.1cm, -0.2cm)$) % {\small\textbf{d)}}; % PUNTOS DE REFERENCIA %\fill[red] ($(score.north west)+(4.4cm,-0.9cm)$) circle (1pt); % INICIO %\fill[blue] ($(score.north west)+(0.5cm,-1.2cm)$) circle (1pt); % FIN %\fill[green] ($(score.north west)+(14.5cm,-0.9cm)$) circle (1pt); % CONTROL 1 %\fill[green] ($(score.north west)+(14.2cm,-1.1cm)$) circle (1pt); % CONTROL 2 \end{tikzpicture} \end{document}% The current output is as follow:

  • Graphing a system of inequalities in 3 dimensions
    by Henry Timmons on April 11, 2026 at 2:14 pm

    I am trying to graph a system of 3 inequalities in 3 dimensions. These ineuqalities are: y-z>=1/2x, x-z>=0, and x+y>=3z. Currently I am struggling to get even a basic output. My input is: \documentclass[12pt, a4paper]{article} \usepackage{float, ulem, amsmath, amsthm, amssymb, pgfplots, tikz} \pgfplotsset{width=10cm,compat=1.9} \usepgfplotslibrary{external, fillbetween} \tikzexternalize \begin{document} \begin{tikzpicture} \begin{axis}[domain=0:10,y domain=0:10] \addplot3[surf] {y-(\frac{1}{2}*x)}; \addplot3[surf] {x}; \addplot3[surf] {\frac{x+y}{3}}; \end{axis} \end{tikzpicture} \end{document} I am getting the error: ! Package tikz Error: Sorry, the system call 'pdflatex -halt-on-error -interact ion=batchmode -jobname "mwe-figure0" "\def\tikzexternalrealjob{mwe}\input{mwe}" ' did NOT result in a usable output file 'mwe-figure0' (expected one of .pdf:.j pg:.jpeg:.png:). Please verify that you have enabled system calls. For pdflatex , this is 'pdflatex -shell-escape'. Sometimes it is also named 'write 18' or so mething like that. Or maybe the command simply failed? Error messages can be fo und in 'mwe-figure0.log'. If you continue now, I'll try to typeset the picture. See the tikz package documentation for explanation. Type H <return> for immediate help. ... l.19 \end{tikzpicture} ?

  • How come when filling in TikZ, there is a visible gap between adjacent fills?
    by Jasper on November 12, 2025 at 1:00 am

    How come when filling in TikZ, there is a visible gap between adjacent fills? \documentclass[tikz,border=1cm]{standalone} \begin{document} \begin{tikzpicture} \fill (0,0) -- (1,1) -- (1,0) -- cycle; \fill (0,0) -- (1,1) -- (0,1) -- cycle; \end{tikzpicture} \end{document}

  • How to draw a picture like this in tikz?
    by Sunshine on August 26, 2025 at 8:34 pm

    I don't know how to draw it, is there any method?

  • TikZ text node and edge position in TikZit
    by Qohelet on November 27, 2023 at 5:46 pm

    I am using the TikZit application to construct a diagram containing nodes that "contain" or "consist of" only text (formatted with color, etc.) and that are connected by various edges. When inputing the text as the label argument, the connecting edge encroaches into the middle of the text, like this: Here is the source code generated by TikZit: \begin{tikzpicture} \begin{pgfonlayer}{nodelayer} \node [style=none] (0) at (-2.5, 7) {Hello world!}; \node [style=green dot] (1) at (1.75, 5) {}; \node [style=red dot] (2) at (2.25, -0.75) {}; \node [style=none] (3) at (-3, -2) {}; \end{pgfonlayer} \begin{pgfonlayer}{edgelayer} \draw (0.center) to (1); \draw [in=30, out=45, looseness=2.25] (1) to (2); \draw (3.center) to (2); \end{pgfonlayer} \end{tikzpicture} I was able to use the label={POSITION:TEXT} option to modify the default behavior \node [style=none, label={above=Hello \textcolor{blue}{World!}}] (0) at (-2.5, 7) {}; which renders which is what I am wanting. The problem is that I do not want to manually input the position parameter for each node and I do not know how to set up a node style that will automatically position the edge connection relative to the text node without having to specify the position in each case. To put it in question form: Is there a way to set up a node style that will automatically position the connecting edge on the "outside" of the node relative to the text like the second image above? Any help is appreciated.

  • Double entry table
    by Dunno on May 27, 2021 at 10:23 am

    I would like to make a double entry table in LaTeX. Here is the result that I would like to get: I found a clue here: \documentclass{article} \usepackage{multirow} \begin{document} \begin{center} \begin{tabular}{ c || l | r | c } & \multicolumn{3}{c}{Columns} \\ \hline \hline \multirow{3}{*}{Rows} & A1 & B1 & C1 \\ \cline{2-4} & A222 & B22 & C2 \\ \cline{2-4} & A3 & B333 & C33 \end{tabular} \end{center} \end{document} I managed to get a partial solution: \begin{document} \begin{center} \begin{tabular}{ l || r | c } A1 & B1 & C1 \\ \hline \hline A222 & B22 & C2 \\ \hline A3 & B333 & C33 \end{tabular} \end{center} \end{document} However, it doesn't solve all my problems. Is it possible to get square cells with everything centered in the cell? I found other partial solutions here but I don't know tikz at all. The matrix environment might not suit my needs because I would like to avoid outer borders and I didn't find any solution with double lines separing row's titles from the inner cells.

  • Bottom arrow between cells in latex
    by GoDev on November 28, 2019 at 9:57 pm

    How can I draw bottom arrows from cell to cell at the borders of a table? More precisely I'd like to get something like this: \begin{tikzpicture}[ % -{Stealth[length = 2.5pt]}, start chain = going right, node distance = 0pt, MyStyle/.style={draw, minimum width=1.6em, minimum height=2em, outer sep=0pt, on chain}, ] \node [MyStyle] (1) {$A$}; \node [MyStyle] (2) {$B$}; \node [MyStyle] (3) {$C$}; \node [MyStyle] (4) {$D$}; \node [MyStyle] (5) {$E$}; \node [MyStyle] (6) {$F$}; \node [MyStyle] (7) {$G$}; \node [MyStyle] (8) {$Q$}; \node [MyStyle] (9) {$B$}; \node [MyStyle] (10) {$G$}; \node [MyStyle] (11) {$A$}; \node [MyStyle] (12) {$D$}; \node [MyStyle] (13) {$W$}; \node [MyStyle] (14) {$B$}; \node [MyStyle] (15) {$n$}; \node [MyStyle] (16) {$6$}; \begin{scope}%[-{Stealth[length = 2.5pt]}] %\draw (1.north) [out=25, in=155] to (2.north); %\draw (1.north) [out=30, in=155] to (3.north); \draw (1.north) [out=35, in=155] to (4.north); \draw (1.north) [out=40, in=155, below] to (6.north); \draw (1.south) [out=40, in=155, below] to (6.south); \end{scope} %\draw[decorate,decoration={brace, amplitude=10pt, raise=5pt, mirror}] %(2.south west) to node[black,midway,below= 15pt] {$k$-elements} (7.south east);% \end{tikzpicture} This code produces the following output: Problem: Bottom arrows between items. Code is based on: proportional boxes in Tikz (array diagram)

  • Draw a pulley system
    by Epa on April 22, 2019 at 3:15 am

    Consider: I need to draw a pulley system as in the figure. How can I do that? \begin{tikzpicture} \fill[pattern=north east lines] (-3,0) rectangle (3,.3); \draw(-3,0)--(3,0); \draw(-2.5,0)--(-2.5,-2.4); \draw(2.5,0)--(2.5,-1); \draw[fill=white] (-2.5,-2.4) circle (.3); \draw[fill=white] (2.5,-1) circle (.3); \draw[fill=white] (0,-3) circle (.153); \draw (2.5,-1) coordinate (a) node[right] {} -- (0,-3) coordinate (b) node[left] {} -- (0,-2.75) coordinate (c) node[above right] {} pic["$\beta$", draw=orange, <->, angle eccentricity=1.2172, angle radius=.51cm] {angle=a--b--c}; \draw (0,-2.75) coordinate (a) node[right] {} -- (0,-3) coordinate (b) node[left] {} -- (-2.5,-2.4) coordinate (c) node[above right] {} pic["$\alpha$", draw=orange, <->, angle eccentricity=.72172, angle radius=.751cm] {angle=a--b--c}; \draw[dashed] (0,-3)--(0,-1); \draw[fill=white] (-2.5,-2.4) circle (.3); \draw[fill=white] (2.5,-1) circle (.3); \draw[fill=white] (0,-3) circle (.153); \end{tikzpicture}

  • Pie chart with color palette, info inside and legend
    by José on August 27, 2018 at 8:19 am

    I am trying to build the following pie chart with latex and the code below, however it seems quite difficult to match the legend, colors palette and external circle grouping colors. \documentclass[tikz,border=10pt]{standalone} \begin{document} \def\angle{0} \def\radius{3} \def\cyclelist{{"orange","blue","red","green"}} \newcount\cyclecount \cyclecount=-1 \newcount\ind \ind=-1 \begin{tikzpicture}[nodes = {font=\sffamily}] \foreach \percent/\name in { 0.01/1\% Cash, 4.26/ 5\% Miton Multi-Cap Income, 6.86/6\% Schroder Income Maximiser, 3.82/6\% Trojan Income, 3.32/7\% CF Woodford Equity Income, 2.91/7\% Artemis Global Income, 2.87/4\% First State Global Listed Infraestructure 2.63/4\% Lazard Global Listed Infraestructure 3.50/4\% Legg Mason RARE Global Income 2.55/6\% Newton Global Income 4.6/5\% Henderson Strategic Bond 5.01/4\% Invesco Perpetual Monthly Income Plus 4.4/5\% Jupiter Strategic Bond 0/4\% L&G All Stocks Index Linked Gilt Index 2.3/5\% L&G Short Dated Sterling Corporate Bond Index 5.95/4\% Royal London Short Duration Global High Yield Bond 3.55/4\% Twenty Four Corporate Bond 5.03/4\% Twenty Four Dynamic Bond 4.8/5\% F&C Property Growth & Income 4.44/5\% Aviva Multi Strategy Target Income 3.45/5\% Invesco Perpetual Global Targeted Income } { \ifx\percent\empty\else % If \percent is empty, do nothing \global\advance\cyclecount by 1 % Advance cyclecount \global\advance\ind by 1 % Advance list index \ifnum3<\cyclecount % If cyclecount is larger than list \global\cyclecount=0 % reset cyclecount and \global\ind=0 % reset list index \fi \pgfmathparse{\cyclelist[\the\ind]} % Get color from cycle list \edef\color{\pgfmathresult} % and store as \color % Draw angle and set labels \draw[fill={\color!50},draw={\color}] (0,0) -- (\angle:\radius) arc (\angle:\angle+\percent*3.6:\radius) -- cycle; \node at (\angle+0.5*\percent*3.6:0.7*\radius) {\percent\,\%}; \node[pin=\angle+0.5*\percent*3.6:\name] at (\angle+0.5*\percent*3.6:\radius) {}; \pgfmathparse{\angle+\percent*3.6} % Advance angle \xdef\angle{\pgfmathresult} % and store in \angle \fi }; \end{tikzpicture} \end{document} I found particularly complex to replicate it with latex, so any help will be welcome. Thanks for your support!

  • How to draw a water droplet in Latex?
    by Camilo Ramirez on November 6, 2017 at 8:46 pm

    Hey guys I am working in an infographic and I am trying to do it in LaTeX. In it I want to use the shape of a water droplet to show the water consumption. the final product should be something like this: Then I want to draw the water droplet shape to be able to use it like that in a table. Any ideas?

  • Loops & insertions in Tikz-Feynman
    by Janosh on June 29, 2017 at 8:35 pm

    I'd like to produce these diagrams using Tikz-Feynman. What I have so far is \RequirePackage{luatex85} \documentclass{standalone} \usepackage[compat=1.1.0]{tikz-feynman} \begin{document} $\feynmandiagram [horizontal=a to b, layered layout, baseline=(i1.base)] { i1 -- a [dot] -- [photon,half left,momentum'=\(q\)] b [dot] -- [photon,half left,momentum'=\(q\)] a, b -- f1 }; + \feynmandiagram [horizontal=a to b, layered layout, baseline=(a.base)] { {i1,i2} -- a [dot] -- [photon,half left,momentum'=\(q\)] b [crossed dot] -- [photon,half left,momentum'=\(q\)] a, };$ \end{document} There are a few open questions: How can I move the momentum arrows outside the loops? How can I shorten the in and outgoing lines? How can I precisely vertically align the center of both diagrams with the plus sign? How can I add the crossed dot on the first diagram? Update With the help of JP-Ellis I was able to get \RequirePackage{luatex85} \documentclass{standalone} \usepackage[compat=1.1.0]{tikz-feynman} \begin{document} $\feynmandiagram [horizontal=a to c,inline=(a.base)] { a [dot] -- [charged boson,quarter left,edge label=\(q\)] b -- [photon,quarter left] c [dot] -- [charged boson,quarter left,edge label=\(q\)] d [crossed dot] -- [charged boson,quarter left,edge label=\(q\)] a, f1 -- c, i1 -- a, }; \quad\raisebox{-0.5ex}{+}\quad \feynmandiagram [horizontal=a to b, layered layout, inline=(a.base)] { {i1,i2} -- a [dot] -- [charged boson,half left,edge label=\(q\)] b [crossed dot] -- [charged boson,half left,edge label=\(q\)] a [desired at={(0, 0)}], };$ \end{document} One question remains: is there a way to move the arrow on charged boson and its edge label to the end of a line? My intent is to to have them at the top of the upper arch in the first diagram (rather than in the middle of the first quarter).

  • Tikz Matrix No shape named
    by user109900 on July 12, 2016 at 8:41 am

    I try to write my bachelor thesis with LaTeX. In this I have problems with TikZ. I like to make braces over my matrices like this: I have several problems: can´t draw dashed line between 6. and 7.row the nodes (I hope that u_1 etc. are nodes?) are not at the right position and after six nodes i can't add anymore. It says "No shape named 1-7" I like to have overbrace over every 3 columns (so from 1 to 3, 3-6 and 6-9) with a letter on it I would really appreciate it if someone could help me 🙂 And this is the code: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix,decorations.pathreplacing, calc, positioning} \begin{document} \begin{eqnarray*} \begin{tikzpicture} [baseline=-\the\dimexpr\fontdimen22\textfont2\relax ] \matrix (m)[matrix of math nodes,left delimiter={[},right delimiter={]},,nodes in empty cells] { d^{(1)}_1\\ d^{(1)}_2\\ d^{(1)}_3\\ d^{(1)}_4\\ d^{(1)}_5\\ d^{(1)}_6\\ % d^{(2)}_1\\ d^{(2)}_2\\ d^{(2)}_3\\ d^{(2)}_4\\ d^{(2)}_5\\ d^{(2)}_6\\ }; \draw[dashed] ($0.5*(m-6-1.south west)+0.5*(m-7-1.north west)$) -- ($0.5*(m-6-1.south east)+0.5*(m-7-1.north east)$); \node[left=12pt of m-2-1] (left-1) {i}; \node[left=12pt of m-5-1] (left-2) {k}; \node[left=12pt of m-8-1] (left-3) {i}; \node[left=12pt of m-11-1](left-4) {k}; \node[rectangle,left delimiter=\{] (del-left-1) at ($0.5*(left-1.east) +0.5*(left-2.east)$) {\tikz{\path (left-1.north east) rectangle (left-2.south west);}}; \node[left=12pt] at (del-left-1.west) {$E_1$}; \node[rectangle,left delimiter=\{] (del-left-3) at ($0.5*(left-3.east) +0.5*(left-4.east)$) {\tikz{\path (left-3.north east) rectangle (left-4.south west);}}; \node[left=12pt] at (del-left-3.west) {$E_1$}; \end{tikzpicture} = \begin{tikzpicture} [baseline=-\the\dimexpr\fontdimen22\textfont2\relax ] \matrix (n)[matrix of math nodes,left delimiter={[},right delimiter={]},column sep=0.5cm,nodes in empty cells]{ 1 & & & & & & & & \\ &1 & & & & & & & \\ & &1 & & & & & & \\ & & &1 & & & & & \\ & & & &1 & & & & \\ & & & & &1 & & & \\ & & &1 & & & & & \\ & & & &1 & & & & \\ & & & & &1 & & & \\ & & & & & &1 & & \\ & & & & & & &1 & \\ & & & & & & & &1 \\ }; \draw[dashed] ($0.5*(m-6-1.south west)+0.5*(m-7-1.north west)$) --($0.5*(m-6-9.south east)+0.5*(m-7-9.north east)$); \node[above=of n-1-1] (top-1) {$u_1$}; \node[above=of n-1-2] (top-2) {$w_1$}; \node[above=of n-1-3] (top-3) {$\phi_1$}; \node[above=12pt of n-1-4] (top-4) {$u_2$}; \node[above=12pt of n-1-5] (top-5) {$w_2$}; \node[above=12pt of n-1-6] (top-6) {$\phi_2$}; \node[above=10pt of m-1-7] (top-7) {$u_3$}; \node[above=10pt of m-1-8] (top-8) {$w_3$}; \node[above=10pt of m-1-9] (top-9) {$\phi_3$}; \end{tikzpicture} \end{eqnarray*} \end{document}

  • Big block matrix with tikz
    by c.p. on September 18, 2012 at 8:23 pm

    I know this is very similar to plenty of questions. The matrix below s actually bigger, so I realized that I had to use tikz. In this array, A, A',…,L', T are square matrices, and I filled with zeros the right half, although the original matrix doesn't have these trivial entries, so I cannot remove them (don't try to fix the entries in the right side, because the spacing is ok when I introduce their actual values) Is there a less ugly way to write this block matrix? I'm sure there is a better way to display this tensor product in the non-zero block below, because, as it is displayed, it is not readable. I mean, it seems that \otimes T is multiplying only the matrix L! \documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usetikzlibrary{arrows,chains,matrix,positioning,scopes} \begin{document} \begin{tikzpicture}[node distance=-1ex] \matrix (mymatrix) [matrix of math nodes,left delimiter={(},right delimiter={)}] { 0 & 0 & A& A' & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0&0 &\!\!\!\!\! \\ 0 & 0 & B' & B\,\, & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &0&\!\!\!\!\!\\ C & C' & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &0&\!\!\!\!\!\\ D' & D & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &0&\!\!\!\!\!\\ 0 & 0 & 0 & 0 & 0 & 0 & K & K' & & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &0&\!\!\!\!\!\\ 0 & 0 & 0 & 0 & 0 & 0 & L' & L & \!\!\!\otimes T & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &0&\!\!\!\!\!\\ 0 & 0 & 0 & 0 & M & M' & 0 &0 & & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0&0&\!\!\!\!\!\\ 0 & 0 & 0 & 0 & N' & N & 0 & 0 & & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0&0&\!\!\!\!\!\\ }; \draw[blue,dashed] (mymatrix-4-1.south west) -- (mymatrix-4-4.south east); \draw[blue,dashed] (mymatrix-1-4.north east) -- (mymatrix-4-4.south east); \draw[red,dashed] (mymatrix-4-4.south east) -- (mymatrix-4-10.south west); \draw[red,dashed] (mymatrix-5-4.north east) -- (mymatrix-8-4.south east); \draw[red,dashed] (mymatrix-4-10.south west) -- (mymatrix-8-10.south west); \draw[red,dashed] (mymatrix-8-4.south east) -- (mymatrix-8-10.south west); \end{tikzpicture} \end{document}

  • Penrose tiling in TikZ
    by Yuji on June 27, 2012 at 3:54 pm

    How can I auto-generate a Penrose tiling by TikZ? Here's my code for Mathematica: GG = (Sqrt[5]+1)/2; standardthin = {1/2+Sqrt[GG^2-(1/2)^2] I , 0, 1}; standardthick = {GG/2+Sqrt[1-(GG/2)^2] I, 0, GG}; sectthin[n_, t_] := If[n > 0, Join[sectthin[n-2, {t[[2]], t[[3]], (GG*t[[3]]+t[[1]])/(GG+1)}], sectthick[n-1, {(GG*t[[3]]+t[[1]])/(GG+1), t[[1]], t[[2]]}]], {thin @@ N[t]}]; sectthick[n_, t_] := If[n > 0, Join[sectthick[n-2, {(GG*t[[2]]+t[[3]])/(GoldenRatio+1),t[[1]],t[[2]]}], sectthin[n-1, {t[[3]], (GG*t[[2]]+t[[3]])/(GG+1), t[[1]]}]], {thick @@ N[t]}]; addtothick[n_, t_, d_] := If[d == 0, {}, Join[{frame @@ t}, If[EvenQ[d], Join[addtothick[n+2, {t[[2]], t[[3]], ((GG+1)*t[[1]]-GG*t[[3]])},d/2], sectthin[n+1, {((GG+1)*t[[1]]-GG*t[[3]]), t[[1]], t[[2]]}]], Join[addtothin[n+1, {t[[2]], t[[3]], ((GG+1)*t[[1]]-t[[2]])/GG}, (d-1)/2], sectthin[n-1, {t[[3]], ((GG+1)*t[[1]]-t[[2]])/GG, t[[1]]}]]]]]; addtothin[n_, t_, d_] := If[d == 0, {}, Join[{frame @@ t}, If[EvenQ[d], Join[addtothin[n+2, {((GG+1)*t[[3]]-GG*t[[2]]), t[[1]], t[[2]]}, d/2], sectthick[n+1, {t[[3]], ((GG+1)*t[[3]]-GG*t[[2]]), t[[1]]}]], Join[addtothick[n+1, {t[[3]], ((GG+1)*t[[2]]-t[[1]])/GG, t[[1]]}, (d -1)/2], sectthick[n-1, {t[[2]], t[[3]], ((GG+1)*t[[2]]-t[[1]])/GG}]]]]]; triangle[a_, b_, c_] := Graphics[Line[{Re[#], Im[#]} & /@ {a, b, c, a}]]; thin := triangle; thick := triangle; frame[a_, b_, c_] := Graphics[{Thickness[0.005], Line[{Re[#], Im[#]} & /@ {a, b, c, a}]}] Show[addtothin[0, standardthin, 200], AspectRatio -> Automatic] which creates something like this: