TikZ
- How to convert LaTeX file to Markdown but have tables, figures, and formulas as images and citations as plain text?by Chad Chaddington on January 19, 2026 at 6:03 pm
I'm writing my thesis in LaTeX (LaTeX Workshop + TeX Live + VSCode) and using GitLab for its version control. With GitLab (and GitHub, and the like), you can comment on individual lines on a file, and you can have this kind of back-and-forth about what to change and how. I'd like to be able to do that with my thesis advisor. However: PDF does not allow for that, since it's a binary file and treated as an image by the commenting feature; I don't know that my advisor is super familiar with LaTeX, so I don't want to give them a whole bunch of .tex files to parse through and try to figure out which one matches which section of the final .pdf; Even if they were okay with that, I don't want to ask them to do extra work (i.e.: install the editor and extension and TeX Live on their computer, plus keep git-pulling my things rather than comment on the file on GitLab) just so that reviewing my work is easier on me. So! I've been looking up ways to convert my LaTeX files into a single file of a types that can be rendered and commented on in platforms like GitLab (e.g.: .txt, .md, ...). So far I'm partial do markdown, since there's a built-in renderer for it on most git platforms and it works for both images and text. Unfortunately, the most promising converter I found - pandoc - turns some of the code into html (e.g.: tables, citations, figures), which kind of cancels out the whole "no code for my adivsor to parse through" aspect. How can I convert a LaTeX file from .tex to .md, so that, simultaneously: Citations are shown in the markdown file as either their display text only, or as links to their matching bibliography entry? Tables, figures, formulas, etc, are displayed as .png images? I've been reading up here, and the tikz package might help convert a few sections to image files (seen here and here with equations), but all mentions I've found only apply this to the final .pdf, not to other file types, and even then they focus on equations, not tables. I assume I can convert from pdf with the tikz images to markdown, but my computer is slow enough I'd like to convert directly from LaTeX to markdown, just with the images rather than tables/figures/etc. I would like a way to make file names consistent, too, between images, if possible. Thank you for your time! Additional note(s): With pandoc, compilation was done as a recipe step/tool for LaTex Workshop. I used no additional flags for compilation beyond specifying I wanted to convert from latex to markdown. I tried to use different types of markdown to see if there was a difference: github-flavored markdown, and regular markdown. The entry on "latex-workshop.latex.tools" in my VSCode settings.json file is: {"name": "markdowntex", "command": "pandoc", "args": [ "%DOC_EXT%", "-f", "latex", "-t", "gfm", "-s", "-o", "%DOC%.md", ]} I do not wish to use Overleaf. (Jan 20) By images I mean .png files and the like, not .pdf files with images on them
- Is there a "hook" to expand a macro after the end of a path in TikZ?by Rmano on January 18, 2026 at 7:33 pm
I am adding a new feature to circuitikz to simplify the usage of "user-defined" voltages (and currents and "flow"s). The question is not specific to circuitikz, although the MWE is — sorry for the complication. If I manage a smaller MWE I'll post here. The basic question is: when a TikZ \path command is processed (and a \draw, etc., which are basically the same), is it possible to add a hook to be expanded at the end of it? I mean, after the final ; is found. In the following MWE, I would like to add some code to the addcall key so that I do not need to add the final \DoAdvVoltages. Ideally, the macro should be called after each path is finished, but calling it before the end of the environment would be acceptable. In order of preference, the solution should: call \DoAdvVoltages at every end of the path, when in the path the to[..., addcall=...] is used; if that's not possible, call \DoAdvVoltages at the end of the tikzpicture, in every tikzpicture where at least one path used the addcall key; if that's not possible, call the \DoAdvVolteges at the end of every tikzpicture. The solution should be engine-independent (well, it should work in the engines supported by TikZ, basically LaTeX and ConTeXt). Option 3 is easy in LaTeX, I do not know if it's as easy in ConTeXt. Option 2 could be achievable in LaTeX: add a one-shot hook at env/tikzpicture/end the first time it's called, protected by an if, from the .code itself — I'm not sure if this is a use-case possible in the current hook code, I'll dig into it when I have time, but it would be an acceptable answer (Is \AddToHookNext what I'm looking for here?). \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage[RPvoltages]{circuitikz} % just an example \ctikzset{voltage=raised, !v sym/.style={no v symbols}} \newcommand{\placesigns}[2]{% place the +- signs at a fixed distance \path (#1voltage.center) ++(-\ctikzgetdirection{#1}:0.5cm) node[]{$+$}; \path (#1voltage.center) ++(180-\ctikzgetdirection{#1}:0.5cm) node[]{$-$}; } % add a command queue to circuitikz \makeatletter \gdef\local@voltages{} \def\addcommand#1#2{%add to \commands the macro \#1{nodename}{#2} \begingroup \edef\@@name{\ctikzvalof{bipole/name}} \edef\@@temp{% \noexpand\pgfutil@g@addto@macro\noexpand\local@voltages{% \expandafter\noexpand\csname #1\endcsname {\@@name}{#2}% }% }% \@@temp \endgroup } \def\DoAdvVoltages{\local@voltages\relax\gdef\local@voltages{}\ctikz@hook@setfalse} \makeatother % This works, but just for LaTeX (or not?) % Moreover, I'd like to add this from the addcall keys, so that % I don't call it for *every* tikzpicture! % \AddToHook{env/tikzpicture/end}{\DoAdvVoltages} \ctikzset{addmyv/.style = {v={#1}, !v sym, addcall={#1}}} \ctikzset{addcall/.code ={\addcommand{placesigns}{#1}}} \begin{document} \begin{tikzpicture} \draw (3,0) -- ++(1,0) coordinate(Rbot) to[R=R, name=vR, addmyv={$u_R$}] ++(0,+3) -- ++(-1,0); \draw (Rbot) -- ++(2,0) coordinate(Cbot) to[C=C, name=vC, addmyv={$u_C$}] ++(0,+3) -- ++(-2,0); \draw(Cbot) to [L=L, name=vL, addmyv={$u_L$}] ++(2,0); \DoAdvVoltages \end{tikzpicture} \end{document} A partial solution (the option 2 above) could be something like this, that seems to work: \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage[RPvoltages]{circuitikz} % just an example \ctikzset{voltage=raised, !v sym/.style={no v symbols}} \newcommand{\placesigns}[2]{% place the +- signs at a fixed distance \path (#1voltage.center) ++(-\ctikzgetdirection{#1}:0.5cm) node[]{$+$}; \path (#1voltage.center) ++(180-\ctikzgetdirection{#1}:0.5cm) node[]{$-$}; } % add a command queue to circuitikz \makeatletter \newif\ifctikz@hook@set\ctikz@hook@setfalse \gdef\local@voltages{} \def\addcommand#1#2{%add to \commands the macro \#1{nodename}{#2} \begingroup \edef\@@name{\ctikzvalof{bipole/name}} \edef\@@temp{% \noexpand\pgfutil@g@addto@macro\noexpand\local@voltages{% \expandafter\noexpand\csname #1\endcsname {\@@name}{#2}% }% }% \@@temp \endgroup } \def\DoAdvVoltages{\local@voltages\relax\gdef\local@voltages{}% \typeout{EXECUTE DoAdv} \global\ctikz@hook@setfalse } \def\ctikz@set@hook{% \ifctikz@hook@set \else \global\ctikz@hook@settrue % I have no idea if I can do this in context/plain... \ifpgfutil@format@is@latex \typeout{EXECUTE AddToHookNext} \AddToHookNext{env/tikzpicture/end}{\DoAdvVoltages}% \fi \fi } \ctikzset{addcall/.code ={\addcommand{placesigns}{#1}\ctikz@set@hook}} \makeatother % This works, but just for LaTeX (or not?) % \AddToHook{env/tikzpicture/end}{\DoAdvVoltages} \ctikzset{addmyv/.style = {v={#1}, !v sym, addcall={#1}}} \begin{document} \begin{tikzpicture} \draw (3,0) -- ++(1,0) coordinate(Rbot) to[R=R, name=vR, addmyv={$u_R$}] ++(0,+3) -- ++(-1,0); \draw (Rbot) -- ++(2,0) coordinate(Cbot) to[C=C, name=vC, addmyv={$u_C$}] ++(0,+3) -- ++(-2,0); \draw(Cbot) to [L=L, name=vL, addmyv={$u_L$}] ++(2,0); \end{tikzpicture} \begin{tikzpicture} \draw (3,0) -- ++(1,0) coordinate(Rbot) to[R=R, name=vR, addmyv={$u_R$}] ++(0,+3) -- ++(-1,0); \draw (Rbot) -- ++(2,0) coordinate(Cbot) to[C=C, name=vC, addmyv={$u_C$}] ++(0,+3) -- ++(-2,0); \draw(Cbot) to [L=L, name=vL, addmyv={$u_L$}] ++(2,0); \end{tikzpicture} \end{document} But clearly, this is not valid (I think) for ConTeXt at all.
- Reproducing figures with shaded half-planes in a gray square boxby Sebastiano on January 18, 2026 at 4:43 pm
I am trying to reproduce some images from old lecture notes, in particular notes by Prof. Gorni dating back to the 1993/94 academic year (pag. 4), or in other notes, like this picture At that time I had no knowledge of LaTeX at all. I do not know whether those figures were produced using PSTricks or with XFig/WinFig via psfrag, but my goal is to reproduce them in TikZ, correctly coloring the relevant half-planes. I am not completely sure whether it is possible (or appropriate) to modify the domain by introducing a square with a gray background or a path, but I have nevertheless quickly put together a minimal working example. \documentclass[a4paper,12pt]{article} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{arrows.meta,decorations.markings,backgrounds} \usepackage{geometry} \geometry{margin=2.5cm} \begin{document} \begin{center} \begin{tikzpicture}[scale=1.5] \draw[->] (-0.2,0) -- (2,0) node[right] {$x$}; \draw[->] (0,-0.2) -- (0,2) node[above] {$y$}; \def\a{1.75} \begin{scope}[on background layer] \fill[gray!25] (-\a,\a) -- (\a,\a) -- (\a,-\a) -- (-\a,\a) -- cycle; \end{scope} \draw[thick,white] (-\a,-\a) rectangle (\a,\a); \draw[thick] (-1.5,1.5) -- (1.5,-1.5); \node at (-1.25,0.55) {$y=-x$}; \draw[thick] ({sqrt(2)},0) arc (0:90:{sqrt(2)}); \fill (0,{sqrt(2)}) circle (0.6pt); \fill ({sqrt(2)},0) circle (0.6pt); \node[left] at (0,{sqrt(2)}) {$\left(0,\sqrt{2}\right)$}; \node[below] at ({sqrt(2)},0) {$\left(\sqrt{2},0\right)$}; \end{tikzpicture} \end{center} \end{document} The problems I am facing (also because I have never attempted anything like this before) are the red rectangles (I wonder if there is a simple option to place the arc vector in a central position):
- How to return array from a command?by karu on January 18, 2026 at 10:07 am
How to return an array from a command? or rather How to expand a command to some generated array? The code below generates the correct array into \OutArray inside \Transmogrifier, but I don't know how to return it to calling \ResultArray. I know one option to access the values is to define an empty array, give the array as an argument to the command, have the command generate the elements to that array and access them when the command is finished. This is not what I am looking for. My question is more to expand my understanding and increase the tools I have in my disposal. \documentclass[tikz]{standalone} \begin{document} \newcommand*{\SomeOperation}[2]{% \fpeval{#1*#2}% }% \newcommand*{\Transmogrifier}[2]{% \pgfmathparse{dim(#1)}% or \pgfmathdim{#1}% \edef\ArrayLength{\pgfmathresult}% \xdef\OutArray{{}}% \foreach \i in {0,...,\fpeval{\ArrayLength-1}}% {% \pgfmathparse{array({#1},\i)}% or \pgfmatharray{{#1}}{\i}% \ifnum \i=0% \xdef\OutArray{\SomeOperation{\pgfmathresult}{#2}}% \else% \xdef\OutArray{\OutArray,\SomeOperation{\pgfmathresult}{#2}}% \fi% }% \xdef\OutArray{{\OutArray}}% How to "return" \OutArray? %\typeout{OutArray: \OutArray}% }% \begin{tikzpicture} \def\TestArray{{1,2,3}}% \typeout{TestArray: \TestArray}% \newcommand*{\ResultArray}{% \Transmogrifier{\TestArray}{2}% }% %\ResultArray% Temp for testing \typeout{ResultArray: \ResultArray}% \end{tikzpicture} \end{document} Desired outcome in the log file: TestArray: {1,2,3} ResultArray: {2,4,6}
- Indifference and budget curveby henry on January 18, 2026 at 8:26 am
I have a trouble to draw this diagram, could you guys help me please. This is my code: \begin{frame}{5.2.Child-care subsidy} \vspace{0.1cm} \centering \resizebox{0.95\textwidth}{!}{% \begin{tikzpicture}[scale=0.95, >=Stealth, font=\sffamily] % --- 1. HỆ TRỤC --- \draw[thick] (0,0) -- (0,6.5) node[above] {Income}; \draw[thick] (0,0) -- (6.5,0); \node[below left] at (0,0) {0}; \node[below] at (5.5,0) {$\longleftarrow$ Hours of Paid Work}; \coordinate (a) at (6.0, 0); \coordinate (c) at (6.0, 1.5); \coordinate (b) at (6.0, 3.0); \draw[thin, gray!30] (6.0, 0) -- (6.0, 3.2); \filldraw[black] (a) circle (1.5pt) node[right, font=\scriptsize] {$a$}; \filldraw[black] (c) circle (1.5pt) node[right, font=\scriptsize] {$c$}; \filldraw[black] (b) circle (1.5pt) node[right, font=\scriptsize] {$b$}; % Đường thấp d-c \coordinate (d) at (0, 4.0); \draw[thick, cyan!50] (d) node[left, black, font=\scriptsize] {$d$} -- (c); \coordinate (e) at (0, 5.5); \draw[thick, curveBlue] (e) node[left, black, font=\scriptsize] {$e$} -- (b); \coordinate (X) at (2.4, 3.0); \filldraw[black] (X) circle (2pt) node[below left] {$X$}; \coordinate (Y) at (3.6, 4.0); \filldraw[black] (Y) circle (2pt) node[above right] {$Y$}; \draw[thick, black] (0.6, 5.2) .. controls (1.2, 3.8) and (1.8, 2.9) .. (X) .. controls (3.2, 3.1) and (5.0, 2.5) .. (6.2, 4.0) node[right] {$U_1$}; \draw[thick, black] (1.5, 6.5) .. controls (2.2, 5.0) and (2.8, 3.9) .. (Y) .. controls (4.5, 4.1) and (5.5, 4.2) .. (6.2, 5.8) node[right] {$U_3$}; \draw[thick, black!70] (1.0, 6.0) .. controls (1.8, 4.5) and (2.5, 3.5) .. (3.1, 3.6) .. controls (4.0, 3.7) and (5.2, 3.5) .. (6.2, 5.0) node[right] {$U_2$}; \end{tikzpicture} } This is what i get:
- Any possible method to handle for-loop more smartly in tikz?by Explorer on January 18, 2026 at 7:31 am
I have the following codes to typeset following: \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{decorations.pathreplacing} \ExplSyntaxOn \cs_new:Nn \__my_Aterm_tl:n { \tl_set:Nn \l_tmpa_tl { a \sb 1 } \int_step_inline:nnn {2} {#1} { \tl_put_right:Nn \l_tmpa_tl { + a \sb {##1} } } \tl_use:N \l_tmpa_tl } \NewDocumentCommand{\Aterm}{ m }{\__my_Aterm_tl:n{#1}} \ExplSyntaxOff \begin{document} \def\NN{5} \begin{tikzpicture} \foreach \i[evaluate=\i as \nexti using int(\i+1)] in {1,...,\NN}{ \draw (0,{-(\i-1)}) rectangle (\i,-\i); \ifnum\i<\NN\relax \draw[decorate,decoration={brace,amplitude=5pt}] (\i,{-(\i-1)}) -- node[midway,right=3pt] {$b_{\i}-b_{\nexti}$} (\i,-\i); \else \draw[decorate,decoration={brace,amplitude=5pt}] (\i,{-(\i-1)}) -- node[midway,right=3pt] {$b_{\i}$} (\i,-\i); \fi \draw[decorate,decoration={brace,mirror,amplitude=5pt}] (0,{-(\i-1)}) -- node[midway,below=3pt] { % $a_{\i}$ $\Aterm{\i}$ } (\i,{-(\i-1)}); } \end{tikzpicture} \end{document} It works! But the code looks not elegant, for the abrupt \ifnum and expl3-syntex(I have heard from that may cause unexpected result to mix tikz and expl3), is that possible to make good use of evaluate=<variable> as <macro> using <formula> or /remember=<variable> as <macro> (initially <value>)?
- Is that possible to just fill=white for text in only one node?by Explorer on January 16, 2026 at 8:07 pm
I have the following code: \documentclass[tikz,border=5pt]{standalone} \begin{document} \ExplSyntaxOn \keys_define:nn {mykey} { foo .tl_set:N = \l_tmpa_tl } \keys_set:nn {mykey} { foo = {O\quad K},%<- } \begin{tikzpicture} \draw[dotted] (0,0) -- (2,0); \node[inner~sep=0pt] at (1,0) {\l_tmpa_tl}; \end{tikzpicture} \begin{tikzpicture} \draw[dotted] (0,0) -- (2,0); \node[fill=white,inner~sep=0pt] at (1,0) {\l_tmpa_tl}; \end{tikzpicture} \ExplSyntaxOff \begin{tikzpicture} \draw[dotted] (0,0) -- (2,0); \node[fill=white,inner sep=0pt] at (.7,0) {O}; \node[fill=white,inner sep=0pt] at (1.3,0) {K}; \end{tikzpicture} \end{document} For the sake of the template settings, the text O\quad K should be put as a token list, as a whole, but I need the third picture's result. Is that possible to just fill=white to just shade the "text area"? Edited: Since cfr commented for the original template case, I would provide more information. Claims: The original package is exam-zh package It depends on xeCJK, so xelatex is must I was not sure that whether it's CJK fonts settings works on every OS. See here. What I want, is to achieve something sealline style as below: It appeared in the leftmargin of exam paper: Now I have the following code: \documentclass{exam-zh} \usepackage{zhlipsum} % \ExplSyntaxOn % % Line 1487 in exam-zh.cls % % https://github.com/xkwxdyy/exam-zh/blob/main/exam-zh.cls#L1487-L1496 % \cs_set:Npn \__examzh_sealline_odd_text_around_line: % { % \node [ anchor = east ] % at ([xshift = -\g__examzh_sealline_odd_text_xshift_dim, yshift = \g__examzh_sealline_odd_text_yshift_dim]current~page~text~area.west) % { % \g__examzh_sealline_odd_text_format_tl % \__examzh_sealline_odd_spread_box:nn { \g__examzh_sealline_odd_text_width_dim } % { \g__examzh_sealline_odd_text_tl } % }; % } % \ExplSyntaxOff \examsetup{ sealline={ show=true, circle-show=false, line-type={loosely-dotted}, text={密封线},%<- the text here is put as `\g__examzh_sealline_odd_text_tl' text-format={\huge\bfseries}, line-thickness={2.5pt}, text-xshift={.375cm} } } \begin{document} \zhlipsum[name=zhufu] \end{document} That is the original case. Noted that 密封线, the l3keys sealline/text is put into \g__examzh_sealline_odd_text_tl ands \g__examzh_sealline_even_text_tl here(why I say as a whole). Which need to be processed by \__examzh_sealline_odd_spread_box:nn here. I want to change the present settings of exam-zh's setting code to the minimal extent.(Of course, I can type text={}, leave it empty, and follow \__examzh_sealline_odd_circle: here to draw multiple \node[fill=white] {密}s) But that change too much the package's setting. So, I simplified it to my origianl post😊.
- Drawing a porous sandwich beamby Tldi You on January 16, 2026 at 9:03 am
Can we reproduce this image in LaTeX Tikz? I try this \documentclass[tikz,border=5pt]{standalone} \usepackage{tikz} \usetikzlibrary{patterns,arrows.meta,decorations.pathmorphing} \begin{document} \begin{tikzpicture}[scale=1] %------------------------------------------------- % Common styles %------------------------------------------------- \tikzset{ block/.style={draw, thick, fill=orange!20}, caps/.style={draw, thick, fill=blue!40}, axis/.style={->, thick}, profile/.style={thick}, } %================================================= % (b) SD %================================================= \begin{scope}[xshift=0cm] % Top and bottom caps \draw[caps] (0,4) rectangle (4,4.5); \draw[caps] (0,0) rectangle (4,0.5); % Main block with layered patterns \draw[block] (0,0.5) rectangle (4,4); % Internal layers \draw[pattern=checkerboard, pattern color=orange!70] (0,2.7) rectangle (4,4); \draw[pattern=crosshatch, pattern color=orange!70] (0,1.6) rectangle (4,2.7); \draw[pattern=grid, pattern color=orange!70] (0,0.5) rectangle (4,1.6); % Axes \draw[axis] (0,2.25) -- (5,2.25) node[above] {$x$}; \draw[axis] (0,2.25) -- (0,5) node[above] {$z$}; % Right profile \draw[domain=0.5:4,smooth,,red,variable=\z] plot ({6-cos(180*\z/((4-0.5)))},{\z}); % Labels \node[right] at (4.1,3.9) {$E_{\max},\,\rho_{\max}$}; \node[right] at (4.1,0.6) {$E_{\max},\,\rho_{\max}$}; \node at (2,-0.6) {(b) SD}; \end{scope} %================================================= % (c) ASD %================================================= \begin{scope}[xshift=8cm] % Top and bottom caps \draw[caps] (0,4) rectangle (4,4.5); \draw[caps] (0,0) rectangle (4,0.5); % Main block \draw[block] (0,0.5) rectangle (4,4); % Gradient-like pattern layers \draw[pattern=checkerboard, pattern color=orange!70] (0,2.5) rectangle (4,4); \draw[pattern=crosshatch dots, pattern color=orange!70] (0,0.5) rectangle (4,2.5); \draw[pattern=checkerboard, pattern color=orange!70] (0,0.5) rectangle (4,1.6); % Axes \draw[axis] (0,2.25) -- (5,2.25) node[above] {$x$}; \draw[axis] (0,0.5) -- (0,5) node[above] {$z$}; % Right profile (asymmetric) % \draw[profile] % (4,4) .. controls (4.8,3.5) and (4.8,1.5) .. (4,0.5); % Labels \node[right] at (4.1,3.9) {$E_{\max},\,\rho_{\max}$}; \node[right] at (4.1,0.6) {$E_{\min},\,\rho_{\min}$}; \node at (2,-0.6) {(c) ASD}; \draw[domain=0.5:4,smooth,,red,variable=\z] plot ({1*(5-cos(45+(180*\z)/(2*(4-0.5)))))},{\z}); \end{scope} \end{tikzpicture} \end{document} Current result:
- Help me draw a labor supply diagramby henry on January 15, 2026 at 6:26 am
I'm trying to draw these two diagram in a slide but I cannot do it. Anyone can help me please. This is my previous code: \begin{frame}{Backward-bending Supply Curve} \vspace{0.1cm} \begin{columns}[T] \column{0.55\textwidth} \centering \resizebox{1\textwidth}{!}{% \begin{tikzpicture} \begin{axis}[ axis lines = left, xmin=0, xmax=125, ymin=0, ymax=3200, xtick={70, 80, 90, 110}, ytick=\empty, xlabel={leisure ($L$)}, ylabel={consumption(\textdollar)}, ylabel style={rotate=90, at={(axis description cs:0.03,1)}, anchor=south}, xlabel style={at={(axis description cs:1,0)}, anchor=north west}, clip=false] \coordinate (E) at (axis cs: 110, 0); \filldraw[black] (E) circle (2.5pt) node[right, font=\footnotesize] {$E$}; \node[below, font=\scriptsize] at (axis cs: 110, -50) {}; \coordinate (P1) at (axis cs: 90, 260); \coordinate (P2) at (axis cs: 70, 800); \coordinate (P3) at (axis cs: 80, 750); \draw[lineBlue, thick] (axis cs: 0, 1430) -- (E) node[pos=0.15, left, font=\tiny, black] {$w=13$}; \draw[lineBlue, thick] (axis cs: 0, 2200) -- (E) node[pos=0.15, left, font=\tiny, black] {$w=20$}; \draw[lineBlue, thick] (axis cs: 0, 2750) -- (E) node[pos=0.15, right, font=\tiny, black] {$w=25$}; \draw[curveBlack, thick] (axis cs: 60, 800) to[out=-75, in=160] (P1) to[out=-20, in=170] (axis cs: 115, 120) node[right, font=\tiny] {$U_1$}; \draw[curveBlack, thick] (axis cs: 45, 1600) to[out=-80, in=145] (P2) to[out=-35, in=165] (axis cs: 105, 300) node[right, font=\tiny] {$U_2$}; \draw[curveBlack, thick] (axis cs: 60, 1600) to[out=-85, in=135] (P3) to[out=-45, in=170] (axis cs: 105, 200) node[right, font=\tiny] {$U_3$}; \draw[dashed, thin, gray] (P1) -- (axis cs: 90, 0); \draw[dashed, thin, gray] (P2) -- (axis cs: 70, 0); \draw[dashed, thin, gray] (P3) -- (axis cs: 80, 0); \filldraw[dotRed] (P1) circle (2pt); \filldraw[dotRed] (P2) circle (2pt); \filldraw[dotRed] (P3) circle (2pt); \draw[dotted, thick, black] (E) .. controls (100,100) .. (P1) .. controls (80, 500) .. (P3) -- (P2) node[above left, font=\tiny] {Expansion Path}; \end{axis} \end{tikzpicture} } \vspace{0.1cm} \footnotesize \textbf{(a) Optimal bundles} \column{0.45\textwidth} \centering \resizebox{1\textwidth}{!}{% \begin{tikzpicture} \begin{axis}[ axis lines = left, xmin=0, xmax=55, ymin=0, ymax=32, xtick={0, 20, 30, 40}, ytick={10, 13, 20, 25}, xlabel={Giờ làm việc ($H$)}, ylabel={Mức lương ($w$)}, ylabel style={rotate=90, at={(axis description cs:0.05,1)}, anchor=south}, xlabel style={at={(axis description cs:1,0)}, anchor=north west}, grid=major, grid style={dotted, gray!50}, clip=false ] \coordinate (S1) at (axis cs: 20, 13); \coordinate (S2) at (axis cs: 40, 20); \coordinate (S3) at (axis cs: 30, 25); \coordinate (S0) at (axis cs: 0, 10); \draw[lineBlue, very thick] (S0) to[out=10, in=-120] (S1) to[out=60, in=-90] (S2) % Đoạn dốc lên to[out=90, in=-20] (S3) % Đoạn vòng ngược to[out=160, in=-60] (axis cs: 25, 30); \filldraw[dotRed] (S1) circle (2.5pt); \filldraw[dotRed] (S2) circle (2.5pt); \filldraw[dotRed] (S3) circle (2.5pt); \filldraw[black] (S0) circle (2pt); \node[right, font=\scriptsize, color=lineBlue] at (axis cs: 30, 28) {Labor Supply}; \end{axis} \end{tikzpicture} } \vspace{0.1cm} \footnotesize \textbf{(b) Labor supply} \end{columns} \end{frame}
- Bending edges in a controlled way with tikzby Daniel A on January 15, 2026 at 12:37 am
I want two edges in this figure here that are bent and join v_2 with v_5 and v_2 with v_11 but remain in the big ellipse. The usual bend command does not allow me to do that, I have also tried some AI to help. I know there are some sophisticated answers about similar issues but I would like something simple that fixes this problem here easily. \begin{tikzpicture}[semithick, line cap=round, line join=round, scale=0.8] % --- Parameters --- \def\r{0.2} % Small circle radius % --- Coordinates --- \coordinate (ET) at (0, 3); % v1 \coordinate (EB) at (0, -3); % v2 % Inner Circles Points \coordinate (C1T) at (-3, \r); % v5 \coordinate (C1B) at (-3, -\r); % v6 \coordinate (C2T) at (-1, \r); % v7 \coordinate (C2B) at (-1, -\r); % v8 \coordinate (C3T) at (1, \r); % v9 \coordinate (C3B) at (1, -\r); % v10 \coordinate (C4T) at (3, \r); % v11 \coordinate (C4B) at (3, -\r); % v12 % --- Drawing Boundaries (Solid) --- \draw[thick] (0,0) ellipse (5 and 3); \foreach \x in {-3,-1,1,3} { \draw[thick] (\x,0) circle (\r); } % --- Inner Edges (Dashed) --- % 1. Poles Fan \draw[dashed] (ET) to[bend right=30] (C1T); \draw[dashed] (ET) to[bend right=10] (C2T); \draw[dashed] (ET) to[bend left=10] (C3T); \draw[dashed] (ET) to[bend left=30] (C4T); \draw[dashed] (EB) to[bend left=30] (C1B); \draw[dashed] (EB) to[bend left=10] (C2B); \draw[dashed] (EB) to[bend right=10] (C3B); \draw[dashed] (EB) to[bend right=30] (C4B); % 2. DEFORMED EDGES: v2 to v5 and v2 to v11 (restored) %\draw[dashed] (EB) to[bend left=60] (C1T); %\draw[dashed] (EB) to[bend right=60] (C4T); % 3. Horizontal Bridges \draw[dashed] (C1T) to[bend left=20] (C2T); \draw[dashed] (C1B) to[bend right=20] (C2B); \draw[dashed] (C2T) to[bend left=20] node[midway, above] {$b_1$} (C3T); \draw[dashed] (C2B) to[bend right=20] node[midway, below] {$b_2$} (C3B); \draw[dashed] (C3T) to[bend left=20] (C4T); \draw[dashed] (C3B) to[bend right=20] (C4B); % 4. Deformed Outer Bridges \draw[dashed] (C1T) to[bend left=10] (C2B); \draw[dashed] (C3T) to[bend left=10] (C4B); \draw[dashed] (C2B) to[bend right=10] (C3T); % --- Labeling Vertices (Adjusted for no overlap) --- \begin{scriptsize} \fill (ET) circle (1.5pt) node[above=2pt] {$v_1$}; \fill (EB) circle (1.5pt) node[below=2pt] {$v_2$}; % Circle 1 \fill (C1T) circle (1pt) node[above left] {$v_5$}; \fill (C1B) circle (1pt) node[below left] {$v_6$}; % Circle 2 \fill (C2T) circle (1pt) node[above left] {$v_7$}; \fill (C2B) circle (1pt) node[below left] {$v_8$}; % Circle 3 \fill (C3T) circle (1pt) node[above right] {$v_9$}; \fill (C3B) circle (1pt) node[below right] {$v_{10}$}; % Circle 4 \fill (C4T) circle (1pt) node[above right] {$v_{11}$}; \fill (C4B) circle (1pt) node[below right] {$v_{12}$}; \end{scriptsize} \end{tikzpicture}
- Making geometric frieze (pattern) with tikzby Erwan on January 14, 2026 at 9:11 am
i'm trying to do some geometric frieze with tikz. The last goal is to do a command to draw one of the 7 possible frieze (see wikipedia). But, first, i just do 1 frieze. Results: My code: \documentclass[tikz]{standalone} \begin{document} \newcommand{\footstep}[4]{ \begin{scope}[ xshift=#3cm, %for translation yshift=#4cm, %for translation xscale=#1, %for reflexion yscale=#2 %for reflexion ] \draw (1, 3) -- (1, 0); \draw (1, 0) -- (7, 0); \draw (6, 3) -- (7, 0); \draw (6, 3) -- (5, 0); \draw (5, 0) -- (4, 2); \draw (4, 2) -- (2, 0); \draw (2, 0) -- (1, 3); \end{scope} } \begin{tikzpicture}[rounded corners=1pt, very thick, scale=.75] \draw[help lines] (0,-1) grid (22,5); \footstep{1}{1}{0}{0} \footstep{1}{-1}{7}{3} \end{tikzpicture} \end{document} but i have to find the parameters by myself. I'd like something automatic. Something like : xshift = "scope width" yshift = "scope height" Thanks
- Boxed titles as something other than underlaysby Jesco on January 13, 2026 at 5:49 pm
This \documentclass[a4paper,12pt]{article} \usepackage{tcolorbox} \tcbuselibrary{most} \tcbset{skin=enhanced} \begin{document} \begin{tcolorbox}[flip title, title=hi] Some content \begin{tcolorbox}[flip title, title=hi] \end{tcolorbox} \end{tcolorbox} \end{document} leads to the outer box having a flip title, while the inner does not. I believe I have understood that this is because boxed titles are drawn as underlays. Is there some way to have them drawn as e.g. overlays instead, without having to resort to manually imitating them via TikZ?
- TeX capacity exceeded when tikz read from fileby JKomp on January 12, 2026 at 7:06 pm
I have a tikz graphic that generates fine when I inline the code. My document has a lot of graphics so I've been placing each tikz in its own file and importing when needed. Thus, when I placed this graphic in its own file pdf generation would fail with a TeX capacity exceeded error. I don't understand why. Here's the code that works: \documentclass{article} % LTeX: enabled=false \usepackage{tikz} \begin{document} \begin{figure} \begin{tikzpicture}[inner sep=0pt, outer sep=0pt] \definecolor{bodyOline}{RGB}{151,154,155} \definecolor{bodyFill}{RGB}{242,242,242} \definecolor{ecgGreen}{RGB}{4,203,153} \path[draw=bodyOline,fill=bodyFill] (6.1343, 11.9492).. controls (5.8796, 11.88) and (5.7804, 11.7586) .. (5.755, 11.4852).. controls (5.7461, 11.3894) and (5.7216, 11.2718) .. (5.7005, 11.224).. controls (5.6373, 11.0812) and (5.6635, 10.9434) .. (5.7921, 10.7421).. controls (5.8487, 10.6536) and (5.9002, 10.5186) .. (5.9002, 10.4592).. controls (5.9002, 10.4244) and (5.8769, 10.3504) .. (5.8485, 10.2946).. controls (5.7826, 10.1655) and (5.6565, 10.1113) .. (5.316, 10.0657).. controls (5.1705, 10.0463) and (4.9725, 9.9971) .. (4.8514, 9.9504).. controls (4.7354, 9.9057) and (4.5734, 9.8567) .. (4.4914, 9.8415).. controls (4.4095, 9.8264) and (4.2614, 9.7857) .. (4.1622, 9.7511).. controls (3.8569, 9.6448) and (3.6778, 9.6081) .. (3.3205, 9.5787).. controls (2.8182, 9.5375) and (2.7741, 9.5293) .. (2.368, 9.4022).. controls (2.1643, 9.3384) and (1.8741, 9.2675) .. (1.7233, 9.2447) -- (1.449, 9.2032) -- (1.3661, 9.2813).. controls (1.2548, 9.3862) and (1.0668, 9.4888) .. (0.9479, 9.5096).. controls (0.7757, 9.5398) and (0.7866, 9.4321) .. (0.966, 9.3308).. controls (1.0791, 9.2671) and (1.1149, 9.2077) .. (1.0407, 9.2071).. controls (0.9632, 9.2065) and (0.5831, 9.0819) .. (0.5065, 9.0321).. controls (0.3775, 8.9481) and (0.3281, 8.8325) .. (0.408, 8.8018).. controls (0.431, 8.793) and (0.4402, 8.7662) .. (0.4315, 8.7332).. controls (0.4075, 8.6415) and (0.4949, 8.6348) .. (0.5873, 8.7212) -- (0.6687, 8.7974) -- (0.6225, 8.7248).. controls (0.5414, 8.5976) and (0.6282, 8.5155) .. (0.7276, 8.6254).. controls (0.7539, 8.6545) and (0.7879, 8.6783) .. (0.8031, 8.6783).. controls (0.8201, 8.6783) and (0.8185, 8.6661) .. (0.799, 8.6466).. controls (0.7002, 8.5478) and (0.8155, 8.5148) .. (0.9737, 8.5966).. controls (1.0275, 8.6244) and (1.1416, 8.6598) .. (1.2272, 8.6753).. controls (1.3128, 8.6908) and (1.4319, 8.7271) .. (1.4918, 8.756).. controls (1.5906, 8.8037) and (1.6707, 8.8096) .. (2.3548, 8.8199).. controls (3.0998, 8.8312) and (3.1174, 8.8328) .. (3.8232, 8.9504).. controls (4.2161, 9.0159) and (4.6661, 9.0816) .. (4.8231, 9.0965).. controls (4.9801, 9.1113) and (5.1262, 9.1381) .. (5.1478, 9.156).. controls (5.1694, 9.1739) and (5.1941, 9.1815) .. (5.2027, 9.173).. controls (5.2113, 9.1644) and (5.2234, 8.9097) .. (5.2296, 8.6069).. controls (5.2358, 8.3042) and (5.2534, 7.9196) .. (5.2686, 7.7523).. controls (5.323, 7.1562) and (5.3273, 6.6689) .. (5.2796, 6.4952).. controls (5.1854, 6.1515) and (5.1977, 5.4763) .. (5.3213, 4.217).. controls (5.3371, 4.0552) and (5.343, 3.835) .. (5.3344, 3.7275).. controls (5.2565, 2.7617) and (5.2564, 2.6914) .. (5.332, 2.2258).. controls (5.3895, 1.8717) and (5.4007, 1.7318) .. (5.3896, 1.5081).. controls (5.3717, 1.1474) and (5.3478, 1.0764) .. (5.1569, 0.8191).. controls (4.9456, 0.534) and (4.9341, 0.5004) .. (5.0153, 0.4058).. controls (5.0507, 0.3645) and (5.1006, 0.3288) .. (5.1262, 0.3264).. controls (5.1517, 0.324) and (5.2234, 0.3149) .. (5.2854, 0.3062).. controls (5.4295, 0.2859) and (5.5998, 0.3658) .. (5.6362, 0.4707).. controls (5.6498, 0.5101) and (5.6811, 0.5781) .. (5.7056, 0.6218).. controls (5.7301, 0.6654) and (5.7849, 0.7638) .. (5.8274, 0.8404) -- (5.9046, 0.9797) -- (5.864, 1.2505).. controls (5.8111, 1.6038) and (5.8264, 1.8986) .. (5.9134, 2.2008).. controls (5.9674, 2.3887) and (5.9881, 2.5389) .. (6.0069, 2.8812).. controls (6.0378, 3.4423) and (6.0767, 3.8307) .. (6.1237, 4.0481).. controls (6.1441, 4.1427) and (6.1752, 4.3367) .. (6.1927, 4.4791).. controls (6.2102, 4.6215) and (6.2305, 4.732) .. (6.2379, 4.7247).. controls (6.2453, 4.7173) and (6.2545, 4.184) .. (6.2585, 3.5396).. controls (6.2624, 2.8953) and (6.2738, 2.1706) .. (6.2839, 1.9292).. controls (6.2982, 1.5853) and (6.293, 1.433) .. (6.2599, 1.2249).. controls (6.2367, 1.0789) and (6.2177, 0.9363) .. (6.2177, 0.9081).. controls (6.2177, 0.8392) and (6.354, 0.7036) .. (6.4905, 0.6369).. controls (6.5515, 0.607) and (6.6645, 0.5232) .. (6.7416, 0.4507).. controls (6.884, 0.3168) and (7.0274, 0.252) .. (7.1447, 0.2686).. controls (7.2738, 0.2869) and (7.3366, 0.5764) .. (7.2359, 0.6893).. controls (7.207, 0.7215) and (7.106, 0.81) .. (7.0115, 0.8859).. controls (6.8981, 0.9768) and (6.818, 1.0669) .. (6.7763, 1.1504).. controls (6.7196, 1.264) and (6.7149, 1.2992) .. (6.7299, 1.4918).. controls (6.747, 1.7115) and (6.7843, 1.9371) .. (6.8771, 2.3812).. controls (6.9436, 2.6994) and (6.9849, 3.032) .. (6.9854, 3.2537).. controls (6.9857, 3.3486) and (7.004, 3.5097) .. (7.0261, 3.6116).. controls (7.1264, 4.0736) and (7.1188, 4.0086) .. (7.2122, 5.1991).. controls (7.2554, 5.7494) and (7.251, 6.332) .. (7.2003, 6.7842).. controls (7.1749, 7.0112) and (7.2019, 7.399) .. (7.2732, 7.8317).. controls (7.3297, 8.1742) and (7.3953, 9.0021) .. (7.3709, 9.0656).. controls (7.3633, 9.0854) and (7.364, 9.1198) .. (7.3726, 9.1421).. controls (7.3854, 9.1756) and (7.4156, 9.1674) .. (7.5503, 9.0936).. controls (7.765, 8.976) and (8.0756, 8.8964) .. (8.4005, 8.8759).. controls (8.546, 8.8666) and (8.7016, 8.848) .. (8.7461, 8.8344).. controls (8.8928, 8.7898) and (9.7504, 8.7645) .. (10.3375, 8.7875).. controls (10.927, 8.8106) and (11.1195, 8.7956) .. (11.2777, 8.7144).. controls (11.3177, 8.6939) and (11.4248, 8.6761) .. (11.5157, 8.6748).. controls (11.6091, 8.6735) and (11.7354, 8.6511) .. (11.8058, 8.6233).. controls (11.911, 8.5818) and (11.9362, 8.5797) .. (11.9666, 8.6102).. controls (11.9864, 8.63) and (12.0256, 8.6508) .. (12.0536, 8.6565).. controls (12.0851, 8.6628) and (12.104, 8.6878) .. (12.103, 8.7217).. controls (12.1018, 8.762) and (12.114, 8.7733) .. (12.149, 8.7642).. controls (12.2164, 8.7465) and (12.2402, 8.8279) .. (12.1853, 8.8886).. controls (12.1432, 8.9352) and (12.1432, 8.9397) .. (12.1862, 8.9637).. controls (12.248, 8.9983) and (12.2174, 9.0688) .. (12.1252, 9.1043).. controls (12.0848, 9.1198) and (11.9625, 9.1496) .. (11.8533, 9.1703).. controls (11.5671, 9.2248) and (11.5691, 9.2235) .. (11.6475, 9.3075).. controls (11.7358, 9.4023) and (11.7815, 9.4938) .. (11.7636, 9.5403).. controls (11.7417, 9.5973) and (11.7001, 9.5865) .. (11.5658, 9.4885).. controls (11.4984, 9.4393) and (11.3539, 9.3547) .. (11.2448, 9.3006).. controls (11.047, 9.2024) and (11.0456, 9.2021) .. (10.7993, 9.2187).. controls (10.6634, 9.2279) and (10.3806, 9.2703) .. (10.1709, 9.3129).. controls (9.9052, 9.367) and (9.6777, 9.3947) .. (9.4206, 9.4044).. controls (9.0365, 9.4188) and (8.8567, 9.4469) .. (8.7308, 9.512).. controls (8.6899, 9.5331) and (8.5274, 9.5872) .. (8.3697, 9.6321).. controls (8.212, 9.677) and (7.985, 9.7552) .. (7.8653, 9.806).. controls (7.7455, 9.8567) and (7.573, 9.9102) .. (7.4819, 9.9249).. controls (7.3867, 9.9402) and (7.2047, 10.004) .. (7.0542, 10.0748).. controls (6.8344, 10.1782) and (6.7865, 10.2118) .. (6.7563, 10.284).. controls (6.6999, 10.4191) and (6.7122, 10.4872) .. (6.8395, 10.7449).. controls (6.9586, 10.986) and (6.994, 11.1723) .. (6.9325, 11.2338).. controls (6.9182, 11.2481) and (6.8897, 11.3558) .. (6.8692, 11.4729).. controls (6.8007, 11.8652) and (6.7541, 11.9079) .. (6.3235, 11.9727).. controls (6.2872, 11.9781) and (6.202, 11.9676) .. (6.1343, 11.9492); \begin{scope}[line width=1.0pt, circle,minimum size=19.0pt,font=\small] \node[draw=black,fill=red] (LL) at (6.5,1.5) {\textbf{LL}}; \node[draw=black,fill=ecgGreen] (RL) at (5.6,1.5) {\textbf{RL}}; \node[draw=black,fill=white] (RA) at (1.75,9.0) {\textbf{RA}}; \node[draw=black,fill=black,text=white] (LA) at (11.0,9.0) {\textbf{LA}}; \end{scope} \draw[<->, blue,line width = 3.0pt] (RA) -- node[yshift=0.35cm,font=\Large] {\textbf{I}} (LA); \draw[<->, blue,line width = 3.0pt] (RA) -- node[xshift=0.5cm,font=\Large] {\textbf{II}} (LL); \draw[<->, blue,line width = 3.0pt] (LA) -- node[xshift=0.6cm,font=\Large] {\textbf{III}} (LL); \end{tikzpicture} \end{figure} \end{document} Now if I place this in two files: file: myGraphic.tex \documentclass{article} % LTeX: enabled=false \usepackage{tikz} \begin{document} \begin{figure} \begin{tikzpicture} \input{Limb_leads2.tex} \end{tikzpicture} \end{figure} file: Limb_leads2.tex % Original body sillouette from Wikipedia % By Npatchett - Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=39235282 % https://commons.wikimedia.org/wiki/File:Limb_leads_of_EKG.png#/media/File:Limb_leads_of_EKG.png % 1) Copied one sillouette image % 2) Removed extraneous graphics % 3) Converted to SVG % 4) Converted to tikz \begin{tikzpicture}[inner sep=0pt, outer sep=0pt] \definecolor{bodyOline}{RGB}{151,154,155} \definecolor{bodyFill}{RGB}{242,242,242} \definecolor{ecgGreen}{RGB}{4,203,153} \path[draw=bodyOline,fill=bodyFill] (6.1343, 11.9492).. controls (5.8796, 11.88) and (5.7804, 11.7586) .. (5.755, 11.4852).. controls (5.7461, 11.3894) and (5.7216, 11.2718) .. (5.7005, 11.224).. controls (5.6373, 11.0812) and (5.6635, 10.9434) .. (5.7921, 10.7421).. controls (5.8487, 10.6536) and (5.9002, 10.5186) .. (5.9002, 10.4592).. controls (5.9002, 10.4244) and (5.8769, 10.3504) .. (5.8485, 10.2946).. controls (5.7826, 10.1655) and (5.6565, 10.1113) .. (5.316, 10.0657).. controls (5.1705, 10.0463) and (4.9725, 9.9971) .. (4.8514, 9.9504).. controls (4.7354, 9.9057) and (4.5734, 9.8567) .. (4.4914, 9.8415).. controls (4.4095, 9.8264) and (4.2614, 9.7857) .. (4.1622, 9.7511).. controls (3.8569, 9.6448) and (3.6778, 9.6081) .. (3.3205, 9.5787).. controls (2.8182, 9.5375) and (2.7741, 9.5293) .. (2.368, 9.4022).. controls (2.1643, 9.3384) and (1.8741, 9.2675) .. (1.7233, 9.2447) -- (1.449, 9.2032) -- (1.3661, 9.2813).. controls (1.2548, 9.3862) and (1.0668, 9.4888) .. (0.9479, 9.5096).. controls (0.7757, 9.5398) and (0.7866, 9.4321) .. (0.966, 9.3308).. controls (1.0791, 9.2671) and (1.1149, 9.2077) .. (1.0407, 9.2071).. controls (0.9632, 9.2065) and (0.5831, 9.0819) .. (0.5065, 9.0321).. controls (0.3775, 8.9481) and (0.3281, 8.8325) .. (0.408, 8.8018).. controls (0.431, 8.793) and (0.4402, 8.7662) .. (0.4315, 8.7332).. controls (0.4075, 8.6415) and (0.4949, 8.6348) .. (0.5873, 8.7212) -- (0.6687, 8.7974) -- (0.6225, 8.7248).. controls (0.5414, 8.5976) and (0.6282, 8.5155) .. (0.7276, 8.6254).. controls (0.7539, 8.6545) and (0.7879, 8.6783) .. (0.8031, 8.6783).. controls (0.8201, 8.6783) and (0.8185, 8.6661) .. (0.799, 8.6466).. controls (0.7002, 8.5478) and (0.8155, 8.5148) .. (0.9737, 8.5966).. controls (1.0275, 8.6244) and (1.1416, 8.6598) .. (1.2272, 8.6753).. controls (1.3128, 8.6908) and (1.4319, 8.7271) .. (1.4918, 8.756).. controls (1.5906, 8.8037) and (1.6707, 8.8096) .. (2.3548, 8.8199).. controls (3.0998, 8.8312) and (3.1174, 8.8328) .. (3.8232, 8.9504).. controls (4.2161, 9.0159) and (4.6661, 9.0816) .. (4.8231, 9.0965).. controls (4.9801, 9.1113) and (5.1262, 9.1381) .. (5.1478, 9.156).. controls (5.1694, 9.1739) and (5.1941, 9.1815) .. (5.2027, 9.173).. controls (5.2113, 9.1644) and (5.2234, 8.9097) .. (5.2296, 8.6069).. controls (5.2358, 8.3042) and (5.2534, 7.9196) .. (5.2686, 7.7523).. controls (5.323, 7.1562) and (5.3273, 6.6689) .. (5.2796, 6.4952).. controls (5.1854, 6.1515) and (5.1977, 5.4763) .. (5.3213, 4.217).. controls (5.3371, 4.0552) and (5.343, 3.835) .. (5.3344, 3.7275).. controls (5.2565, 2.7617) and (5.2564, 2.6914) .. (5.332, 2.2258).. controls (5.3895, 1.8717) and (5.4007, 1.7318) .. (5.3896, 1.5081).. controls (5.3717, 1.1474) and (5.3478, 1.0764) .. (5.1569, 0.8191).. controls (4.9456, 0.534) and (4.9341, 0.5004) .. (5.0153, 0.4058).. controls (5.0507, 0.3645) and (5.1006, 0.3288) .. (5.1262, 0.3264).. controls (5.1517, 0.324) and (5.2234, 0.3149) .. (5.2854, 0.3062).. controls (5.4295, 0.2859) and (5.5998, 0.3658) .. (5.6362, 0.4707).. controls (5.6498, 0.5101) and (5.6811, 0.5781) .. (5.7056, 0.6218).. controls (5.7301, 0.6654) and (5.7849, 0.7638) .. (5.8274, 0.8404) -- (5.9046, 0.9797) -- (5.864, 1.2505).. controls (5.8111, 1.6038) and (5.8264, 1.8986) .. (5.9134, 2.2008).. controls (5.9674, 2.3887) and (5.9881, 2.5389) .. (6.0069, 2.8812).. controls (6.0378, 3.4423) and (6.0767, 3.8307) .. (6.1237, 4.0481).. controls (6.1441, 4.1427) and (6.1752, 4.3367) .. (6.1927, 4.4791).. controls (6.2102, 4.6215) and (6.2305, 4.732) .. (6.2379, 4.7247).. controls (6.2453, 4.7173) and (6.2545, 4.184) .. (6.2585, 3.5396).. controls (6.2624, 2.8953) and (6.2738, 2.1706) .. (6.2839, 1.9292).. controls (6.2982, 1.5853) and (6.293, 1.433) .. (6.2599, 1.2249).. controls (6.2367, 1.0789) and (6.2177, 0.9363) .. (6.2177, 0.9081).. controls (6.2177, 0.8392) and (6.354, 0.7036) .. (6.4905, 0.6369).. controls (6.5515, 0.607) and (6.6645, 0.5232) .. (6.7416, 0.4507).. controls (6.884, 0.3168) and (7.0274, 0.252) .. (7.1447, 0.2686).. controls (7.2738, 0.2869) and (7.3366, 0.5764) .. (7.2359, 0.6893).. controls (7.207, 0.7215) and (7.106, 0.81) .. (7.0115, 0.8859).. controls (6.8981, 0.9768) and (6.818, 1.0669) .. (6.7763, 1.1504).. controls (6.7196, 1.264) and (6.7149, 1.2992) .. (6.7299, 1.4918).. controls (6.747, 1.7115) and (6.7843, 1.9371) .. (6.8771, 2.3812).. controls (6.9436, 2.6994) and (6.9849, 3.032) .. (6.9854, 3.2537).. controls (6.9857, 3.3486) and (7.004, 3.5097) .. (7.0261, 3.6116).. controls (7.1264, 4.0736) and (7.1188, 4.0086) .. (7.2122, 5.1991).. controls (7.2554, 5.7494) and (7.251, 6.332) .. (7.2003, 6.7842).. controls (7.1749, 7.0112) and (7.2019, 7.399) .. (7.2732, 7.8317).. controls (7.3297, 8.1742) and (7.3953, 9.0021) .. (7.3709, 9.0656).. controls (7.3633, 9.0854) and (7.364, 9.1198) .. (7.3726, 9.1421).. controls (7.3854, 9.1756) and (7.4156, 9.1674) .. (7.5503, 9.0936).. controls (7.765, 8.976) and (8.0756, 8.8964) .. (8.4005, 8.8759).. controls (8.546, 8.8666) and (8.7016, 8.848) .. (8.7461, 8.8344).. controls (8.8928, 8.7898) and (9.7504, 8.7645) .. (10.3375, 8.7875).. controls (10.927, 8.8106) and (11.1195, 8.7956) .. (11.2777, 8.7144).. controls (11.3177, 8.6939) and (11.4248, 8.6761) .. (11.5157, 8.6748).. controls (11.6091, 8.6735) and (11.7354, 8.6511) .. (11.8058, 8.6233).. controls (11.911, 8.5818) and (11.9362, 8.5797) .. (11.9666, 8.6102).. controls (11.9864, 8.63) and (12.0256, 8.6508) .. (12.0536, 8.6565).. controls (12.0851, 8.6628) and (12.104, 8.6878) .. (12.103, 8.7217).. controls (12.1018, 8.762) and (12.114, 8.7733) .. (12.149, 8.7642).. controls (12.2164, 8.7465) and (12.2402, 8.8279) .. (12.1853, 8.8886).. controls (12.1432, 8.9352) and (12.1432, 8.9397) .. (12.1862, 8.9637).. controls (12.248, 8.9983) and (12.2174, 9.0688) .. (12.1252, 9.1043).. controls (12.0848, 9.1198) and (11.9625, 9.1496) .. (11.8533, 9.1703).. controls (11.5671, 9.2248) and (11.5691, 9.2235) .. (11.6475, 9.3075).. controls (11.7358, 9.4023) and (11.7815, 9.4938) .. (11.7636, 9.5403).. controls (11.7417, 9.5973) and (11.7001, 9.5865) .. (11.5658, 9.4885).. controls (11.4984, 9.4393) and (11.3539, 9.3547) .. (11.2448, 9.3006).. controls (11.047, 9.2024) and (11.0456, 9.2021) .. (10.7993, 9.2187).. controls (10.6634, 9.2279) and (10.3806, 9.2703) .. (10.1709, 9.3129).. controls (9.9052, 9.367) and (9.6777, 9.3947) .. (9.4206, 9.4044).. controls (9.0365, 9.4188) and (8.8567, 9.4469) .. (8.7308, 9.512).. controls (8.6899, 9.5331) and (8.5274, 9.5872) .. (8.3697, 9.6321).. controls (8.212, 9.677) and (7.985, 9.7552) .. (7.8653, 9.806).. controls (7.7455, 9.8567) and (7.573, 9.9102) .. (7.4819, 9.9249).. controls (7.3867, 9.9402) and (7.2047, 10.004) .. (7.0542, 10.0748).. controls (6.8344, 10.1782) and (6.7865, 10.2118) .. (6.7563, 10.284).. controls (6.6999, 10.4191) and (6.7122, 10.4872) .. (6.8395, 10.7449).. controls (6.9586, 10.986) and (6.994, 11.1723) .. (6.9325, 11.2338).. controls (6.9182, 11.2481) and (6.8897, 11.3558) .. (6.8692, 11.4729).. controls (6.8007, 11.8652) and (6.7541, 11.9079) .. (6.3235, 11.9727).. controls (6.2872, 11.9781) and (6.202, 11.9676) .. (6.1343, 11.9492); \begin{scope}[line width=1.0pt, circle,minimum size=19.0pt,font=\small] \node[draw=black,fill=red] (LL) at (6.5,1.5) {\textbf{LL}}; \node[draw=black,fill=ecgGreen] (RL) at (5.6,1.5) {\textbf{RL}}; \node[draw=black,fill=white] (RA) at (1.75,9.0) {\textbf{RA}}; \node[draw=black,fill=black,text=white] (LA) at (11.0,9.0) {\textbf{LA}}; \end{scope} \draw[<->, blue,line width = 3.0pt] (RA) -- node[yshift=0.35cm,font=\Large] {\textbf{I}} (LA); \draw[<->, blue,line width = 3.0pt] (RA) -- node[xshift=0.5cm,font=\Large] {\textbf{II}} (LL); \draw[<->, blue,line width = 3.0pt] (LA) -- node[xshift=0.6cm,font=\Large] {\textbf{III}} (LL); \end{tikzpicture} I get: TeX capacity exceeded, sorry [input stack size=10000]. \pgf@selectfontorig ->\pgf@selectfontorig I can get it to build if I remove all font=`` and ``\textbf references. Why would importing the file make a difference?
- Put a text in the middle of a path move operation in Tikzby Harald on January 12, 2026 at 4:24 pm
I know how to use \draw (0,0) -- node[below]{X} (10,0); to put the text X in the middle below the line between the coordinates. What I would like to have is the very same, but without drawing the line, yet the following does not work (somewhat to my surprise :-/) \draw (0,0) node[below]{X} (10,0); I figured out a way involving node at ($ ...!.5!... $) yet \draw would sometimes be a bit more natural and I would in particular like to understand why it does not work, as I seem to miss some fundamental knowledge here.
- How to highlight a rank and file with lines and box the coordinate labels on a chessboard diagram?by Dao Minh Duc on January 12, 2026 at 4:08 pm
I can already place pieces, arrows, and coordinates on the chessboard. What I’d like to do now is to highlight a specific rank and file by: drawing a horizontal line across a rank (e.g. rank 5), drawing a vertical line along a file (e.g. file d), and drawing rectangular boxes around the corresponding coordinate labels (5 and d), as shown in the image below. Is there a standard or recommended way to do this using common chess diagram tools (e.g. LaTeX chessboard / xskak with TikZ overlays, or other libraries)? Thanks a lot
- tikz: using the pos key to place nodes along a plotby Jasper on January 11, 2026 at 7:39 pm
In this tikz MWE, why is the node placement not even close to pos=0.7 on a plotted curve? \documentclass[tikz,border=1cm]{standalone} \begin{document} \begin{tikzpicture} \draw[ domain = 0:2, samples = 100, variable = \y ] plot (\y*\y,\y) node[pos = 0.7, above left] {\(x=y^2\)} ; \end{tikzpicture} \end{document}
- Creating a CircuiTikz custom voltage source component/style with a plus sign for polarityby MatG on January 11, 2026 at 6:24 pm
In certain contexts (italian schools) an ideal DC voltage source is represented by the symbol in this circuit: \documentclass{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz} \draw (0,0) to[V,a^=V1,name=VS] (0,4); \node[above left,inner sep=1pt] at (VS.e) {$+$}; \draw (0,0) to[V,a=V2,name=VS] (4,0); \node[above right,inner sep=1pt] at (VS.e) {$+$}; \draw (4,4) to[V,a=V3,name=VS] (0,4); \node[below left,inner sep=1pt] at (VS.e) {$+$}; \draw (4,4) to[V,a^=V4,name=VS] (4,0); \node[below right,inner sep=1pt] at (VS.e) {$+$}; \end{circuitikz} \end{document} This is the symbol I want. Unfortunately, drawing circuits like this is rather cumbersome, so I’m wondering whether it would be possible to define a CircuiTikz style or a custom component that produces the symbol in a more natural way. I’m not a TikZ expert, and I struggle with the part of the documentation that explains how to create new components. I’m aware of existing questions such as: Adding a plus sign in a circuit diagram Including +/- signs to battery in Circuitikz But the answers there didn't help me. I also had no luck with AI tools, so I’m hoping someone with more experience in CircuiTikz and TikZ can offer some guidance.
- circuitikz: 'draw=none' for a electrical symbolby cis on January 11, 2026 at 4:58 pm
If I use color=white, the resistor R wouldn't be visible unless I added a colored background. Out of theoretical interest: Is there a way to pass the resistor with something like draw=none, so that it isn't drawn? (The rest should be drawn as before.) \documentclass[margin=5pt, multi=circuitikz]{standalone} \usepackage{circuitikz} \usetikzlibrary{backgrounds} \begin{document} \begin{circuitikz}[european resistors, background rectangle/.style={draw=none, fill=gray!25, rounded corners}, show background rectangle, ] \draw[] (0,0) to[L=L] (2,0) to[R=R](4,0); \draw[yshift=-12mm] (0,0) to[L=L] (2,0) to[R=R, color=white](4,0); \end{circuitikz} \end{document}
- How to tweak the distance of resistor's "+"/"-" label's vertical distance when `raised` is set?by Explorer on January 10, 2026 at 10:09 am
I have the following code: \documentclass[margin=5pt]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[european] \ctikzset{voltage=raised}%<- \draw (0,0) -- ++(1,0) to[R=R,label distance=3pt, v=$\mathrm{u_R}$] ++(0,+3) -- ++(-1,0); \end{circuitikz} \end{document} However, I want the "+" and "-" to get closer with "u_R"(that is: shift "+" up and shift "-" down), I have tried shift and label distance and voltage/distance from node, but all failed, because they justs tweak the distance between the wire. It's hard for me to dig it out from the manual, is that exists elegant method?
- Simple way to show/hide controls points in a Tikz line?by YaGoi Root on January 9, 2026 at 2:18 pm
In Tikz diagrams, one of the best ways to make controlled curved lines (such as pointing arrows in a flow chart) is using \draw with control points. For example, \documentclass{article} \usepackage{graphicx} \usepackage{tikz} \usetikzlibrary{decorations.pathmorphing} \usetikzlibrary{shapes.arrows, arrows.meta} \begin{document} \begin{figure} \begin{tikzpicture} \draw[thick,->,>=Stealth, show controls] (0,0) .. controls (0.5,3) and (4.5,0).. (5,5); \end{tikzpicture} \end{figure} \end{document} However, I feel like it ends up being a sort of guessing game when trying to determine where to actually place the control points, because I have a hard time visualizing where the points are, but once I know where they are I know how their position affects the curved line. I understand how the points effect the line very intuitively, but moving said points to the desired location is easier when you can see the points as well. Is there any simple way to "toggle" on a display of the control points, so that you can see them while editing the diagram, and then hide them when you've got the line that you want?
- How to use turn coordinate specification in combination with global transforms like scale and shift?by dsacre on January 8, 2026 at 1:54 pm
Scenario Consider the following: One needs to draw from a point on a curve following its tangent direction. TikZ provides for this scenario the ([turn]<ANGLE>:<DISTANCE>) syntax. As one continues the image, it becomes too big for the page layout. In order to prevent having to recreate the complete image with a smaller size, one tries to use the scale parameter (globally on the tikzpicture or via scope does not make a difference for this scenario). MWE \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} % DESCRIPTION: Plain, no modification % STATUS: WORKING \draw[black] (0,0) arc(0:90:-1.5 and 1.5) arc(90:135:-2.0 and 2.0) --([turn]0:0.5) node[below]{plain} ; % DESCRIPTION: Scale % STATUS: FAIL \begin{scope}[scale=0.5] \draw[red] (0,0) arc(0:90:-1.5 and 1.5) arc(90:135:-2.0 and 2.0) --([turn]0:0.5) node[below]{scale} ; \end{scope} % DESCRIPTION: Shift % STATUS: FAIL \begin{scope}[xshift=5cm] \draw[red] (0,0) arc(0:90:-1.5 and 1.5) arc(90:135:-2.0 and 2.0) --([turn]0:0.5) node[below]{xshift} ; \end{scope} \end{tikzpicture} \end{document} Result As soon as transformation are applied, the result of the ([turn]<ANGLE>:<DISTANCE>) specification is wrong. Research so far It was tried to encapsulate the \draw command into a TikZ pic, hoping that this might act as a wrapper, but the result was identical. The corresponding section 13.4.2: Rotational Relative Coordinates of the TikZ manual specifies: The effect of this key is to locally shift the coordinate system so that the last point reached is at the origin and the coordinate system is “turned” so that the (x)-axis points in the direction of a tangent entering the last point. From that, I would assume that certain global transforms cannot/will not be taken into account properly. Question Is it possible to use the ([turn]<ANGLE>:<DISTANCE>) syntax under (global) transformations? If not, is there another option to achieve the same functionality or an easy way to implement it? UPDATE: 2026-01-12 I have opened a GitHub Issue, since this behavior seems to be a bug.
- How to use specific height in tikz tcolorboxby user386618 on January 4, 2026 at 9:53 am
I wanted to set the coordinate that it's height is one third of a box that consists of 1 line, but tikz don't understand. What to do? \documentclass[10pt]{book} \usepackage[english]{babel} \usepackage[most]{tcolorbox} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tcolorbox}[enhanced, width=\linewidth, frame hidden, interior hidden, overlay={\draw[x=\dimexpr\ht\strutbox+\dp\strutbox\relax, y=\dimexpr\ht\strutbox+\dp\strutbox\relax] (1/3,0)--(0,1/3)--($(frame.north west)-(0,1/3)$)--($(frame.north west)+(1/3,0)$)--($(frame.north east)-(1/3,0)$)--($(frame.north east)-(0,1/3)$)--($(frame.south east)+(0,1/3)$)--($(frame.south east)-(1/3,0)$)--cycle;}] Smth \end{tcolorbox} \end{document} I want the shape to be like a part of regular octagon like below so for one line is more like a stretched regular octagon, i can approximate but want to be more precise
- The strange gap in spath3’s `keep middle` — It’s not a bug, it’s a feature?by kabenyuk on September 20, 2025 at 9:00 am
This question stems from the discussion in: Incorrect spath3 "split at" method with a continued line? Why does the 1/3 point look so strange, and why does a gap appear when splitting a path in spath3? In my opinion, the following occurs. Everything below is merely my personal interpretation, which may not be entirely correct. Here is the diagram and its code — it’s helpful to keep them in view. \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{spath3} \begin{document} \begin{tikzpicture} \draw[help lines, step=0.5cm, gray!20, ultra thin] (-1,-3) grid (4,0); \draw[help lines, step=1cm, black!30, very thin] (-1,-3) grid (4,0); \path[spath/save=pathA,ultra thick, red!30] (0,0) -- (1,0)-- (3,0); \node[left] at (0,0) {\small$A:$}; \draw[spath/split at keep middle={pathA}{1/3}{2/3}, spath/use=pathA,densely dashed, red, thick]; \draw[spath/split at keep start={pathA}{1/3}, spath/use=pathA, red, ultra thick]; \draw[spath/split at keep end={pathA}{2/3}, spath/use=pathA, red, ultra thick]; \path[spath/save=pathB,ultra thick, red!30] (0,-1) -- (1,-1) (1,-1)-- (3,-1); \node[left] at (0,-1) {\small$B:$}; \draw[spath/split at keep middle={pathB}{1/3}{2/3}, spath/use=pathB,densely dashed, blue, thick]; \draw[spath/split at keep start={pathB}{1/3}, spath/use=pathB, blue, ultra thick]; \draw[spath/split at keep end={pathB}{2/3}, spath/use=pathB, blue, ultra thick]; \path[spath/save=pathC,ultra thick, red!30] (0,-2) -- (1,-2)-- (1.5,-2); \node[left] at (0,-2) {\small$C:$}; \draw[spath/split at keep middle={pathC}{1/3}{2/3}, spath/use=pathC,densely dashed, green!70!black, thick]; \draw[spath/split at keep start={pathC}{1/3}, spath/use=pathC, green!70!black, ultra thick]; \draw[spath/split at keep end={pathC}{2/3}, spath/use=pathC, green!70!black, ultra thick]; \path[spath/save=pathD,ultra thick, red!30] (0,-3) -- (0.5,-3) -- (1,-3) -- (3,-3); \node[left] at (0,-3) {\small$D:$}; \draw[spath/split at keep middle={pathD}{1/3}{2/3}, spath/use=pathD,densely dashed, orange, thick]; \draw[spath/split at keep start={pathD}{1/3}, spath/use=pathD, orange, ultra thick]; \draw[spath/split at keep end={pathD}{2/3}, spath/use=pathD, orange, ultra thick]; \end{tikzpicture} \end{document} In spath3, every path consists of segments, where each segment is either a straight line or a Bézier curve. By default, the spath/split at ... operations in the spath3 library use segment-based parametrization, not parametrization by actual geometric length. This means that the parametric time t ∈ [0,1] is distributed uniformly across the number of segments — not proportionally to their geometric lengths. Example (case A): Consider the path: (0,0) -- (1,0) -- (3,0) spath3 treats this path as consisting of two segments: First: from 0 to 1; Second: from 1 to 3. Parametrically: The first segment occupies the interval t ∈ [0.0, 0.5]; The second segment occupies t ∈ [0.5, 1.0]. Thus, each segment is assigned an equal parametric interval of 0.5. What happens during default splitting: 1/3 ≈ 0.333 → falls into the first segment. Relative position within the segment: 0.333 / 0.5 = 0.666 → Therefore, the end of the first third lies at point 0.666. 2/3 ≈ 0.666 → falls into the second segment. Relative position: (0.666 - 0.5) / 0.5 = 0.333 (i.e., 0.666 units from the start of the second segment) → Therefore, the end of the second third lies at point 1 + 0.666 = 1.666. It is now clear why the first and last thirds (solid lines) are drawn as [0, 0.666] and [1.666, 3]. The middle third (keep middle={path}{1/3}{2/3}): Technically, the middle third starts at 0.666, but it is rendered starting from 1.0. Why? What is the internal logic of spath3 that explains this seemingly strange behavior? P.S. cfr kindly reminded me (thank you!) that similar behavior exists in PGF/TikZ — for example, pos appears to work on simple paths like |- or -|, but is not officially supported on multi-segment paths (manual: “position placement does not work, currently”). What spath3 does is make this limitation visible — which is why the question arises here, and likely couldn’t be asked as clearly elsewhere.
- Non-linear transformation of textby David Purton on August 16, 2025 at 2:20 pm
My end goal is to apply a specific wave warp to a short block of text in line with a style guide. Below is my attempt. I've applied the transform to a 4 by 4 grid and it behaves as I want with the sine wave having maximum height in the middle of the grid and reducing until the top and bottom of the grid remain horizontal. The second transform uses the text converted to a path in Inkscape and exported as TikZ code (sorry it's long). This also does what I want. The third example shows what I wish I could do in just putting the text in a node. I know that this is not possible to do this way as the TikZ documentation states: When /tikz/transform shape nonlinear is set to true, TikZ will try to apply any current nonlinear transformation also to nodes. Typically, for the text in nodes this is not possible in general, in such cases a linear approximation of the nonlinear transformation is used. But converting to curves in Inkscape and then applying the transform is a little too manual. I would like a more automated option, so that I can easily change the text and have a new wave output. Question: Is there a way I can do this? It does not have to be using TikZ (but I do want LaTeX). It can use l3draw or lua code. \documentclass{article} \usepackage{tikz} \usepgfmodule{nonlineartransformations} \pagestyle{empty} \makeatletter \def\wavewarp{% \pgf@ya=\pgf@y% \pgfmathsetmacro{\warped@y}{% \pgf@ya+% 0.01*\pgfkeysvalueof{/tikz/wave warp/bend}*% \pgfkeysvalueof{/tikz/wave warp/height}*% sin(\pgf@x/\pgfkeysvalueof{/tikz/wave warp/width}*360)*% sin(\pgf@ya/\pgfkeysvalueof{/tikz/wave warp/height}*180)% }% \pgf@y=\warped@y pt% } \makeatother \newsavebox{\warpbox} \newlength{\warpboxwd} \newlength{\warpboxht} \begin{document} \tikzset{ wave warp/width/.initial=\warpboxwd, wave warp/height/.initial=\warpboxht, wave warp/bend/.initial=10 } \newcommand*{\grid}{\draw (0,0) grid (4,4);} \sbox\warpbox{\tikz{\grid}} \setlength{\warpboxwd}{\wd\warpbox} \setlength{\warpboxht}{\ht\warpbox} \begin{tikzpicture} \begin{scope} \pgftransformnonlinear{\wavewarp} \grid \end{scope} \end{tikzpicture} \vspace{1cm} \tikzset{x=1pt,y=1pt} \newcommand*{\textaspath}{% \fill[shift={(6.6, 8.6)}] (11.8, -8.6) -- (6.0, -8.6) -- (6.0, 8.1) -- (0.8, 8.1) -- (0.8, 12.8) -- (17.0, 12.8) -- (17.0, 8.1) -- (11.8, 8.1) -- cycle(32.8, -8.6) -- (20.1, -8.6) -- (20.1, 12.8) -- (32.8, 12.8) -- (32.8, 8.2) -- (25.9, 8.2) -- (25.9, 4.8) -- (32.3, 4.8) -- (32.3, 0.2) -- (25.9, 0.2) -- (25.9, -3.9) -- (32.8, -3.9) -- cycle(55.9, -8.6) -- (49.2, -8.6) -- (45.0, -1.9) -- (40.9, -8.6) -- (34.3, -8.6) -- (41.4, 2.4) -- (34.7, 12.8) -- (41.2, 12.8) -- (45.0, 6.2) -- (48.7, 12.8) -- (55.3, 12.8) -- (48.6, 1.9) -- cycle(67.7, -8.6) -- (61.9, -8.6) -- (61.9, 8.1) -- (56.7, 8.1) -- (56.7, 12.8) -- (72.9, 12.8) -- (72.9, 8.1) -- (67.7, 8.1) -- cycle(23.7, 44.3) -- (18.4, 22.9) -- (11.5, 22.9) -- (9.5, 32.2) .. controls (9.5, 32.4) and (9.4, 32.7) .. (9.3, 33.1) .. controls (9.2, 33.5) and (9.1, 34.0) .. (9.0, 34.6) .. controls (8.9, 35.1) and (8.8, 35.6) .. (8.8, 36.1) .. controls (8.7, 36.7) and (8.6, 37.1) .. (8.6, 37.5) .. controls (8.5, 37.1) and (8.5, 36.7) .. (8.4, 36.1) .. controls (8.3, 35.6) and (8.2, 35.1) .. (8.1, 34.6) .. controls (8.0, 34.0) and (7.9, 33.5) .. (7.8, 33.1) .. controls (7.7, 32.7) and (7.7, 32.4) .. (7.6, 32.2) -- (5.5, 22.9) -- (-1.3, 22.9) -- (-6.6, 44.3) -- (-1.0, 44.3) -- (1.3, 33.6) .. controls (1.4, 33.3) and (1.5, 32.9) .. (1.6, 32.4) .. controls (1.7, 31.9) and (1.8, 31.4) .. (1.9, 30.9) .. controls (2.0, 30.3) and (2.1, 29.8) .. (2.2, 29.2) .. controls (2.3, 28.7) and (2.4, 28.3) .. (2.4, 27.9) .. controls (2.5, 28.5) and (2.6, 29.2) .. (2.7, 30.0) .. controls (2.8, 30.7) and (3.0, 31.5) .. (3.1, 32.3) .. controls (3.3, 33.1) and (3.5, 33.8) .. (3.6, 34.5) .. controls (3.8, 35.2) and (3.9, 35.8) .. (4.0, 36.2) -- (5.9, 44.3) -- (11.2, 44.3) -- (13.1, 36.2) .. controls (13.2, 35.8) and (13.3, 35.2) .. (13.4, 34.5) .. controls (13.6, 33.8) and (13.8, 33.1) .. (13.9, 32.3) .. controls (14.1, 31.5) and (14.2, 30.7) .. (14.4, 29.9) .. controls (14.5, 29.2) and (14.6, 28.5) .. (14.7, 27.9) .. controls (14.7, 28.4) and (14.8, 29.0) .. (15.0, 29.8) .. controls (15.1, 30.5) and (15.2, 31.2) .. (15.4, 31.9) .. controls (15.5, 32.6) and (15.6, 33.2) .. (15.7, 33.5) -- (18.1, 44.3) -- cycle(38.4, 22.9) -- (37.3, 26.9) -- (30.4, 26.9) -- (29.3, 22.9) -- (22.9, 22.9) -- (29.9, 44.4) -- (37.6, 44.4) -- (44.7, 22.9) -- cycle(35.2, 35.2) .. controls (35.1, 35.5) and (34.9, 36.1) .. (34.8, 36.8) .. controls (34.6, 37.5) and (34.4, 38.2) .. (34.2, 39.0) .. controls (34.0, 39.8) and (33.9, 40.4) .. (33.8, 40.9) .. controls (33.7, 40.4) and (33.6, 39.8) .. (33.4, 39.1) .. controls (33.3, 38.3) and (33.1, 37.6) .. (32.9, 36.9) .. controls (32.7, 36.2) and (32.6, 35.6) .. (32.5, 35.2) -- (31.6, 31.6) -- (36.1, 31.6) -- cycle(64.3, 44.3) -- (57.3, 22.9) -- (50.5, 22.9) -- (43.5, 44.3) -- (50.0, 44.3) -- (52.9, 33.4) .. controls (53.0, 33.0) and (53.1, 32.5) .. (53.3, 31.9) .. controls (53.4, 31.2) and (53.5, 30.6) .. (53.7, 30.0) .. controls (53.8, 29.3) and (53.9, 28.8) .. (53.9, 28.4) .. controls (53.9, 28.8) and (54.0, 29.3) .. (54.1, 29.9) .. controls (54.2, 30.6) and (54.4, 31.2) .. (54.5, 31.8) .. controls (54.6, 32.5) and (54.7, 33.0) .. (54.9, 33.4) -- (57.8, 44.3) -- cycle(79.3, 22.9) -- (66.6, 22.9) -- (66.6, 44.3) -- (79.3, 44.3) -- (79.3, 39.7) -- (72.4, 39.7) -- (72.4, 36.3) -- (78.8, 36.3) -- (78.8, 31.6) -- (72.4, 31.6) -- (72.4, 27.6) -- (79.3, 27.6) -- cycle(9.8, 60.8) .. controls (9.8, 59.7) and (9.5, 58.6) .. (8.9, 57.5) .. controls (8.4, 56.5) and (7.4, 55.7) .. (6.2, 55.0) .. controls (5.0, 54.4) and (3.4, 54.0) .. (1.4, 54.0) .. controls (0.5, 54.0) and (-0.4, 54.1) .. (-1.1, 54.2) .. controls (-1.9, 54.3) and (-2.5, 54.4) .. (-3.2, 54.6) .. controls (-3.8, 54.8) and (-4.5, 55.1) .. (-5.2, 55.4) -- (-5.2, 60.5) .. controls (-4.0, 60.0) and (-2.8, 59.5) .. (-1.7, 59.2) .. controls (-0.5, 58.9) and (0.6, 58.7) .. (1.6, 58.7) .. controls (2.4, 58.7) and (3.0, 58.9) .. (3.4, 59.2) .. controls (3.8, 59.5) and (4.0, 59.9) .. (4.0, 60.3) .. controls (4.0, 60.9) and (3.7, 61.3) .. (3.1, 61.7) .. controls (2.6, 62.0) and (1.6, 62.5) .. (0.2, 63.2) .. controls (-0.9, 63.7) and (-1.8, 64.2) .. (-2.6, 64.7) .. controls (-3.4, 65.3) and (-4.0, 66.0) .. (-4.4, 66.8) .. controls (-4.8, 67.6) and (-5.0, 68.6) .. (-5.0, 69.8) .. controls (-5.0, 71.2) and (-4.7, 72.3) .. (-4.0, 73.2) .. controls (-3.3, 74.2) and (-2.4, 74.9) .. (-1.2, 75.3) .. controls (0.0, 75.8) and (1.5, 76.1) .. (3.1, 76.1) .. controls (4.5, 76.1) and (5.7, 75.9) .. (6.8, 75.6) .. controls (8.0, 75.3) and (9.0, 74.9) .. (9.8, 74.5) -- (8.1, 70.1) .. controls (7.1, 70.5) and (6.2, 70.8) .. (5.3, 71.0) .. controls (4.5, 71.3) and (3.6, 71.4) .. (2.9, 71.4) .. controls (2.1, 71.4) and (1.6, 71.3) .. (1.2, 71.0) .. controls (0.9, 70.8) and (0.7, 70.5) .. (0.7, 70.1) .. controls (0.7, 69.7) and (0.8, 69.4) .. (1.1, 69.2) .. controls (1.4, 68.9) and (1.8, 68.6) .. (2.4, 68.3) .. controls (3.0, 68.0) and (3.9, 67.6) .. (4.9, 67.1) .. controls (6.0, 66.7) and (6.8, 66.1) .. (7.6, 65.6) .. controls (8.3, 65.0) and (8.9, 64.4) .. (9.2, 63.6) .. controls (9.6, 62.9) and (9.8, 62.0) .. (9.8, 60.8) -- cycle(33.2, 65.1) .. controls (33.2, 62.9) and (32.8, 60.9) .. (32.1, 59.3) .. controls (31.4, 57.6) and (30.3, 56.3) .. (28.7, 55.4) .. controls (27.2, 54.5) and (25.2, 54.0) .. (22.8, 54.0) .. controls (20.4, 54.0) and (18.4, 54.5) .. (16.9, 55.4) .. controls (15.3, 56.3) and (14.2, 57.6) .. (13.4, 59.3) .. controls (12.7, 60.9) and (12.4, 62.9) .. (12.4, 65.1) .. controls (12.4, 67.3) and (12.7, 69.3) .. (13.5, 70.9) .. controls (14.2, 72.6) and (15.3, 73.8) .. (16.9, 74.7) .. controls (18.4, 75.6) and (20.4, 76.1) .. (22.8, 76.1) .. controls (25.2, 76.1) and (27.2, 75.6) .. (28.7, 74.7) .. controls (30.3, 73.8) and (31.4, 72.5) .. (32.1, 70.9) .. controls (32.8, 69.2) and (33.2, 67.3) .. (33.2, 65.1) -- cycle(18.4, 65.1) .. controls (18.4, 63.1) and (18.8, 61.6) .. (19.4, 60.5) .. controls (20.1, 59.4) and (21.2, 58.9) .. (22.8, 58.9) .. controls (24.4, 58.9) and (25.5, 59.4) .. (26.1, 60.5) .. controls (26.8, 61.6) and (27.1, 63.1) .. (27.1, 65.1) .. controls (27.1, 67.0) and (26.8, 68.5) .. (26.1, 69.7) .. controls (25.5, 70.8) and (24.4, 71.3) .. (22.8, 71.3) .. controls (21.2, 71.3) and (20.1, 70.8) .. (19.4, 69.7) .. controls (18.8, 68.5) and (18.4, 67.0) .. (18.4, 65.1) -- cycle(46.4, 54.3) -- (42.0, 69.8) -- (41.9, 69.8) .. controls (41.9, 69.4) and (42.0, 68.8) .. (42.0, 68.1) .. controls (42.0, 67.5) and (42.1, 66.7) .. (42.1, 65.9) .. controls (42.2, 65.1) and (42.2, 64.4) .. (42.2, 63.6) -- (42.2, 54.3) -- (37.0, 54.3) -- (37.0, 75.8) -- (44.8, 75.8) -- (49.2, 60.5) -- (49.3, 60.5) -- (53.7, 75.8) -- (61.4, 75.8) -- (61.4, 54.3) -- (56.1, 54.3) -- (56.1, 63.7) .. controls (56.1, 64.4) and (56.1, 65.1) .. (56.2, 65.9) .. controls (56.2, 66.7) and (56.2, 67.4) .. (56.2, 68.1) .. controls (56.3, 68.8) and (56.3, 69.3) .. (56.3, 69.7) -- (56.2, 69.7) -- (51.9, 54.3) -- cycle(78.8, 54.3) -- (66.1, 54.3) -- (66.1, 75.8) -- (78.8, 75.8) -- (78.8, 71.1) -- (71.8, 71.1) -- (71.8, 67.7) -- (78.3, 67.7) -- (78.3, 63.1) -- (71.8, 63.1) -- (71.8, 59.0) -- (78.8, 59.0) -- cycle;} \sbox\warpbox{\tikz{\textaspath}} \setlength{\warpboxwd}{\wd\warpbox} \setlength{\warpboxht}{\ht\warpbox} \begin{tikzpicture} \begin{scope} \pgftransformnonlinear{\wavewarp} \textaspath \end{scope} \end{tikzpicture} \vspace{2cm} \newcommand*{\textastext}{% \node[transform shape, transform shape nonlinear, inner sep=0pt, outer sep=0pt, align=center, font=\sffamily\Huge\bfseries] {% SOME\\ WAVE\\ TEXT};} \sbox\warpbox{\tikz{\textastext}} \setlength{\warpboxwd}{\wd\warpbox} \setlength{\warpboxht}{\ht\warpbox} \begin{tikzpicture} \begin{scope} \pgftransformnonlinear{\wavewarp} \textastext \end{scope} \end{tikzpicture} \end{document}
- Combine TikZ spy with a real pictureby mario1000 on August 22, 2024 at 1:08 pm
\documentclass{scrbook} \usepackage{xcolor} \usepackage{graphicx} \usepackage{eso-pic,graphicx} \usepackage{geometry} \usepackage{tikz} \usetikzlibrary{decorations.text} \usetikzlibrary{fadings} \usetikzlibrary{positioning,fadings,through} \usepgflibrary{shadings} \usetikzlibrary{shadings} \usetikzlibrary{calc,positioning} \usetikzlibrary{decorations.fractals,spy} \usetikzlibrary{spy} \usetikzlibrary{spy,calc} \usepackage{overpic} \begin{document} \usetikzlibrary {decorations.fractals,shadows,shapes.symbols,spy} \tikzset{spy using mag glass/.style={ spy scope={ every spy on node/.style={ circle, fill, fill opacity=0.2, text opacity=1}, every spy in node/.style={ magnifying glass, circular drop shadow, fill=white, draw, ultra thick, cap=round}, #1 }}} \begin{tikzpicture}[spy using mag glass={magnification=3, size=1cm}] \draw [decoration=Koch curve type 2] decorate{ decorate{ decorate{ (0,0) -- (2,0) }}}; \spy [red!50!yellow] on (1.6,0.1) in node at (2.5,-0.5); \end{tikzpicture} \begin{tikzpicture}[remember picture,overlay] \path (0,0) rectangle (\paperwidth,\paperheight); \node[inner sep=0pt,outer sep=0pt,anchor=north west] at ([xshift=4.6cm,yshift=-4.1cm]current page.north west) {\includegraphics[width=3cm]{D:/KG_Petra/Allgemeine_Bilder_fuer_Erlebnisberichte/Lupe_mit_Hand_removebg.png}}; \end{tikzpicture} \end{overpic} \end{document} Dear community, I would like to know whether it is possible to combine a TikZ spy with a real picture in a way that if I move the TikZ spy the associated real picture should move as well to the new position. What I am after is the following : I want to overlay this picture of a real loupe on top of a TikZ spy and move both of them simultaneously (which would look quite nice on e.g. photographs and other pictures). I am aware that in my example both pictures do not match 100% since this is a very time-consuming process if done by hand but to demonstrate what I would like to achieve this should be sufficient. Can this "marriage for all times" be done? Any help is greatly appreciated! Thank you!
- Plotting vector field with trigonometric functionby tulio on October 14, 2022 at 12:50 am
I'm trying to plot the vector field $F(x,y) = \cos (x+y) \vec{i} + x \vec{j}$ using tikz. I followed another topic on plotting vector fields I saw here, used to plot some other vector fields and it went pretty well, but this one is driving me nuts. The goal is this but instead I'm getting this using this code \begin{tikzpicture}[trig format = rad] \begin{axis}[ticks=none, view = {0}{90}, domain = -1:1, y domain = -1:1, samples = 21, ] \addplot3 [cyan, quiver={u={cos (x + y)}, v={x}, scale arrows=0.1},samples=10, -latex] (x,y,0); \end{axis} \end{tikzpicture} I didn't even try to put the lines that represent the $x$ and $y$ axis. First I wasn't using trig format = rad and it wasn't quite right. Then I tried changing the $x$ and $y$ domain, but it only made it worse. Then I tried using trig format = rad but then I got this random line there and the vector field isn't even what I wanted. Can anybody give some help please? Thanks in advance!
- Wiki engine to embed extensive Tex and PGF/Tikz codeby Tobard on May 18, 2018 at 12:36 pm
I would like to create a wiki (several authors) with scientific content, including text, equations, graphs and schemes. I wish to use LaTeX macros (including my own ones) and draw graphics with the powerful PGF/Tikz syntax. My aim is to minimize the work to turn a .tex file into a wiki page, and to keep code flexibility (ideal case would be to copy/paste raw .tex file content in a wiki page and the server should render it). Is Mediawiki able to do that? Is it possible to approach similar behavior with latex2html? Any feedback would be welcome! Thanks
- TikZ: ordinary arrow tip on double lineby Jamie Vicary on December 18, 2014 at 5:06 pm
I like the ordinary arrow tip that you get in TikZ from \draw [->] (a) to (b);. In my document I have lots of ordinary lines like this, and also lots of doubled lines like \draw [double,->] (c) to (d);. But it looks a bit strange, since the arrow tips are different. I think it would look better if all the lines used the ordinary arrow tip. So, here's my question: how can I get an arrow tip myarrow such that \draw [double distance=0.5pt,-myarrow] (c) to (d); gives me exactly the same arrow tip as with an ordinary line? I would like this to work for a range of values of double distance, say less than 1pt.
- Strike out a table cellby Henri Menke on January 27, 2014 at 10:23 am
I'm trying to strike out cells in a table, without specifying the cell width. To do so, I looked at the code of colortbl as this seems to a very decent job with filling cells. Now I played around with all those \@tempdim but without any success. Honestly I have no idea what I'm doing. If possible, I'd like to get rid of tikz. What I have tried so far \documentclass{article} \pagestyle{empty}% for cropping \usepackage{tikz,colortbl} \makeatletter \newcommand*\notableentry{% \@tempdima\wd\z@ \advance\@tempdima\@tempdimb \advance\@tempdima\@tempdimc \tikz[remember picture]{\coordinate (X) at (-.5\tabcolsep-\@tempdima-\@tempdimb-\@tempdimc,-1.1\tabcolsep);} \hskip\@tempdima\@plus 1fill \kern-\tabcolsep \hskip-\wd\z@ \@plus -1fill \tikz[remember picture]{\coordinate (Y) at (.5\tabcolsep+\@tempdima+\@tempdimb,\@tempdima-.25\tabcolsep);} } \makeatother \begin{document} \LARGE \begin{tabular}{|c|c|} \hline alghreaiog & bghsah \\ \hline cagja & \notableentry \\ \hline \cellcolor{blue} & edkhaklgjaj \\ \hline \end{tabular} \tikz[remember picture,overlay]{% \draw[red] (X) -- (Y); \draw[red] (X |- Y) -- (Y |- X); } \begin{tabular}{|p{4cm}|p{3cm}|} \hline alghreaiog & bghsah \\ \hline cagja\par bla & \notableentry \\ \hline \cellcolor{blue} & edkhaklgjaj \par xyz \\ \hline \end{tabular} \tikz[remember picture,overlay]{% \draw[red] (X) -- (Y); \draw[red] (X |- Y) -- (Y |- X); } \end{document} Output It seems to work for c columns, but fails for all other purposes, while \cellcolor always works.
- TikZ editor for Mac OSby LouisG on May 1, 2013 at 1:18 pm
I'm looking for an editor like tikzedt for Mac OS X. Or something similar in order to write and see quickly the result. Any suggestion ?