• How ow to access cells outside of the days of the month using tikz calendar?
    by Robert on March 3, 2026 at 9:25 pm

    how to create a calendar like the attached photo. in particular how to: combine days like may 24/31 so that one month's calendar always fits on 5 rows, and how to put items (e.g. mini calendar for previous and successive months, photo, or lunar phases) in the boxes that aren't days

  • TikZ: How to add a node where a path gets clipped
    by Edoardo Serra on March 3, 2026 at 3:07 pm

    I am designing a square (or “squarish” actually) map protractor in TikZ. So far, I have managed to draw the degree ticks along the four sides by clipping radial lines between two closed paths using the even odd rule like I saw in this answer. The ticks are generated in a \foreach loop. To avoid drawing long ticks on top of short ones, I separated them into two loops using a conditional test. I am not sure whether this separation is actually necessary for correct SVG export/printing, but that is how I implemented it. Below is a MWE: \documentclass[tikz]{standalone} %,convert={outfile=\main.svg} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usetikzlibrary{intersections, pgfplots.fillbetween} \pgfdeclarelayer{pre main} \pgfdeclarelayer{main} \pgfsetlayers{pre main, main} \usetikzlibrary{shapes} \begin{document} %all of this is needed to easily clip between two closed paths using even odd rule \makeatletter \def\@appendnamedsoftpath#1{% \pgfsyssoftpath@getcurrentpath\@temppatha \expandafter\let\expandafter\@temppathb\csname tikz@intersect@path@name@#1\endcsname \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\@temppatha\expandafter\expandafter\expandafter{\expandafter\@temppatha\@temppathb}% \pgfsyssoftpath@setcurrentpath\@temppatha } \def\@appendnamedpathforactions#1{% \pgfsyssoftpath@getcurrentpath\@temppatha \expandafter\let\expandafter\@temppathb\csname tikz@intersect@path@name@#1\endcsname \expandafter\def\expandafter\@temppatha\expandafter{\csname @temppatha\expandafter\endcsname\@temppathb}% \let\tikz@actions@path\@temppatha } \tikzset{ use path for main/.code={% \tikz@addmode{% \expandafter\pgfsyssoftpath@setcurrentpath\csname tikz@intersect@path@name@#1\endcsname }% }, append path for main/.code={% \tikz@addmode{% \@appendnamedsoftpath{#1}% }% }, use path for actions/.code={% \expandafter\def\expandafter\tikz@preactions\expandafter{\tikz@preactions\expandafter\let\expandafter\tikz@actions@path\csname tikz@intersect@path@name@#1\endcsname}% }, append path for actions/.code={% \expandafter\def\expandafter\tikz@preactions\expandafter{\tikz@preactions \@appendnamedpathforactions{#1}}% }, use path/.style={% use path for main=#1, use path for actions=#1, }, append path/.style={% append path for main=#1, append path for actions=#1 } } \makeatother \begin{tikzpicture} \pgfmathsetmacro\bigside{7} \pgfmathsetmacro\smallsidedelta{0.5} %cuts \draw[rounded corners=12pt, name path=outside] (0,0) rectangle (\bigside,\bigside); \draw[dotted, rounded corners=12pt, name path=inside] (\smallsidedelta,\smallsidedelta) rectangle (\bigside-\smallsidedelta,\bigside-\smallsidedelta); %remove before cutting or printign. Just as reference grid %backside print \tikzfillbetween[of=inside and outside] {white}; %print on transparent plastic so this is needed for better readability %frontside print \pgfmathsetmacro\degreesmallticksize{0.2} \pgfmathsetmacro\degreemidticksize{0.35} \pgfmathsetmacro\outerradius{sqrt(2*\bigside/2*\bigside/2)} \path[rounded corners=12pt, name path=degrees short] (\degreesmallticksize,\degreesmallticksize) rectangle (\bigside-\degreesmallticksize,\bigside-\degreesmallticksize); \path[rounded corners=12pt, name path=degrees mid] (\degreemidticksize,\degreemidticksize) rectangle (\bigside-\degreemidticksize,\bigside-\degreemidticksize); \begin{scope} [even odd rule] %small ticks \clip[use path=outside, append path=degrees short]; \foreach \deg in {0, ..., 359} { \pgfmathsetmacro\degmod{mod(\deg,5)} \pgfmathtruncatemacro{\itest}{ifthenelse(\degmod==0,1,0)} \ifnum\itest=0 \draw[thin] (\bigside/2,\bigside/2) -- ({\bigside/2+\outerradius*cos(\deg)},{\bigside/2+\outerradius*sin(\deg)}); \fi } \end{scope} %had to add a second scope and for loop since the clipped area is different \begin{scope} [even odd rule] %mid ticks \clip[use path=outside, append path=degrees mid]; \foreach \deg in {0, ..., 359} { \pgfmathsetmacro\degmod{mod(\deg,5)} \pgfmathtruncatemacro{\itest}{ifthenelse(\degmod==0,1,0)} \ifnum\itest=1 \draw[thick] (\bigside/2,\bigside/2) -- ({\bigside/2+\outerradius*cos(\deg)},{\bigside/2+\outerradius*sin(\deg)}); \fi } \end{scope} \end{tikzpicture} \end{document} And the output is the following: I would now like to add a label at the inner end of each thick (5°) tick, displaying the corresponding degree value (0–355), like this: Now a few nuances: The numbers must always face towards the inside, with the exception, if possible, of the bottom row of numbers from 135° to 225°. When numbers get big, they don't have enough space to fit unless the labels become too small to read (actual printing size of the protractor will be something like 7x7 or 8x8cm). So they need to be shifted in such a way that they fit. 355 in the provided image is a clear example of what I mean. I can consider shifting them radially as well, but they need to stay to the outside of the dotted line, which I can make a little smaller. I really don't know where to start and didn't manage to find anything online. Thank you for your time!

  • How to label axes, points, and curves in a 3D plot using luadraw?
    by Octavius on March 3, 2026 at 2:00 pm

    The question arised from the previous link and the luadraw solution. I am using luadraw to visualize the surface z = x^2 + y^2 together with the intersection curve corresponding to the direction u = (1,0). I would like to know whether it is possible to: Label the coordinate axes $x$, $y$, and $z$, Label the point $c = (0,0)$, Indicate the direction $u = (1,0)$, And label the function $F(t) = t^2$ corresponding to the intersection curve. When I try to use Dtext3d, the document compiles but the output appears blank in Overleaf. Is there a reliable way to add these labels when using luadraw? \documentclass[border=5pt]{standalone} \usepackage[svgnames]{xcolor} \usepackage[3d]{luadraw} \usepackage{fourier-otf} \usepackage{tikz} \begin{document} \begin{luadraw}{name=paraboloid} local g = graph3d:new{ window3d = {-2,2,-2,2,0,8}, window = {-4.5,4,-3,9.5}, size = {10,10,0}, viewdir = perspective("central",30,50,20) } -- Surface local S = cartesian3d(function(x,y) return x^2+y^2 end, 2,-2,-2,2) -- Direction local c = Origin local u = M(1,0,0) local N = pt3d.prod(u, vecK) -- Intersection curve local Curve = g:Intersection3d(S, {c,N}) -- Draw surface g:Dfacet(S, {usepalette={palGasFlame,"z"}, edgecolor="gray", clip=true}) -- Draw curve g:Dedges(Curve, {hidden=true, color="Navy", width=12}) -- Axes g:Dline3d({Origin, M(2,0,0)}, {color="black", width=1, dash="dotted"}) g:Dline3d({Origin, M(0,2,0)}, {color="black", width=1, dash="dotted"}) g:Dline3d({Origin, M(0,0,6)}, {color="black", width=1, dash="dotted"}) g:Show() \end{luadraw} % ---- 2D overlay labels (safe in Overleaf) ---- \begin{tikzpicture}[overlay] \node at (3.7,4.2) {$x$}; \node at (1.1,4.8) {$y$}; \node at (2.5,7.3) {$z$}; \end{tikzpicture} \end{document}

  • Improving the visibility of a curve in a 3D PGFPlots surface
    by Octavius on March 2, 2026 at 4:50 pm

    In the left-hand figure, I would like to improve the visualization so that the red curve is more clearly visible. \documentclass[12pt,b5paper,twoside,openany]{book} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{amsmath,amssymb,amsfonts,amsthm} \usepackage{graphicx} \usepackage{xcolor} \usepackage{tikz} \usepackage{tikz-3dplot} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \hypersetup{colorlinks=true,linkcolor=black,citecolor=black} \newtheorem{example}{Example} \setlength{\parindent}{0pt} \begin{document} \begin{example} Consider the function \[ f(x,y)=x^2+y^2, \] the point \[ c=(0,0), \] and the direction \[ u=(1,0). \] To study the variation of $f$ at $c$ in the direction $u$, we define the one-variable function \[ F(t)=f(c+tu). \] In this case, \[ c+tu=(t,0), \] and therefore \[ F(t)=f(t,0)=t^2. \] Thus, when we move away from $c$ in the direction $u$, the values of $f$ vary according to the quadratic function $F(t)=t^2$. The directional derivative of $f$ at $c$ in the direction $u$ is given by \[ f'(c;u)=F'(0). \] Since \[ F'(t)=2t, \] we obtain \[ f'(c;u)=F'(0)=0. \] \end{example} \bigskip \begin{center} \begin{tikzpicture} % --- SURFACE --- \begin{axis}[ at={(0,0)}, anchor=origin, view={120}{25}, axis lines=center, axis line style={->}, xlabel={$x$}, ylabel={$y$}, zlabel={$z$}, domain=-2:2, y domain=-2:2, samples=30, samples y=30, width=8cm, height=8cm ] % Surface z = x^2 + y^2 \addplot3[surf, opacity=0.4] {x^2+y^2}; % Curve corresponding to F(t) \addplot3[very thick, red, domain=0:1.2, samples=100] ({x},{0},{x^2}); \end{axis} % --- GRAPH OF F(t) --- \begin{axis}[ at={(7cm,0)}, anchor=origin, axis lines=middle, axis line style={->}, xlabel={$t$}, ylabel={$F(t)$}, domain=-1.5:1.5, samples=200, width=7cm, height=6cm ] \addplot[very thick, red] {x^2}; \node at (axis cs:1,1) [red, anchor=west] {$F(t)=t^2$}; \end{axis} \end{tikzpicture} \end{center} \end{document}

  • How to draw this shape? [closed]
    by bakhta marouf on March 2, 2026 at 5:49 am

    I want to draw this shape using TikZ, but I don't know how. Could anyone provide an example of how to do it?

  • tiered list with a heading with tree-like |- line connectors that enumerate items
    by Mampac on March 1, 2026 at 4:08 pm

    how do i get a list that has a heading (in this example, "Deep Learning Methods" as the heading), from which level-2 entries are connected with solid lines? so far i draw the connector lines with tikz like this: which looks fine except for the extra-bolded trunk of the tree due to multiple retracing of the same connector path in my current implementation. it is super-subtle, but when you zoom out of the PDF file, you can see marginal pixel strips lacking at the upper part of the tree trunk where it's thinner than the rest. the MRE is as follows: \documentclass{article} \usepackage{tikz} \usetikzlibrary{tikzmark,calc} \tikzset{ taxonomy/.style={ overlay, remember picture } } \newcommand{\subcatindent}{1.3em} \newcommand{\methodsindent}{2.3em} \begin{document} unrelated text\\ \textbf{\tikzmarknode{dl}{\underline{Deep Learning Methods}}}\\ \hspace*{\subcatindent}\textbf{\tikzmarknode{dl_convo}{Convolution}}\\ \hspace*{\methodsindent}AE-based\\ \hspace*{\subcatindent}\textbf{\tikzmarknode{dl_ae}{Autoencoders}}\\ \hspace*{\methodsindent}Method D2\\ \hspace*{\subcatindent}\textbf{\tikzmarknode{dl_gan}{GANs}}\\ \hspace*{\methodsindent}Method D3\\ \hspace*{\subcatindent}\textbf{\tikzmarknode{dl_diff}{Diffusion}}\\ \hspace*{\methodsindent}Method D3\\ \hspace*{\subcatindent}\textbf{\tikzmarknode{dl_att}{Attention-Driven}}\\ \hspace*{\methodsindent}Method D3\\ \hspace*{\subcatindent}\textbf{\tikzmarknode{dl_ens}{Ensemble}}\\ \hspace*{\methodsindent}Method D3 \begin{tikzpicture}[taxonomy] \newcommand{\srcOffsetX}{+0.3em} \newcommand{\srcOffsetY}{-1.0ex} \coordinate (dl_start) at ($(dl.south west)+(\srcOffsetX,\srcOffsetY + 0.3ex)$); \coordinate (dl_lowest) at (dl_ens.west); \coordinate (dl_trunk) at ($(dl_start |- dl_lowest)$); \draw (dl_start) -- (dl_trunk); \draw (dl_trunk) |- (dl_convo.west); \draw (dl_trunk) |- (dl_ae.west); \draw (dl_trunk) |- (dl_gan.west); \draw (dl_trunk) |- (dl_diff.west); \draw (dl_trunk) |- (dl_att.west); \draw (dl_trunk) |- (dl_ens.west); \end{tikzpicture} \end{document} is there a way to dynamically and systematically implement this so that the connectors are drawn exactly at the place where the previous one turned 90 degrees to the right? ideally, i could turn this in a custom list environment, but so far i don't see a clear way of solving the retracing problem.

  • How do I use Tikz to create new text characters with serifs?
    by ItsErtHere on February 27, 2026 at 8:59 pm

    I would like to create "half letters" that attach to the left side of letters in a math formula. This would not only allow for the Latin AE character, but also characters like AD, OP, TB, and so on. When using regular Tikz lines, the attachment to the left side of the main letter does not appear to have the same font as the right side. For example, I will merge A and P together: \begin{tikzpicture} \draw[x=1pt,y=1pt,xshift=1.2] (5.3,3.6) node[node font=\itshape] {P}; \draw[x=1pt,y=1pt] (0.3,0) -- (6,7); \draw[x=1pt,y=1pt] (3.1,3.5) -- (6.3,3.5); \draw[x=1pt,y=1pt] (0,0.25) -- (1,0.25); \end{tikzpicture} The result (on Overleaf): The AP merged letter, possibly useful to represent pressure in physics when P is already used for power. We see, when attaching the half-A with the P, the font does not match, and the "serif" that I attached does not match the font. How do I add a serif to the end of the diagonal line on the left half of the character that makes the attachment look like a part of the character? Preferably, I'd like a custom line style to lessen the amount of commands I have to do for each half-letter or a specific command to create a serif to be in line with the math font? Or, in this case, is it easier to just create a font? (I'm doing this for all uppercase Latin and lowercase Greek letters for completeness, so that could become quite tedious). I may also have to consider variable line thickness on the left half of the letters too, as seen on the right-side P. In summary, here are the criteria I'm considering in this project: The general shape of a serif when attached to a line at any angle (strait P versus a diagonal V). The variation of width in some lines, such as the curves on B, D and P. Intersections of lines. Advantages and disadvantages of creating a custom font (.sty), creating a serif shape in Tikz, or creating a custom line style for Tikz. This helps decide what the best option is for this project. The application I'm hoping this is useful for is to allow more characters in formulas for math, physics, and other sciences whose design could hint at what the characters mean. For example, in physics, consider the notation for volume and voltage (both are represented by V). If both volume and voltage are in one calculation, what other symbols can we use to represent either one in order to avoid confusion that still show what those symbols represent? In this case, voltage can be VT, and volume can be VU. (The choice is up to the writer, this is just an example). I plan to write a paper over this topic once I get the attachments created. While this is meant for use in physics, I see this having applications in other areas of science and mathematics as well. Thus, which option would be the best for this project, and how do I get started with it? The TIKZ site is helpful, but I did not find anything that looked immediately useful specifically for creation of Serif fonts. Any help would be appreciated!

  • Creating Boxplot from precomputed value for each line in table
    by skanarr on February 26, 2026 at 4:53 pm

    I am using the box plot prepared method from here: Read boxplot prepared values from a table. My problem is the following: I have multiple rows in that csv and I want a box plot for each of these rows. How can I loop over all rows and create those? Added bonus: Some of my table columns are shorter than others, some have only enough data for 2 box plots, some have enough data for 10 box plots. % 1: extra for box plot, % 2: Identifier % 3: table, % 4: row \newcommandx{\TimeBoxPlot}[4][1={}]{ \addplot+[#2, #1, fill, boxplot prepared from table={ table=#3, row=#4, lower whisker= #2-time-min, lower quartile= #2-time-1, median= #2-time-med, upper quartile= #2-time-q3, upper whisker= #2-time-max, sample size = #2-sample-size, draw position = edge_count, }, boxplot prepared, ] coordinates {}; } % draw % Identifier % Table \newcommandx{\PlotPoint}[3][1={}]{ \pgfplotstablegetrowsof{#3} \pgfmathtruncatemacro{\numrows}{\pgfplotsretval-1} \pgfplotsinvokeforeach{0,...,\numrows}{ \TimeBoxPlot[#1]{#2}{#3}{##1} } } The identifier Mentioned is just a string-prefix for the columns in question and also a style I defined, so they are colored and drawn correctly. Though every Identifier has unbounded coords=discard set thats about the similarities. The implementation of \PlotPoint does not work. It is the macro that should go through all the lines (at least those with values).

  • I am plotting a family of parabolas in TikZ, and there is a stray parabola. I'm confused
    by Jasper on February 25, 2026 at 7:14 pm

    I am plotting a family of parabolas in TikZ, and there is a stray parabola. I'm confused. \documentclass[tikz,border=1cm]{standalone} \begin{document} \begin{tikzpicture} \pgfmathsetmacro{\SIGMALstart}{-3} \pgfmathsetmacro{\SIGMALstop}{3} \pgfmathsetmacro{\SIGMALsamples}{50} \pgfmathsetmacro{\SIGMALstep}{(\SIGMALstop-\SIGMALstart)/(\SIGMALsamples-1)} \foreach \SIGMAL[parse=true] in {\SIGMALstart,\SIGMALstart+\SIGMALstep,...,\SIGMALstop} { \draw[ variable=\TAUL, domain=-3:3 ] plot ( {\SIGMAL*\TAUL}, {((\TAUL)^2-(\SIGMAL)^2)/2} ); } \end{tikzpicture} \end{document}

  • Two 'Missing character: There is no ; (U+003B) in font nullfont!' warnings with pgfplots
    by Apoorv Potnis on February 25, 2026 at 5:13 pm

    I get two Missing character: There is no ; (U+003B) in font nullfont! warnings when I compile the below code with LuaLaTeX. I don't see any line numbers for the warnings in the .log file. I don't see any visual problem with the output though. \documentclass{article} \usepackage[newcmbb]{fontsetup} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usetikzlibrary{decorations.markings} \usetikzlibrary {arrows.meta,bending} \newcommand{\e}{\symrm{e}} \begin{document} \begin{figure}[h] \centering \begin{tikzpicture}[line cap=round] \begin{axis}[ samples=200, domain=0.24:4.5, xmin=0, xmax=5, ymin=-4.4, ymax=0.5, axis lines=middle, ticks=none, width=0.5\textwidth, xlabel={$r$}, ylabel={$V(r)$}, x axis line style={thick, -{>[bend]}}, y axis line style={thick, {<[bend]}-{>[bend]}}, y label style={anchor=south}, x label style={anchor=west}, legend style={ draw=none, at={(axis cs:2,-1.8)}, anchor=north west, row sep=10pt } ] \addplot[thick, red] {-exp(-x)/(x)}; \addplot[thick, blue, dashed] {-1/(x)}; \addlegendentry{$\displaystyle\frac{-\e^{-r}}{r}$}; \addlegendentry{$\displaystyle\frac{-1}{r}$}; \end{axis} \end{tikzpicture} \end{figure} \end{document} I saw another question with the same warning but there was a \tikz command in it which was causing issues. There is no \tikz command in my code. And I can't seem to find any stray semi-colons in the TikZ code either.

  • How to write at an angle along a straight line
    by rpapa on February 24, 2026 at 8:33 pm

    Using "sloped" I know how to write text parallel to a line, but how do I make the text also at an angle in the second case? \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning,matrix,calc} \begin{document} \begin{tikzpicture} \draw [red,ultra thick] (0,0)coordinate(A1)-- (3,5)coordinate(A2); \path (A1) -- (A2) node[sloped,pos=0.3,draw,fill=white]{aa}; \draw [blue,ultra thick] (1,0)coordinate(A3)-- (4,5)coordinate(A4); \foreach \i in {1,...,5} \node [sloped,draw,fill=white] at ($(A3)!{\i*10mm}!(A4)$) {\i}; \end{tikzpicture} \end{document} To be clear, the nodes must have a set distance between them. I am proposing my solution, adapted from your responses. \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning,matrix,calc} \begin{document} \begin{tikzpicture} \draw [red,ultra thick] (0,0)coordinate(A1)-- (3,5)coordinate(A2); \path (A1) -- (A2) node[sloped,pos=0.3,draw,fill=white]{aa}; \draw [blue,ultra thick] (1,0)coordinate(A3)-- (4,5)coordinate(A4); \foreach \i in {1,...,5} \node [sloped,draw,fill=white] at ($(A3)!{\i*10mm}!(A4)$) {\i}; \draw [blue,ultra thick] (2,0)coordinate(A3)-- (5,5)coordinate(A4); \pgfmathanglebetweenpoints{\pgfpointanchor{A3}{center}}{\pgfpointanchor{A4}{center}} \edef\angleAB{\pgfmathresult} \foreach \i in {1,...,5} \node [rotate=\angleAB,draw,fill=blue,minimum height=2mm,minimum width=8mm,text=yellow] at ($(A3)!{\i*10mm-10mm}!(A4)$) {\i}; \newcommand{\tracepark}[4]{ \draw (#1) -- (#2); \pgfmathanglebetweenpoints{\pgfpointanchor{#1}{center}}{\pgfpointanchor{#2}{center}} \edef\angleAB{\pgfmathresult} \foreach \i in {#3,...,#4} \node [rotate=\angleAB,draw,fill=blue,minimum height=2mm,minimum width=8mm,text=yellow] at ($(#1)!{\i*10mm-#3*10mm}!(#2)$) {\i}; } \coordinate(A5) at (-3,4); \coordinate(A6) at (3,-8); \tracepark{A5}{A6}{5}{10} \end{tikzpicture} \end{document}

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

  • Getting memory error with lualatex when trying to make a knock-out masking with indic texts
    by Miloop on February 22, 2026 at 9:21 am

    I am trying to make a small decorative badge / logo for a friend. The plan is the have a background image (of grass and flowers), then a white mask. I want to "punch" a tamil word in there and two decorative rings (might modify that later). This is the work I have done so far: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{fadings, decorations.text} \usepackage{graphicx} \usepackage{ebgaramond} \usepackage{fontspec} \usepackage{polyglossia} \setdefaultlanguage{english} \setotherlanguage{tamil} \newfontfamily\tamilfont[Script=Tamil]{Lohit Tamil} \begin{document} \begin{tikzpicture} % ------------------------------------------------ % 1) Background image % ------------------------------------------------ \node (img) {\includegraphics[width=8cm]{example-image}}; % ------------------------------------------------ % 2) Define knockout mask (TEXT + CIRCLES) % Black = fully transparent % White = fully opaque % ------------------------------------------------ \begin{tikzfadingfrompicture}[name=knockoutmask] % Everything starts white (opaque) \fill[white] (-5,-5) rectangle (5,5); % Knockout shapes are black \begin{scope}[shift={(0,0)}] % Text \node[ text=black, ] {\texttamil{தமிழ்}}; %<- replacing this with normal English font seems to work, say "Test text". % Deco circles \draw[line width=5pt, black] (0,0) circle (0.9cm); \draw[line width=5pt, black] (0,0) circle (1.5cm); \end{scope} \end{tikzfadingfrompicture} % ------------------------------------------------ % 3) White overlay with inverted fading % ------------------------------------------------ \fill[ white, path fading=knockoutmask, fit fading=false ] (img.south west) rectangle (img.north east); \end{tikzpicture} \end{document} Using English-only text, the output looks like this (which is fine, I just want tamil text): Edit: I forgot the add the error message! ! TeX capacity exceeded, sorry [input stack size=10000]. \pgf@selectfontorig ->\pgf@selectfontorig \nullfont l.36 ] {\texttamil{தமிழ்} }; %<- replacing this with normal eng... If you really absolutely need more capacity, you can ask a wizard to enlarge me. Here is how much of LuaTeX's memory you used: 17190 strings out of 476081 100000,953878 words of node,token memory allocated 1552 words of node memory still in use: 31 hlist, 10 rule, 8 dir, 17 glue, 4 kern, 1 glyph, 105 attribute, 52 glue_sp ec, 105 attribute_list, 7 temp, 2 write, 46 pdf_literal, 21 pdf_colorstack, 1 pd f_setmatrix, 1 pdf_save, 1 pdf_restore nodes avail lists: 2:5 39160 multiletter control sequences out of 65536+600000 29 fonts using 4680087 bytes 10000i,7n,109p,428b,875s stack positions out of 10000i,1000n,20000p,200000b,200000s ! ==> Fatal error occurred, no output PDF file produced!

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

  • Wild Turkeys in TikZ
    by karlh on November 25, 2025 at 4:20 pm

    I have an annual scavenger hunt at Thanksgiving in which the TikZlings and TikZ ducks (and related fauna) guide my nieces and nephew through the course. Given that it is Thanksgiving, I wanted to include a turkey munching on pie and sipping wine, but the closest I can come is \documentclass{article} \usepackage{tikzlings} \begin{document} \begin{tikzpicture} \chicken[cake=orange!50!brown,wine] \end{tikzpicture} \end{document} and that just doesn't have the same ring to it. I found a good wild turkey drawn in MetaPost (Draw a turkey, a pumpkin pie, or any other object traditionally associated with Thanksgiving), but since the holiday is only two days away, I thought I'd see whether anyone was interested in making a picture of Meleagris gallopavo.

  • How do I create this page header? [closed]
    by bakhta marouf on June 20, 2025 at 12:52 am

    I need help putting the page number at the top left of the page and the chapter name at the top right of the page with a long line under them

  • How to create gate symbol in quantikz?
    by Mauricio on September 29, 2022 at 4:08 pm

    I want to define a gate in quantikz with my own shape. Let's say I want a triangular gate or $\odot$ (instead of the usual CNOT or the square with letter). How can this be achieved? I looked at the examples in the documentation but I did not find anything similar. For example, imagine adding a gate that looks like an inverter:

  • diagram composing function
    by Suiron on March 25, 2022 at 6:43 pm

    I'm trying to make a typical composing-function diagram and I've saw a few posts, but I cannot make it yet as I'd like. In this picture I show what I attempt to make But the most I got is As you can see, I used empty nodes for the broken line, but not exactly worthy. I leave my code here so you can help me with its edition. I must confess I'm basic user in Latex and 100% newbie in Tikz, so any guide you use is welcome. \documentclass{article} \usepackage{amsmath} \usepackage{tikz} \begin{document} \begin{tikzpicture}[node distance=2cm, auto] \node(1) {$C$}; \node(2) [right of=1] {$C_{0}$}; \node(3) [right of=2] {$P_{0}$}; \node(4) [right of=3] {$P$}; \node(5) [right of=4] {$f^{*}(P)$}; \node(11) [below of=1] {}; \node(15) [below of=5] {}; \draw[->](1) to node {$\tau_{c}^{-1}$}(2); \draw[->](2) to node {$l^{-1}$}(3); \draw[->](3) to node {$\tau_{-1}$}(4); \draw[->](4) to node {$f^{*}$}(5); \draw[-](1) to node {}(11); \draw[->](15) to node {}(5); \draw[-](11) to node {$f = \tau_{c}^{-1} \circ l^{-1} \circ \tau_{-1} \circ f^{*}$}(15); \end{tikzpicture} \end{document} Thanks

  • Simple way to make circular arrow arc?
    by Black Mild on October 6, 2019 at 3:32 pm

    I have 4 circle nodes with different sizes. Is there a simple way (TikZ, Asymptote,...) to connected them with circular arrow arcs? \documentclass[border=5mm,tikz]{standalone} \begin{document} \begin{tikzpicture}[every node/.style={circle,draw,fill=white}] \def\r{3} \draw[red] (0,0) circle (\r); % 4 nodes with different sizes \path (180:\r) node (Sp) {Spring} (90:\r) node (Su) {Summer} (0:\r) node (Au) {Autumn} (-90:\r) node (Wi) {Winter}; % How to make arrow arcs cicular? (the red one with arrow tips) \begin{scope}[-stealth,bend left] \draw (Sp) to (Su); \draw (Su) to (Au); \draw (Au) to (Wi); \draw (Wi) to (Sp); \end{scope} \end{tikzpicture} \end{document}

  • TikZ: Incorrect arrow heads with edge node
    by LarrySnyder610 on September 28, 2019 at 12:56 am

    Why is the left arrowhead wrong, and how can I fix it? \documentclass[border=5pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[auto] \draw[<->] (0,0) edge node {$a$} (1,0); \end{tikzpicture} \end{document} It works fine if there is no edge node: ... \draw[<->] (0,0) -- (1,0); ...

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

  • Span block width automatically over multiple smaller blocks
    by SampleTime on March 17, 2018 at 6:41 pm

    Given the following code: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{positioning} \tikzstyle{block} = [draw, rectangle, minimum height=3.5em, minimum width=4.5em] \begin{document} \begin{tikzpicture} \node [block,align=center](a) {A}; \node [block,align=center,right=1cm of a](b) {B}; \node [block,align=center,below=1cm of a](c) {C}; \end{tikzpicture} \end{document} I would like that the C-Block, which is below the A- and B-Block takes automatically the width that the A and B Block span. I would like it to look something like this: How can I achieve this without manually setting the width of the C-Block?

  • Strikethrough rows and columns in matrices
    by Jamgreen on March 28, 2015 at 5:15 pm

    I've found this code from How to cross a row in matrix with a line? \documentclass{article} \usepackage{tikz} \newcommand{\pmark}[1]{\begin{tikzpicture}[overlay,remember picture]\node(#1)at (-1em,.7ex){};\end{tikzpicture}} \newcommand{\smark}[1]{\begin{tikzpicture}[overlay,remember picture]\draw(#1)--(0,.7ex);\end{tikzpicture}} \begin{document} $$\begin{array}{cccc|c} a&b&bc&d&f\\\hline 0\pmark{a}&0&1&1&1\smark{a}\\ 0&0&0&1&0\\ 0&0&1&1&1\\ \end{array}$$ \end{document} It works like a charm for rows but the lines are quite skewed. Can someone see how to fix this to work for both rows and columns?

  • Can we make a love heart with LaTeX?
    by Sibbs Gambling on October 20, 2013 at 4:48 pm

    I understand that this post may cause some down votes because it seems a bit off-topic, but having seen the discussions on Christmas Tree with LaTeX I am still willing to try. How do you draw a red cute love heart using LaTeX?

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

  • Materials for learning TikZ
    by Tim on April 14, 2011 at 1:06 am

    I feel intimidated in learning TikZ. I was wondering if there are some nice materials (or just your replies) at different level: for providing big picture, which is important to beginners to not lose direction during learning. for comprehensive reference. Examples are important, but only examples are not always clear for understanding the big picture and organization.